summaryrefslogtreecommitdiffstats
path: root/parsing/parser.mly
diff options
context:
space:
mode:
Diffstat (limited to 'parsing/parser.mly')
-rw-r--r--parsing/parser.mly6
1 files changed, 5 insertions, 1 deletions
diff --git a/parsing/parser.mly b/parsing/parser.mly
index 841a93f8b..47ff7cbe2 100644
--- a/parsing/parser.mly
+++ b/parsing/parser.mly
@@ -228,11 +228,15 @@ interface:
signature EOF { List.rev $1 }
;
toplevel_phrase:
- structure_item SEMISEMI { Ptop_def[$1] }
+ top_structure SEMISEMI { Ptop_def $1 }
| expr SEMISEMI { Ptop_def[mkstrexp $1] }
| toplevel_directive SEMISEMI { $1 }
| EOF { raise End_of_file }
;
+top_structure:
+ structure_item { [$1] }
+ | structure_item top_structure { $1 :: $2 }
+;
use_file:
use_file_tail { $1 }
| expr use_file_tail { Ptop_def[mkstrexp $1] :: $2 }