Convert repeat rules into pairs of recursive rules

This commit is contained in:
Max Brunsfeld 2014-01-24 18:25:56 -08:00
parent cbcf28f9d4
commit 67fa81d079
10 changed files with 328 additions and 218 deletions

View file

@ -40,6 +40,7 @@ namespace tree_sitter {
bool LexItem::operator<(const LexItem &other) const {
if (rule_name < other.rule_name) return true;
if (rule_name > other.rule_name) return false;
if (rule->to_string() < other.rule->to_string()) return true;
return false;
}
@ -50,6 +51,7 @@ namespace tree_sitter {
if (rule->to_string() < other.rule->to_string()) return true;
if (rule->to_string() > other.rule->to_string()) return false;
if (consumed_sym_count < other.consumed_sym_count) return true;
if (consumed_sym_count > other.consumed_sym_count) return false;
if (lookahead_sym_name < other.lookahead_sym_name) return true;
return false;
}