Make ordering of cases deterministic in generated parsers
This commit is contained in:
parent
8baa1396fd
commit
15c9e2d398
12 changed files with 369 additions and 348 deletions
|
|
@ -64,6 +64,10 @@ namespace tree_sitter {
|
|||
return other && (ranges == other->ranges);
|
||||
}
|
||||
|
||||
bool CharacterSet::operator<(const CharacterSet &other) const {
|
||||
return ranges < other.ranges;
|
||||
}
|
||||
|
||||
size_t CharacterSet::hash_code() const {
|
||||
return typeid(this).hash_code() ^ hash<string>()(to_string());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue