diff --git a/collects/parser-tools/private-yacc/parser-builder.ss b/collects/parser-tools/private-yacc/parser-builder.ss index ecf8459..0e8e8e2 100644 --- a/collects/parser-tools/private-yacc/parser-builder.ss +++ b/collects/parser-tools/private-yacc/parser-builder.ss @@ -118,7 +118,9 @@ (lambda () ,(if src-pos `(err #t (token-name tok) (token-value tok) (cadr ip) (caddr ip)) - `(err #t (token-name tok) (token-value tok))))))))) + `(err #t (token-name tok) (token-value tok))) + (raise-read-error (format "parser: got token of unknown type ~a" (token-name tok))))))))) + (lambda (get-token) (let parsing-loop ((stack (list 0)) (ip (get-token))) @@ -141,7 +143,7 @@ ((symbol? ip) (make-token ip #f)) ((token? ip) ip) (else (raise-type-error 'parser "token or symbol" 0 ip))))) - (action (find-action stack tok) ,@(if src-pos `(ip) `()))) + (action (find-action stack tok ,@(if src-pos `(ip) `())))) (cond ((shift? action) ;; (printf "shift:~a~n" (shift-state action))