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
|
;; FIXME: change to normal 'error', if src gets stripped away
|
||||||
(define (check-literal id phase ctx)
|
(define (check-literal id phase ctx)
|
||||||
(unless (identifier-binding id phase)
|
(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
|
;; free-identifier=?/phases : id phase-level id phase-level -> boolean
|
||||||
;; Determines whether x has the same binding at phase-level phase-x
|
;; Determines whether x has the same binding at phase-level phase-x
|
||||||
|
|
|
@ -163,7 +163,7 @@
|
||||||
(begin-for-syntax/once
|
(begin-for-syntax/once
|
||||||
(for ([x (syntax->list #'(external ...))])
|
(for ([x (syntax->list #'(external ...))])
|
||||||
(unless (identifier-binding x 0)
|
(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))))))))]))
|
(quote-syntax #,stx) x))))))))]))
|
||||||
|
|
||||||
#|
|
#|
|
||||||
|
|
|
@ -93,11 +93,20 @@
|
||||||
#rx"^define-syntax-class: "
|
#rx"^define-syntax-class: "
|
||||||
#rx"expected syntax-class variant")
|
#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"
|
(tcerr "check-literals-bound: unbound literal"
|
||||||
(let () (define-syntax-class x #:literals (foo) (pattern (foo))) 0)
|
(let () (define-literal-set x (foo)) 0)
|
||||||
#rx"^define-syntax-class: "
|
#rx"^define-literal-set: "
|
||||||
#rx"unbound identifier not allowed as literal")
|
#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"
|
(tcerr "append-lits+litsets: duplicate"
|
||||||
(let ()
|
(let ()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user