Better error message for certain bogus signatures.

This commit is contained in:
Mike Sperber 2010-10-08 13:55:42 +02:00
parent 7572b24870
commit 3e205b6193
2 changed files with 11 additions and 2 deletions

View File

@ -132,6 +132,10 @@
?access
?signature-expr
?stx)))
((signature ?stuff ...)
(raise-syntax-error #f
"`signature' als Operator ergibt keinen Sinn"
stx))
((?signature-abstr ?signature ...)
(identifier? #'?signature-abstr)
(with-syntax ((?stx (phase-lift stx))
@ -139,6 +143,7 @@
((?signature-expr ...) (map (lambda (sig)
(parse-signature #f sig))
(syntax->list #'(?signature ...)))))
(with-syntax
((?call (syntax/loc stx (?signature-abstr ?signature-expr ...))))
#'(make-call-signature '?name
@ -146,7 +151,7 @@
(delay ?signature-abstr) (delay (list ?signature-expr ...))
?stx))))
(else
(raise-syntax-error 'signature
(raise-syntax-error #f
"ungültige Signatur" stx))))
; regrettable

View File

@ -122,6 +122,10 @@
?access
?signature-expr
?stx)))
((signature ?stuff ...)
(raise-syntax-error #f
"`signature' makes no sense as an operator"
stx))
((?signature-abstr ?signature ...)
(identifier? #'?signature-abstr)
(with-syntax ((?stx (phase-lift stx))
@ -138,7 +142,7 @@
(delay (list ?signature-expr ...))
?stx))))
(else
(raise-syntax-error 'signature
(raise-syntax-error #f
"invalid signature" stx))))
; regrettable