Test for begin
at label phase
This commit is contained in:
parent
a95e279219
commit
ad677478ab
|
@ -14,6 +14,8 @@
|
|||
(check-exn exn:fail:syntax? (λ () (flatten-all-begins #'(1 2 3))))
|
||||
(check-equal-datum? (flatten-all-begins #'(begin 1 2 3))
|
||||
(list #'1 #'2 #'3))
|
||||
(check-equal-datum? (flatten-all-begins (syntax-shift-phase-level #'(begin 1 2 3) 2))
|
||||
(list #'1 #'2 #'3))
|
||||
(check-equal-datum? (flatten-all-begins #'(begin (begin 1 2) 3))
|
||||
(list #'1 #'2 #'3))
|
||||
(check-equal-datum? (flatten-all-begins #'(begin (begin 1 2) (+ 3 4) 5))
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
(unless (and (pair? val)
|
||||
(not (null? val))
|
||||
(identifier? (car val))
|
||||
(free-identifier=? (car val) #'begin))
|
||||
(free-identifier=? (car val) #'begin #f #f))
|
||||
(raise-syntax-error
|
||||
#f
|
||||
"not a begin expression"
|
||||
|
@ -29,6 +29,6 @@
|
|||
(define lst (syntax->list stx))
|
||||
(if (and lst
|
||||
(not (null? lst))
|
||||
(free-identifier=? (car lst) #'begin))
|
||||
(free-identifier=? (car lst) #'begin #f #f))
|
||||
(apply append (map loop (cdr lst)))
|
||||
(list (syntax-track-origin stx orig-stx #'begin)))))
|
||||
|
|
Loading…
Reference in New Issue
Block a user