From: Joe Marshall Date: Mon, 21 May 2012 18:24:38 +0000 (-0700) Subject: Fix unsyntaxing of open-blocks and block-declarations. X-Git-Tag: release-9.2.0~247^2~6 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=b74b052bf65e280117cf6baf2b6163a7b294a9f4;p=mit-scheme.git Fix unsyntaxing of open-blocks and block-declarations. --- diff --git a/src/runtime/unsyn.scm b/src/runtime/unsyn.scm index 1aa292708..472776f9b 100644 --- a/src/runtime/unsyn.scm +++ b/src/runtime/unsyn.scm @@ -199,7 +199,13 @@ USA. `(LOCAL-DECLARE ,text ,(unsyntax-object expression))))) (define (unsyntax-SEQUENCE-object seq) - `(BEGIN ,@(unsyntax-sequence-actions seq))) + (let ((first-action (sequence-immediate-first seq))) + (if (block-declaration? first-action) + `(BEGIN + (DECLARE ,@(block-declaration-text first-action)) + ,@(unsyntax-sequence (sequence-immediate-second seq))) + `(BEGIN + ,@(unsyntax-sequence-actions seq))))) (define (unsyntax-sequence seq) (if (sequence? seq) @@ -227,9 +233,7 @@ USA. (if (eq? #t unsyntaxer:macroize?) (open-block-components open-block (lambda (auxiliary declarations expression) - `(OPEN-BLOCK ,auxiliary - ,declarations - ,@(unsyntax-sequence expression)))) + (unsyntax-object (unscan-defines auxiliary declarations expression)))) (unsyntax-SEQUENCE-object open-block))) (define (unsyntax-DELAY-object object)