internal: add tests for extra parser entry points

This commit is contained in:
Aleksey Kladov 2021-12-29 18:23:34 +03:00
parent 355a4bdb88
commit 3f5fc05d66
4 changed files with 46 additions and 1 deletions

View file

@ -16,6 +16,7 @@ use crate::{
SyntaxKind::{self, *},
};
#[derive(Debug)]
pub enum StrStep<'a> {
Token { kind: SyntaxKind, text: &'a str },
Enter { kind: SyntaxKind },
@ -75,7 +76,8 @@ impl<'a> LexedStr<'a> {
builder.eat_trivias();
(builder.sink)(StrStep::Exit);
}
State::PendingEnter | State::Normal => unreachable!(),
State::PendingEnter => (),
State::Normal => unreachable!(),
}
let is_eof = builder.pos == builder.lexed.len();