File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
src/libsyntax/parse/parser Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,22 @@ impl<'a> Parser<'a> {
167167 if self . token == token:: Semi {
168168 unused_attrs ( & attrs, self ) ;
169169 self . bump ( ) ;
170- return Ok ( None ) ;
170+ let mut last_semi = lo;
171+ while self . token == token:: Semi {
172+ last_semi = self . token . span ;
173+ self . bump ( ) ;
174+ }
175+ // We are encoding a string of semicolons as an
176+ // an empty tuple that spans the excess semicolons
177+ // to preserve this info until the lint stage
178+ return Ok ( Some ( Stmt {
179+ id : ast:: DUMMY_NODE_ID ,
180+ span : lo. to ( last_semi) ,
181+ node : StmtKind :: Semi ( self . mk_expr ( lo. to ( last_semi) ,
182+ ExprKind :: Tup ( Vec :: new ( ) ) ,
183+ ThinVec :: new ( )
184+ ) ) ,
185+ } ) ) ;
171186 }
172187
173188 if self . token == token:: CloseDelim ( token:: Brace ) {
You can’t perform that action at this time.
0 commit comments