Introduce 'ubiquitous_tokens' concept, for parsing comments and such
This commit is contained in:
parent
b010e1667e
commit
4700e33746
24 changed files with 18321 additions and 19057 deletions
|
|
@ -25,13 +25,19 @@ namespace tree_sitter {
|
|||
rule_ptr token(rule_ptr rule);
|
||||
}
|
||||
|
||||
struct GrammarOptions {
|
||||
std::vector<std::string> ubiquitous_tokens;
|
||||
};
|
||||
|
||||
class Grammar {
|
||||
public:
|
||||
Grammar(const std::vector<std::pair<std::string, rules::rule_ptr>> &rules);
|
||||
Grammar(const std::vector<std::pair<std::string, rules::rule_ptr>> &rules, GrammarOptions options);
|
||||
bool operator==(const Grammar &other) const;
|
||||
std::string start_rule_name() const;
|
||||
const rules::rule_ptr rule(const std::string &name) const;
|
||||
const std::vector<std::pair<std::string, rules::rule_ptr>> rules;
|
||||
const GrammarOptions options;
|
||||
};
|
||||
|
||||
struct Conflict {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue