aboutsummaryrefslogtreecommitdiff
path: root/src/parser/event_parser/grammar/items.rs
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2018-01-28 10:02:15 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2018-01-28 10:02:15 +0000
commit37ee4c4c2afc1df536f50a776ac16dab69a67058 (patch)
treed5fa1fb60be28d819300eb4aec9df0dfe6200303 /src/parser/event_parser/grammar/items.rs
parent469654e08867b60c8a499fb3751a1c26e0b90397 (diff)
parent0663c24222ebb2da10c26f690ad508e7b1fae8f9 (diff)
Merge #23
23: Simplify item parsing r=matklad a=matklad
Diffstat (limited to 'src/parser/event_parser/grammar/items.rs')
-rw-r--r--src/parser/event_parser/grammar/items.rs9
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 @@
1use super::*; 1use super::*;
2 2
3pub(super) fn mod_contents(p: &mut Parser) { 3pub(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