diff options
Diffstat (limited to 'src/parser/event_parser/grammar/items.rs')
-rw-r--r-- | src/parser/event_parser/grammar/items.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/parser/event_parser/grammar/items.rs b/src/parser/event_parser/grammar/items.rs index e569e5047..0638e3093 100644 --- a/src/parser/event_parser/grammar/items.rs +++ b/src/parser/event_parser/grammar/items.rs | |||
@@ -1,8 +1,8 @@ | |||
1 | use super::*; | 1 | use super::*; |
2 | 2 | ||
3 | pub(super) fn mod_contents(p: &mut Parser) { | 3 | pub(super) fn mod_contents(p: &mut Parser, stop_on_r_curly: bool) { |
4 | attributes::inner_attributes(p); | 4 | attributes::inner_attributes(p); |
5 | while !p.at(EOF) { | 5 | while !p.at(EOF) && !(stop_on_r_curly && p.at(R_CURLY)) { |
6 | item(p); | 6 | item(p); |
7 | } | 7 | } |
8 | } | 8 | } |
@@ -152,7 +152,10 @@ fn mod_item(p: &mut Parser) { | |||
152 | p.bump(); | 152 | p.bump(); |
153 | 153 | ||
154 | if p.expect(IDENT) && !p.eat(SEMI) { | 154 | if p.expect(IDENT) && !p.eat(SEMI) { |
155 | p.curly_block(mod_contents); | 155 | if p.expect(L_CURLY) { |
156 | mod_contents(p, true); | ||
157 | p.expect(R_CURLY); | ||
158 | } | ||
156 | } | 159 | } |
157 | } | 160 | } |
158 | 161 | ||