diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/parser.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/parser.c b/src/parser.c index 7cd22ae..8d846d6 100644 --- a/src/parser.c +++ b/src/parser.c | |||
@@ -430,9 +430,11 @@ parse_next(Parser *parser) { | |||
430 | } | 430 | } |
431 | } | 431 | } |
432 | 432 | ||
433 | uint64_t sym_hash(const struct HashTable *table, void *bytes) { | 433 | u64 sym_hash(const struct HashTable *table, void *bytes) { |
434 | // TODO: implement | 434 | Node *symbol = bytes; |
435 | return 0; | 435 | u64 hash = _xor_shift_hash(symbol->string.start, symbol->string.n); |
436 | hash = _fibonacci_hash(hash, table->shift_amount); | ||
437 | return hash; | ||
436 | } | 438 | } |
437 | 439 | ||
438 | bool sym_eq(void *a, void *b) { | 440 | bool sym_eq(void *a, void *b) { |