We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c01be67 commit 71415efCopy full SHA for 71415ef
src/libsyntax/parse/parser/stmt.rs
@@ -167,7 +167,22 @@ impl<'a> Parser<'a> {
167
if self.token == token::Semi {
168
unused_attrs(&attrs, self);
169
self.bump();
170
- return Ok(None);
+ 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
+ }));
186
}
187
188
if self.token == token::CloseDelim(token::Brace) {
0 commit comments