diff --git a/parser-tools/private-lex/deriv.rkt b/parser-tools/private-lex/deriv.rkt index 7f597e3..77b7488 100644 --- a/parser-tools/private-lex/deriv.rkt +++ b/parser-tools/private-lex/deriv.rkt @@ -263,7 +263,11 @@ (set! new-state? #t) (state new-re (get-state-number))))] [new-all-states (if new-state? (cons new-state all-states) all-states)]) - (hash-update! transitions s (λ (v) (cons (cons c new-state) v)) '()) + (hash-set! transitions + s + (cons (cons c new-state) + (hash-ref transitions s + '()))) (cond [new-state? (loop old-states (cons new-state new-states) new-all-states (cdr cs))] diff --git a/parser-tools/private-yacc/lr0.rkt b/parser-tools/private-yacc/lr0.rkt index ce504d6..193cd24 100644 --- a/parser-tools/private-yacc/lr0.rkt +++ b/parser-tools/private-yacc/lr0.rkt @@ -59,7 +59,7 @@ (define (reverse-assoc assoc) (define reverse-hash (make-hash)) (define (hash-table-add! ht k v) - (hash-update! ht k (λ (v) (cons v v)) '())) + (hash-set! ht k (cons v (hash-ref ht k '())))) (for ([trans-key/kernel (in-list assoc)]) (define tk (car trans-key/kernel)) (hash-table-add! reverse-hash