fix error message for (cons [else])
Closes PR 10910 Merge to 5.0.1
This commit is contained in:
parent
a2f3dad4f0
commit
8f15f04bd5
|
@ -54,10 +54,7 @@
|
||||||
(free-identifier=? (stx-car value) =>-stx))
|
(free-identifier=? (stx-car value) =>-stx))
|
||||||
(if (and (stx-pair? (stx-cdr value))
|
(if (and (stx-pair? (stx-cdr value))
|
||||||
(stx-null? (stx-cdr (stx-cdr value))))
|
(stx-null? (stx-cdr (stx-cdr value))))
|
||||||
(let ([test (if else?
|
(let ([gen (gen-temp-id 'c)])
|
||||||
#t
|
|
||||||
test)]
|
|
||||||
[gen (gen-temp-id 'c)])
|
|
||||||
`(,(quote-syntax let-values) ([(,gen) ,test])
|
`(,(quote-syntax let-values) ([(,gen) ,test])
|
||||||
(,(quote-syntax if) ,gen
|
(,(quote-syntax if) ,gen
|
||||||
(,(stx-car (stx-cdr value)) ,gen)
|
(,(stx-car (stx-cdr value)) ,gen)
|
||||||
|
@ -66,11 +63,15 @@
|
||||||
"bad syntax (bad clause form with =>)"
|
"bad syntax (bad clause form with =>)"
|
||||||
line))
|
line))
|
||||||
(if else?
|
(if else?
|
||||||
|
(if (stx-null? value)
|
||||||
|
(serror
|
||||||
|
"missing expressions in `else' clause"
|
||||||
|
line)
|
||||||
(if first?
|
(if first?
|
||||||
;; first => be careful not to introduce a splicable begin...
|
;; first => be careful not to introduce a splicable begin...
|
||||||
`(,(quote-syntax if) #t ,(cons (quote-syntax begin) value) (void))
|
`(,(quote-syntax if) #t ,(cons (quote-syntax begin) value) (void))
|
||||||
;; we're in an `if' branch already...
|
;; we're in an `if' branch already...
|
||||||
(cons (quote-syntax begin) value))
|
(cons (quote-syntax begin) value)))
|
||||||
(if (stx-null? value)
|
(if (stx-null? value)
|
||||||
(let ([gen (gen-temp-id 'c)])
|
(let ([gen (gen-temp-id 'c)])
|
||||||
`(,(quote-syntax let-values) ([(,gen) ,test])
|
`(,(quote-syntax let-values) ([(,gen) ,test])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user