Add token helper for building token rules
Now you can specify the structure of tokens using all of the rule functions, not just `str` and `pattern`
This commit is contained in:
parent
d685edf015
commit
6d40dcf881
8 changed files with 59 additions and 12 deletions
|
|
@ -21,6 +21,7 @@ namespace tree_sitter {
|
|||
rule_ptr str(const std::string &value);
|
||||
rule_ptr err(const rule_ptr &rule);
|
||||
rule_ptr prec(int precedence, rule_ptr rule);
|
||||
rule_ptr token(rule_ptr rule);
|
||||
}
|
||||
|
||||
class Grammar {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue