File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
src/parser/event_parser/grammar Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 1
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
4
attributes:: inner_attributes ( p) ;
5
- while !p. at ( EOF ) {
5
+ while !p. at ( EOF ) && ! ( stop_on_r_curly && p . at ( R_CURLY ) ) {
6
6
item ( p) ;
7
7
}
8
8
}
@@ -152,7 +152,10 @@ fn mod_item(p: &mut Parser) {
152
152
p. bump ( ) ;
153
153
154
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
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ mod paths;
11
11
pub ( crate ) fn file ( p : & mut Parser ) {
12
12
let file = p. start ( ) ;
13
13
p. eat ( SHEBANG ) ;
14
- items:: mod_contents ( p) ;
14
+ items:: mod_contents ( p, false ) ;
15
15
file. complete ( p, FILE ) ;
16
16
}
17
17
You can’t perform that action at this time.
0 commit comments