@@ -1009,21 +1009,17 @@ module_ :
1009
1009
$3, Textual (m, parse_annots m) @@ $sloc }
1010
1010
1011
1011
inline_module : /* Sugar */
1012
- | module_fields EOF
1012
+ | module_fields
1013
1013
{ let m = $1 (empty_context ()) () @@ $sloc in
1014
1014
(* Hack to handle annotations before first and after last token *)
1015
- (* Note: need EOF token here, since Menhir delivers a location
1016
- * with empty filename for $1 in case module_fields is empty! *)
1017
- let all = all_region (at $loc($2)).left.file in
1015
+ let all = all_region (at $sloc).left.file in
1018
1016
Textual (m, parse_annots Source.(m.it @@ all)) @@ $sloc }
1019
1017
1020
1018
inline_module1 : /* Sugar */
1021
- | module_fields1 EOF
1019
+ | module_fields1
1022
1020
{ let m = $1 (empty_context ()) () @@ $sloc in
1023
1021
(* Hack to handle annotations before first and after last token *)
1024
- (* Note: need EOF token here, since Menhir delivers a location
1025
- * with empty filename for $1 in case module_fields is empty! *)
1026
- let all = all_region (at $loc($2)).left.file in
1022
+ let all = all_region (at $sloc).left.file in
1027
1023
Textual (m, parse_annots Source.(m.it @@ all)) @@ $sloc }
1028
1024
1029
1025
@@ -1110,12 +1106,12 @@ result :
1110
1106
1111
1107
script :
1112
1108
| list(cmd) EOF { $1 }
1113
- | inline_module1 { [Module (None, $1) @@ $sloc] } /* Sugar */
1109
+ | inline_module1 EOF { [Module (None, $1) @@ $sloc] } /* Sugar */
1114
1110
1115
1111
script1 :
1116
1112
| cmd { [$1] }
1117
1113
1118
1114
module1 :
1119
1115
| module_ EOF { $1 }
1120
- | inline_module { None, $1 } /* Sugar */
1116
+ | inline_module EOF { None, $1 } /* Sugar */
1121
1117
%%
0 commit comments