From 81b29cb33cba0f71e7e8d6c54f08360ddb3b3d85 Mon Sep 17 00:00:00 2001 From: Trevor Elliott Date: Wed, 10 Jun 2015 21:45:44 -0700 Subject: [PATCH] Ignore some doc comments --- src/Cryptol/Parser.y | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/Cryptol/Parser.y b/src/Cryptol/Parser.y index 83cf7378..40fad172 100644 --- a/src/Cryptol/Parser.y +++ b/src/Cryptol/Parser.y @@ -221,20 +221,28 @@ vtop_decls :: { [TopDecl] } | vtop_decls ';' vtop_decl { $3 ++ $1 } vtop_decl :: { [TopDecl] } - : decl { [exportDecl Nothing Public $1] } - | doc decl { [exportDecl (Just $1) Public $2] } - | 'private' 'v{' vtop_decls 'v}' { changeExport Private (reverse $3) } - | 'include' STRLIT {% (return . Include) `fmap` fromStrLit $2 } - | mbDoc 'property' name apats '=' expr { [exportDecl $1 Public (mkProperty $3 $4 $6)]} - | mbDoc 'property' name '=' expr { [exportDecl $1 Public (mkProperty $3 [] $5)]} - | newtype { [exportNewtype Public $1] } - | prim_bind { $1 } + : decl { [exportDecl Nothing Public $1] } + | doc decl { [exportDecl (Just $1) Public $2] } + | mbDoc 'include' STRLIT {% (return . Include) `fmap` fromStrLit $3 } + | mbDoc 'property' name apats '=' expr + { [exportDecl $1 Public (mkProperty $3 $4 $6)] } + | mbDoc 'property' name '=' expr + { [exportDecl $1 Public (mkProperty $3 [] $5)] } + | mbDoc newtype { [exportNewtype Public $2] } + | prim_bind { $1 } + | private_decls { $1 } top_decl :: { [TopDecl] } : decl { [Decl (TopLevel {tlExport = Public, tlValue = $1 })] } | 'include' STRLIT {% (return . Include) `fmap` fromStrLit $2 } | prim_bind { $1 } +private_decls :: { [TopDecl] } + : 'private' 'v{' vtop_decls 'v}' + { changeExport Private (reverse $3) } + | doc 'private' 'v{' vtop_decls 'v}' + { changeExport Private (reverse $4) } + prim_bind :: { [TopDecl] } : mbDoc 'primitive' name ':' schema { mkPrimDecl $1 False $3 $5 } | mbDoc 'primitive' '(' op ')' ':' schema { mkPrimDecl $1 True $4 $7 }