mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
parse empty statemet as statemetn
This commit is contained in:
parent
841cd30b45
commit
b5369927d7
4 changed files with 15 additions and 20 deletions
|
@ -30,6 +30,10 @@ fn expr_no_struct(p: &mut Parser) {
|
|||
}
|
||||
|
||||
pub(super) fn stmt(p: &mut Parser, semicolon: Semicolon) {
|
||||
if p.eat(T![;]) {
|
||||
return;
|
||||
}
|
||||
|
||||
let m = p.start();
|
||||
// test attr_on_expr_stmt
|
||||
// fn foo() {
|
||||
|
@ -143,12 +147,6 @@ pub(super) fn expr_block_contents(p: &mut Parser) {
|
|||
// fn f() {};
|
||||
// struct S {};
|
||||
// }
|
||||
|
||||
if p.at(T![;]) {
|
||||
p.bump(T![;]);
|
||||
continue;
|
||||
}
|
||||
|
||||
stmt(p, Semicolon::Required);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue