Allow ubiquitous tokens to also be used in grammar rules
This commit is contained in:
parent
a9dff20658
commit
9686c57e90
22 changed files with 49452 additions and 47887 deletions
|
|
@ -51,7 +51,6 @@ namespace tree_sitter {
|
|||
state_and_symbol_counts();
|
||||
symbol_enum();
|
||||
symbol_names_list();
|
||||
ubiquitous_symbols_list();
|
||||
hidden_symbols_list();
|
||||
lex_function();
|
||||
lex_states_list();
|
||||
|
|
@ -104,16 +103,6 @@ namespace tree_sitter {
|
|||
line();
|
||||
}
|
||||
|
||||
void ubiquitous_symbols_list() {
|
||||
line("UBIQUITOUS_SYMBOLS = {");
|
||||
indent([&]() {
|
||||
for (auto &symbol : syntax_grammar.ubiquitous_tokens)
|
||||
line("[" + symbol_id(symbol) + "] = 1,");
|
||||
});
|
||||
line("};");
|
||||
line();
|
||||
}
|
||||
|
||||
void hidden_symbols_list() {
|
||||
line("HIDDEN_SYMBOLS = {");
|
||||
indent([&]() {
|
||||
|
|
@ -293,6 +282,9 @@ namespace tree_sitter {
|
|||
case ParseActionTypeShift:
|
||||
add("SHIFT(" + to_string(action.state_index) + ")");
|
||||
break;
|
||||
case ParseActionTypeShiftExtra:
|
||||
add("SHIFT_EXTRA()");
|
||||
break;
|
||||
case ParseActionTypeReduce:
|
||||
add("REDUCE(" +
|
||||
symbol_id(action.symbol) + ", " +
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue