Add a TSLexer.eof() API, use it in generated parsers

This commit is contained in:
Max Brunsfeld 2019-10-30 17:11:15 -07:00
parent a62b7a70f3
commit d3b7caa565
6 changed files with 24 additions and 11 deletions

View file

@ -540,6 +540,10 @@ impl Generator {
add_line!(self, "ACCEPT_TOKEN({});", self.symbol_ids[&accept_action]);
}
if let Some(eof_action) = state.eof_action {
add_line!(self, "if (eof) ADVANCE({});", eof_action.state);
}
let mut ruled_out_characters = HashSet::new();
for (characters, action) in state.advance_actions {
let previous_length = self.buffer.len();