Update rule hash implementation
This commit is contained in:
parent
3116b457fe
commit
257b8d7b68
18 changed files with 80 additions and 30 deletions
|
|
@ -2,6 +2,7 @@
|
|||
#include "transition_map.h"
|
||||
|
||||
using std::string;
|
||||
using std::hash;
|
||||
|
||||
namespace tree_sitter {
|
||||
namespace rules {
|
||||
|
|
@ -12,6 +13,10 @@ namespace tree_sitter {
|
|||
return (other != NULL) && (other->value == value);
|
||||
}
|
||||
|
||||
size_t String::hash_code() const {
|
||||
return typeid(this).hash_code() ^ hash<string>()(value);
|
||||
}
|
||||
|
||||
string String::to_string() const {
|
||||
return string("#<string '") + value + "'>";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue