Merge pull request #4 from jbclements/cfg-parser-lexer-bug

add test and easy fix for cfg bug
v6.10.1
Jay McCarthy 7 years ago committed by GitHub
commit 80ea2be9e9

@ -731,7 +731,7 @@
src-pos?
(cons (car clauses) parser-clauses))]))))])
#`(let ([orig-parse (parser
[error (lambda (a b c)
[error (lambda (a b c . ignored)
(error 'cfg-parser "unexpected ~a token: ~a" b c))]
. #,parser-clauses)]
[error-proc #,cfg-error])
@ -906,10 +906,15 @@
(list (position-token
(token-ZERO "zero")
(position 2 2 5)
(position 3 2 6))))))))
(position 3 2 6)))))))
(check-exn #px"unexpected BOGUS token: #f"
(λ ()(parse (sequence->tokenizer
(list (position-token
'BOGUS
(position 2 2 5)
(position 3 2 6))))))))
;; Tests used during development

Loading…
Cancel
Save