Don't return open block at top level when syntaxing a single form.
authorChris Hanson <org/chris-hanson/cph>
Mon, 21 Jan 2019 04:22:28 +0000 (20:22 -0800)
committerChris Hanson <org/chris-hanson/cph>
Mon, 21 Jan 2019 04:22:28 +0000 (20:22 -0800)
src/runtime/syntax.scm

index 4aaca52e41aa802013ad65150ba7092c0d037274..4bde7b012684217fc58573344f9d03e937013eb7 100644 (file)
@@ -47,7 +47,12 @@ USA.
   (make-settable-parameter #f))
 
 (define (syntax form environment)
-  (syntax* (list form) environment))
+  (let ((result (syntax* (list form) environment)))
+    (if (scode-open-block? result)
+       (unscan-defines (scode-open-block-names result)
+                       (scode-open-block-declarations result)
+                       (scode-open-block-actions result))
+       result)))
 
 (define (syntax* forms environment)
   (guarantee list? forms 'syntax*)