mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +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
|
@ -76,8 +76,7 @@ impl<'a> LexedStr<'a> {
|
|||
builder.eat_trivias();
|
||||
(builder.sink)(StrStep::Exit);
|
||||
}
|
||||
State::PendingEnter => (),
|
||||
State::Normal => unreachable!(),
|
||||
State::PendingEnter | State::Normal => (),
|
||||
}
|
||||
|
||||
let is_eof = builder.pos == builder.lexed.len();
|
||||
|
@ -101,9 +100,8 @@ enum State {
|
|||
impl Builder<'_, '_> {
|
||||
fn token(&mut self, kind: SyntaxKind, n_tokens: u8) {
|
||||
match mem::replace(&mut self.state, State::Normal) {
|
||||
State::PendingEnter => unreachable!(),
|
||||
State::PendingExit => (self.sink)(StrStep::Exit),
|
||||
State::Normal => (),
|
||||
State::PendingEnter | State::Normal => (),
|
||||
}
|
||||
self.eat_trivias();
|
||||
self.do_token(kind, n_tokens as usize);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue