ra_syntax: refactored the lexer design as per @matklad and @kiljacken PR review

This commit is contained in:
Veetaha 2020-01-28 07:09:13 +02:00
parent bf60661aa3
commit 9e7eaa959f
9 changed files with 202 additions and 181 deletions

View file

@ -92,14 +92,14 @@ impl<'a> TreeSink for TextTreeSink<'a> {
}
impl<'a> TextTreeSink<'a> {
pub(super) fn new(text: &'a str, tokens: &'a [Token], errors: Vec<SyntaxError>) -> Self {
pub(super) fn new(text: &'a str, tokens: &'a [Token]) -> Self {
Self {
text,
tokens,
text_pos: 0.into(),
token_pos: 0,
state: State::PendingStart,
inner: SyntaxTreeBuilder::new(errors),
inner: SyntaxTreeBuilder::default(),
}
}