summaryrefslogtreecommitdiff
path: root/compiler/parser/Lexer.x
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/parser/Lexer.x')
-rw-r--r--compiler/parser/Lexer.x14
1 files changed, 9 insertions, 5 deletions
diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x
index 32f4254703..db96acbcbc 100644
--- a/compiler/parser/Lexer.x
+++ b/compiler/parser/Lexer.x
@@ -2641,11 +2641,15 @@ clean_pragma prag = canon_ws (map toLower (unprefix prag))
%************************************************************************
-}
--- |Encapsulated call to addAnnotation, requiring only the SrcSpan of
--- the AST element the annotation belongs to
-type AddAnn = (SrcSpan -> P ())
-
-addAnnotation :: SrcSpan -> AnnKeywordId -> SrcSpan -> P ()
+-- | Encapsulated call to addAnnotation, requiring only the SrcSpan of
+-- the AST construct the annotation belongs to; together with the
+-- AnnKeywordId, this is is the key of the annotation map
+type AddAnn = SrcSpan -> P ()
+
+addAnnotation :: SrcSpan -- SrcSpan of enclosing AST construct
+ -> AnnKeywordId -- The first two parameters are the key
+ -> SrcSpan -- The location of the keyword itself
+ -> P ()
addAnnotation l a v = do
addAnnotationOnly l a v
allocateComments l