Revert label phase check, do correct thing

Thanks to Matthew for advice
This commit is contained in:
Asumu Takikawa 2014-07-24 10:25:02 -04:00
parent b1557982e3
commit 1bf54b06ee
2 changed files with 7 additions and 3 deletions

View File

@ -4,7 +4,8 @@
(require rackunit
rackunit/text-ui
syntax/flatten-begin)
syntax/flatten-begin
(for-meta -2 (only-in racket/base begin)))
(define-binary-check (check-equal-datum? actual expected)
(check-equal? (map syntax->datum actual)

View File

@ -1,4 +1,7 @@
#lang racket/base
(require (for-template racket/base))
(provide flatten-begin
flatten-all-begins)
@ -20,7 +23,7 @@
(unless (and (pair? val)
(not (null? val))
(identifier? (car val))
(free-identifier=? (car val) #'begin #f #f))
(free-identifier=? (car val) #'begin))
(raise-syntax-error
#f
"not a begin expression"
@ -29,6 +32,6 @@
(define lst (syntax->list stx))
(if (and lst
(not (null? lst))
(free-identifier=? (car lst) #'begin #f #f))
(free-identifier=? (car lst) #'begin))
(apply append (map loop (cdr lst)))
(list (syntax-track-origin stx orig-stx #'begin)))))