syntax/parse: reverted error message, fixed error test
This commit is contained in:
parent
eff9147ddc
commit
d0cc31b35e
|
@ -615,7 +615,7 @@ An Expectation is one of
|
|||
;; FIXME: change to normal 'error', if src gets stripped away
|
||||
(define (check-literal id phase ctx)
|
||||
(unless (identifier-binding id phase)
|
||||
(raise-syntax-error #f "literal identifier has no binding" ctx id)))
|
||||
(raise-syntax-error #f "unbound identifier not allowed as literal" ctx id)))
|
||||
|
||||
;; free-identifier=?/phases : id phase-level id phase-level -> boolean
|
||||
;; Determines whether x has the same binding at phase-level phase-x
|
||||
|
|
|
@ -163,7 +163,7 @@
|
|||
(begin-for-syntax/once
|
||||
(for ([x (syntax->list #'(external ...))])
|
||||
(unless (identifier-binding x 0)
|
||||
(raise-syntax-error #f "literal identifier has no binding"
|
||||
(raise-syntax-error #f "unbound identifier not allowed as literal"
|
||||
(quote-syntax #,stx) x))))))))]))
|
||||
|
||||
#|
|
||||
|
|
|
@ -93,11 +93,20 @@
|
|||
#rx"^define-syntax-class: "
|
||||
#rx"expected syntax-class variant")
|
||||
|
||||
;(tcerr "check-literals-bound: unbound literal"
|
||||
; (let () (define-syntax-class x #:literals (foo) (pattern (foo))) 0)
|
||||
; #rx"^define-syntax-class: "
|
||||
; #rx"unbound identifier not allowed as literal")
|
||||
|
||||
(tcerr "check-literals-bound: unbound literal"
|
||||
(let () (define-syntax-class x #:literals (foo) (pattern (foo))) 0)
|
||||
#rx"^define-syntax-class: "
|
||||
(let () (define-literal-set x (foo)) 0)
|
||||
#rx"^define-literal-set: "
|
||||
#rx"unbound identifier not allowed as literal")
|
||||
|
||||
(tcerr "check-literals-bound: unbound literal"
|
||||
(syntax-parse #'x #:literals (define defunky) [_ 'ok])
|
||||
#rx"^syntax-parse: "
|
||||
#rx"unbound identifier not allowed as literal")
|
||||
|
||||
(tcerr "append-lits+litsets: duplicate"
|
||||
(let ()
|
||||
|
|
Loading…
Reference in New Issue
Block a user