diff --git a/src/passes/1-parser/pascaligo/AST.ml b/src/passes/1-parser/pascaligo/AST.ml index 79ecbc000..6a2185480 100644 --- a/src/passes/1-parser/pascaligo/AST.ml +++ b/src/passes/1-parser/pascaligo/AST.ml @@ -212,8 +212,8 @@ and type_tuple = (type_expr, comma) nsepseq par reg (* Function and procedure declarations *) and fun_decl = - BlockFun of block_fun reg - | BlocklessFun of blockless_fun reg + BlockFun of block_fun + | BlocklessFun of blockless_fun and block_fun = { kwd_function : kwd_function; diff --git a/src/passes/1-parser/pascaligo/AST.mli b/src/passes/1-parser/pascaligo/AST.mli index 3319ad331..2b16366eb 100644 --- a/src/passes/1-parser/pascaligo/AST.mli +++ b/src/passes/1-parser/pascaligo/AST.mli @@ -203,8 +203,8 @@ and type_tuple = (type_expr, comma) nsepseq par reg (* Function declarations *) and fun_decl = - BlockFun of block_fun reg - | BlocklessFun of blockless_fun reg + BlockFun of block_fun + | BlocklessFun of blockless_fun and block_fun = { kwd_function : kwd_function; diff --git a/src/passes/1-parser/pascaligo/Parser.mly b/src/passes/1-parser/pascaligo/Parser.mly index fc4456c40..275ed353c 100644 --- a/src/passes/1-parser/pascaligo/Parser.mly +++ b/src/passes/1-parser/pascaligo/Parser.mly @@ -263,7 +263,8 @@ fun_decl: kwd_with = $9; return = $10; terminator = $11} - in BlockFun {region; value}} + in {region = region; + value = BlockFun value} } | Function fun_name parameters COLON type_expr Is Expr expr option(SEMI) { let stop = @@ -282,7 +283,8 @@ fun_decl: return = $8; terminator = $9; } - in BlocklessFun {region; value}} + in {region = region; + value = BlocklessFun value} } parameters: par(nsepseq(param_decl,SEMI)) { $1 }