Use a better way of skipping SEMIs

This commit is contained in:
DJMcNab 2018-12-20 18:39:38 +00:00
parent dc1c64f5b9
commit 1d1950336f
1 changed files with 6 additions and 6 deletions

View File

@ -42,14 +42,15 @@ pub(crate) fn block(p: &mut Parser) {
}
let m = p.start();
p.bump();
// test nocontentexpr
// fn foo(){
// ;;;some_expr();;;;{;;;};;;;Ok(())
// }
while p.eat(SEMI) {}
while !p.at(EOF) && !p.at(R_CURLY) {
match p.current() {
LET_KW => let_stmt(p),
// test nocontentexpr
// fn foo(){
// ;;;some_expr();;;;{;;;};;;;Ok(())
// }
SEMI => p.bump(),
_ => {
// test block_items
// fn a() { fn b() {} }
@ -94,7 +95,6 @@ pub(crate) fn block(p: &mut Parser) {
}
}
}
while p.eat(SEMI) {}
}
p.expect(R_CURLY);
m.complete(p, BLOCK);