macro expander: fix #%top via local-expand

Fix bug in b25a2b83ba that breaks the teaching languages.
This commit is contained in:
Matthew Flatt 2014-07-25 11:19:13 +01:00
parent 8f8e3b7c65
commit 816d09bb24
2 changed files with 9 additions and 0 deletions

View File

@ -1085,6 +1085,14 @@
(error 'test "bad expansion: ~e" e)]))]) (error 'test "bad expansion: ~e" e)]))])
(m)) (m))
(test 10 values
(let-syntax ([#%top (lambda (stx)
(syntax-case stx ()
[(_ . id) #'10]))])
(let-syntax ([m (lambda (stx)
(local-expand #'nonsuch 'expression null))])
(m))))
;; ---------------------------------------- ;; ----------------------------------------
(report-errs) (report-errs)

View File

@ -4817,6 +4817,7 @@ scheme_compile_expand_expr(Scheme_Object *form, Scheme_Comp_Env *env,
} else { } else {
if (!rec[drec].comp if (!rec[drec].comp
&& (rec[drec].depth == -2) /* local-expand */ && (rec[drec].depth == -2) /* local-expand */
&& SAME_OBJ(var, normal)
&& SAME_OBJ(SCHEME_STX_VAL(stx), top_symbol)) { && SAME_OBJ(SCHEME_STX_VAL(stx), top_symbol)) {
rec[drec].pre_unwrapped = 1; rec[drec].pre_unwrapped = 1;
} else { } else {