Fix some error messages for invalid : signature declarations.
This commit is contained in:
parent
8bc95ace01
commit
333d82e6df
|
@ -43,8 +43,11 @@
|
|||
(filter (lambda (maybe)
|
||||
(syntax-case maybe (:)
|
||||
((: ?id ?cnt)
|
||||
(identifier? #'id)
|
||||
(begin
|
||||
(when (not (identifier? #'?id))
|
||||
(raise-syntax-error #f
|
||||
"Nach dem : sollte ein Bezeichner stehen; da steht was anderes."
|
||||
#'?id))
|
||||
(when (bound-identifier-mapping-get table #'?id (lambda () #f))
|
||||
(raise-syntax-error #f
|
||||
"Zweite Vertragsdefinition für denselben Namen."
|
||||
|
@ -52,9 +55,9 @@
|
|||
(bound-identifier-mapping-put! table #'?id #'?cnt)
|
||||
#f))
|
||||
((: ?id)
|
||||
(raise-syntax-error 'signatures "Bei dieser Vertragsdefinition fehlt der Vertrag" maybe))
|
||||
(raise-syntax-error #f "Bei dieser Vertragsdefinition fehlt der Vertrag" maybe))
|
||||
((: ?id ?cnt ?stuff0 ?stuff1 ...)
|
||||
(raise-syntax-error 'signatures "In der :-Form werden ein Name und ein Vertrag erwartet; da steht noch mehr"
|
||||
(raise-syntax-error #f "In der :-Form werden ein Name und ein Vertrag erwartet; da steht noch mehr"
|
||||
(syntax/loc #'?stuff0
|
||||
(?stuff0 ?stuff1 ...))))
|
||||
(_ #t)))
|
||||
|
|
|
@ -48,18 +48,23 @@
|
|||
(filter (lambda (maybe)
|
||||
(syntax-case maybe (:)
|
||||
((: ?id ?cnt)
|
||||
(identifier? #'?id)
|
||||
(let ((real-id (first-order->higher-order #'?id)))
|
||||
(when (bound-identifier-mapping-get table real-id (lambda () #f))
|
||||
(begin
|
||||
(when (not (identifier? #'?id))
|
||||
(raise-syntax-error #f
|
||||
"Second signature declaraton for the same name."
|
||||
maybe))
|
||||
(bound-identifier-mapping-put! table real-id #'?cnt)
|
||||
#f))
|
||||
"Something that's not an identifier after the :"
|
||||
#'?id))
|
||||
|
||||
(let ((real-id (first-order->higher-order #'?id)))
|
||||
(when (bound-identifier-mapping-get table real-id (lambda () #f))
|
||||
(raise-syntax-error #f
|
||||
"Second signature declaration for the same name."
|
||||
maybe))
|
||||
(bound-identifier-mapping-put! table real-id #'?cnt)
|
||||
#f)))
|
||||
((: ?id)
|
||||
(raise-syntax-error 'signatures "Signature declaration is missing a signature." maybe))
|
||||
(raise-syntax-error #f "Signature declaration is missing a signature." maybe))
|
||||
((: ?id ?cnt ?stuff0 ?stuff1 ...)
|
||||
(raise-syntax-error 'signatures "The : form expects a name and a signature; there is more."
|
||||
(raise-syntax-error #f "The : form expects a name and a signature; there is more."
|
||||
(syntax/loc #'?stuff0
|
||||
(?stuff0 ?stuff1 ...))))
|
||||
(_ #t)))
|
||||
|
|
Loading…
Reference in New Issue
Block a user