add support for begin in Sex

begin-wrapped blocks are now creating lexical scopes
This commit is contained in:
2025-08-14 14:33:14 +03:00
parent 8ad5abf055
commit d0b60ed051
4 changed files with 11 additions and 9 deletions

View File

@@ -218,6 +218,7 @@
((apply cpp-if/aux (substring/shared (symbol->string (car x)) 1)
(cdr x)) st))
((%endif) ((apply cpp-endif (cdr x)) st))
((%block-begin) ((apply c-braced-block #f (cdr x)) st))
((%block) ((apply c-braced-block (cdr x)) st))
((%comment) ((apply c-comment (cdr x)) st))
((:) ((apply c-label (cdr x)) st))
@@ -521,7 +522,7 @@
(define (c-braced-block/aux offset header . body)
(lambda (st)
((cat header (c-open-brace st) (c-indent st offset)
((cat (if header header "") (c-open-brace st) (c-indent st offset)
(apply c-begin body) fl
(c-current-indent-string st offset) (c-close-brace st))
st)))