This module contains some utilities and generic code for working with
asts and annotations which depend on the ast types.
>
>
> module Database.HsSqlPpp.Internals.AnnotationUtils
> (
> getStatementAnnotations
> ,resetAnnotations
> ) where
>
> import Data.Data
> import Data.Generics.Uniplate.Data
>
> import Database.HsSqlPpp.Internals.AstInternal
> import Database.HsSqlPpp.Internals.AstAnnotation
>
>
>
> getStatementAnnotations :: Data a => a -> [Annotation]
> getStatementAnnotations st =
> [getAnnotation s | (s::Statement) <- universeBi st]
>
> resetAnnotations :: Data a => a -> a
> resetAnnotations =
> updateAnnotations (const emptyAnnotation)