Skip to content

Commit

Permalink
Bison grammar: refactor items to allow "extern crate" in stmts
Browse files Browse the repository at this point in the history
  • Loading branch information
bleibig committed Feb 11, 2015
1 parent 41d6513 commit 03cc48c
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/grammar/parser-lalr.y
Expand Up @@ -258,11 +258,7 @@ mod_item

// items that can appear outside of a fn block
item
: item_static
| item_const
| item_type
| block_item
| view_item
: stmt_item
| item_macro
;

Expand All @@ -272,8 +268,7 @@ stmt_item
| item_const
| item_type
| block_item
| use_item
| extern_fn_item
| view_item
;

item_static
Expand All @@ -295,7 +290,6 @@ view_item
: use_item
| extern_fn_item
| EXTERN CRATE ident ';' { $$ = mk_node("ViewItemExternCrate", 1, $3); }
| EXTERN CRATE ident '=' str ';' { $$ = mk_node("ViewItemExternCrate", 2, $3, $5); }
| EXTERN CRATE str AS ident ';' { $$ = mk_node("ViewItemExternCrate", 2, $3, $5); }
;

Expand Down

0 comments on commit 03cc48c

Please sign in to comment.