* better error message for referencing pattern variables outside a

syntax form
This commit is contained in:
Abdulaziz Ghuloum 2007-05-11 22:54:18 -04:00
parent 6fe22073dd
commit 1feea6c243
2 changed files with 2 additions and 1 deletions

Binary file not shown.

View File

@ -410,7 +410,7 @@
(stx-error e "unbound identifier")) (stx-error e "unbound identifier"))
(case type (case type
[(lexical core-prim macro global local-macro [(lexical core-prim macro global local-macro
global-macro displaced-lexical) global-macro displaced-lexical syntax)
(values type (binding-value b) id)] (values type (binding-value b) id)]
[else (values 'other #f #f)])))] [else (values 'other #f #f)])))]
[(syntax-pair? e) [(syntax-pair? e)
@ -1622,6 +1622,7 @@
(chi-expr* (cons x x*) r mr))])] (chi-expr* (cons x x*) r mr))])]
[(displaced-lexical) [(displaced-lexical)
(stx-error e "identifier out of context")] (stx-error e "identifier out of context")]
[(syntax) (stx-error e "reference to pattern variable outside a syntax form")]
[else (error 'chi-expr "invalid type ~s for ~s" type [else (error 'chi-expr "invalid type ~s for ~s" type
(strip e '())) (stx-error e)])))) (strip e '())) (stx-error e)]))))
(define chi-set! (define chi-set!