syntax/parse: change test to use eval so no error logged when compiled

This commit is contained in:
Ryan Culpepper 2016-07-14 14:30:44 -04:00
parent 521ff7cc67
commit 19707a54be
2 changed files with 19 additions and 12 deletions

View File

@ -1,4 +1,3 @@
#lang info #lang info
(define test-responsibles '((all ryanc))) (define test-responsibles '((all ryanc)))
(define compile-omit-files '("test.rkt"))

View File

@ -647,17 +647,25 @@
(tok (1 . (2 3)) (~datum (1 . (2 3))) 'ok) (tok (1 . (2 3)) (~datum (1 . (2 3))) 'ok)
;; nullable EH pattern raises error on match (rather than diverging) (7/2016) ;; nullable EH pattern raises error on match (rather than diverging) (7/2016)
(tcerr "nullable" (let ()
(syntax-parse #'(1 2 3) ;; to make drdr happy: use eval because compiling this code currently logs an error
[((~seq) ... n:nat ...) 'ok]) (define ns (make-base-namespace))
#rx"nullable ellipsis-head pattern|ellipsis-head pattern matched an empty sequence") (eval '(require syntax/parse) ns)
(tcerr "nullable (dynamic)" (tcerr "nullable"
(let () (eval
(define-splicing-syntax-class empty '(syntax-parse #'(1 2 3)
(pattern (~seq))) [((~seq) ... n:nat ...) 'ok])
(syntax-parse #'(1 2 3) ns)
[((~seq e:empty) ... n:nat ...) 'ok])) #rx"nullable ellipsis-head pattern|ellipsis-head pattern matched an empty sequence")
#rx"ellipsis-head pattern matched an empty sequence") (tcerr "nullable (dynamic)"
(eval
'(let ()
(define-splicing-syntax-class empty
(pattern (~seq)))
(syntax-parse #'(1 2 3)
[((~seq e:empty) ... n:nat ...) 'ok]))
ns)
#rx"ellipsis-head pattern matched an empty sequence"))
;; nullable but bounded EH pattern ok (thanks Alex Knauth) (7/2016) ;; nullable but bounded EH pattern ok (thanks Alex Knauth) (7/2016)
(tok (1 2 3) ((~once (~seq)) ... n:nat ...) 'ok) (tok (1 2 3) ((~once (~seq)) ... n:nat ...) 'ok)