In lexer, prefer tokens to skipped separator characters
This was causing newlines in go and javascript to be parsed as meaningless separator characters instead of statement terminators
This commit is contained in:
parent
220e081c49
commit
e93e254518
26 changed files with 5559 additions and 6650 deletions
|
|
@ -88,7 +88,7 @@ namespace tree_sitter {
|
|||
const PreparedGrammar & grammar_for_symbol(const rules::Symbol &symbol) {
|
||||
return symbol.is_token() ? lexical_grammar : syntax_grammar;
|
||||
}
|
||||
|
||||
|
||||
string sanitize_name(string name) {
|
||||
auto existing = sanitized_names.find(name);
|
||||
if (existing != sanitized_names.end())
|
||||
|
|
@ -115,7 +115,7 @@ namespace tree_sitter {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool has_sanitized_name(string name) {
|
||||
for (auto &pair : sanitized_names)
|
||||
if (pair.second == name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue