walk a define's body, and parenthesise it

The body was pasted as read, so `cast' stayed a call and names kept
their dashes; and fmt-c parenthesised only a function-like body, so
an object-like one regrouped with the operator it was pasted under.

Fixes #55.
This commit is contained in:
2026-10-09 16:00:28 +03:00
parent dff4a5af53
commit b5de28342b
4 changed files with 34 additions and 7 deletions

View File

@@ -508,7 +508,7 @@ forms, and what remains."
;; A target is a filename and not an identifier: GL/gl.h is a path,
;; and unkebabify would spell it GLːgl.h
(('include target) (list '%include target))
(('define name . rest) `(%define ,(atom-to-fmt-c name) ,@rest))
(('define name . body) `(%define ,(walk-expr name) ,@(map walk-expr body)))
(else (walk-expr form))))
;;; Two toplevel forms are separated by a blank line only if they were