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 11use super :: * ;
22
3- pub ( super ) fn mod_contents ( p : & mut Parser ) {
3+ pub ( super ) fn mod_contents ( p : & mut Parser , stop_on_r_curly : bool ) {
44 attributes:: inner_attributes ( p) ;
5- while !p. at ( EOF ) {
5+ while !p. at ( EOF ) && ! ( stop_on_r_curly && p . at ( R_CURLY ) ) {
66 item ( p) ;
77 }
88}
@@ -152,7 +152,10 @@ fn mod_item(p: &mut Parser) {
152152 p. bump ( ) ;
153153
154154 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+ }
156159 }
157160}
158161
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ mod paths;
1111pub ( crate ) fn file ( p : & mut Parser ) {
1212 let file = p. start ( ) ;
1313 p. eat ( SHEBANG ) ;
14- items:: mod_contents ( p) ;
14+ items:: mod_contents ( p, false ) ;
1515 file. complete ( p, FILE ) ;
1616}
1717
You can’t perform that action at this time.
0 commit comments