Make ordering of cases deterministic in generated parsers

This commit is contained in:
Max Brunsfeld 2014-02-10 18:38:01 -08:00
parent 8baa1396fd
commit 15c9e2d398
12 changed files with 369 additions and 348 deletions

View file

@ -33,9 +33,9 @@ namespace tree_sitter {
}
bool Symbol::operator<(const Symbol &other) const {
if (name < other.name) return true;
if (other.name < name) return false;
return is_auxiliary < other.is_auxiliary;
if (is_auxiliary < other.is_auxiliary) return true;
if (is_auxiliary > other.is_auxiliary) return false;
return (name < other.name);
}
void Symbol::accept(Visitor &visitor) const {