Skip to content

Commit 03cc48c

Browse files
committed
Bison grammar: refactor items to allow "extern crate" in stmts
1 parent 41d6513 commit 03cc48c

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/grammar/parser-lalr.y

+2-8
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,7 @@ mod_item
258258

259259
// items that can appear outside of a fn block
260260
item
261-
: item_static
262-
| item_const
263-
| item_type
264-
| block_item
265-
| view_item
261+
: stmt_item
266262
| item_macro
267263
;
268264

@@ -272,8 +268,7 @@ stmt_item
272268
| item_const
273269
| item_type
274270
| block_item
275-
| use_item
276-
| extern_fn_item
271+
| view_item
277272
;
278273

279274
item_static
@@ -295,7 +290,6 @@ view_item
295290
: use_item
296291
| extern_fn_item
297292
| EXTERN CRATE ident ';' { $$ = mk_node("ViewItemExternCrate", 1, $3); }
298-
| EXTERN CRATE ident '=' str ';' { $$ = mk_node("ViewItemExternCrate", 2, $3, $5); }
299293
| EXTERN CRATE str AS ident ';' { $$ = mk_node("ViewItemExternCrate", 2, $3, $5); }
300294
;
301295

0 commit comments

Comments
 (0)