Restructure parse state merging logic

* Remove remnants of templatized remove_duplicate_states function
* Rename recovery_tokens function to get_compatible_tokens and augment it
  also compute pairs of tokens which could potentially be incompatible
This commit is contained in:
Max Brunsfeld 2017-02-26 12:23:35 -08:00
parent 8d3b72e1d9
commit 3c8e6f9987
13 changed files with 274 additions and 252 deletions

View file

@ -57,11 +57,6 @@ bool LexState::operator==(const LexState &other) const {
is_token_start == other.is_token_start;
}
void LexState::each_referenced_state(function<void(LexStateId *)> fn) {
for (auto &entry : advance_actions)
fn(&entry.second.state_index);
}
LexStateId LexTable::add_state() {
states.push_back(LexState());
return states.size() - 1;
@ -71,8 +66,4 @@ LexState &LexTable::state(LexStateId id) {
return states[id];
}
bool LexTable::merge_state(size_t i, size_t j) {
return states[i] == states[j];
}
} // namespace tree_sitter