Separate concepts of hidden and auxiliary symbols
This way, we can hide auxiliary symbols from library users, but still allow them to use hidden symbols
This commit is contained in:
parent
49ad910474
commit
acad97cfd2
13 changed files with 154 additions and 131 deletions
|
|
@ -27,7 +27,7 @@ namespace tree_sitter {
|
|||
|
||||
rule_ptr make_repeat_helper(string name, const rule_ptr &rule) {
|
||||
return Choice::Build({
|
||||
Seq::Build({ rule, make_shared<Symbol>(name, true) }),
|
||||
Seq::Build({ rule, make_shared<Symbol>(name, SymbolTypeAuxiliary) }),
|
||||
make_shared<Blank>() });
|
||||
}
|
||||
|
||||
|
|
@ -35,7 +35,7 @@ namespace tree_sitter {
|
|||
rule_ptr inner_rule = apply(rule->content);
|
||||
string helper_rule_name = string("repeat_helper") + to_string(aux_rules.size() + 1);
|
||||
aux_rules.insert({ helper_rule_name, make_repeat_helper(helper_rule_name, inner_rule) });
|
||||
value = make_shared<Symbol>(helper_rule_name, true);
|
||||
value = make_shared<Symbol>(helper_rule_name, SymbolTypeAuxiliary);
|
||||
}
|
||||
|
||||
void visit(const Seq *rule) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue