give fmt-c a name for every parameter

fmt-c takes a parameter's name with `cadr', so an unnamed one handed
over bare lost its second word to it: `(* const char)' dropped its
star, and `(int)' had no second word at all.
This commit is contained in:
2026-09-30 13:22:07 +03:00
parent 2b73fcf1c4
commit 2da5b5005b
4 changed files with 66 additions and 14 deletions

View File

@@ -40,15 +40,15 @@
(walk-type '(const * const char)))
(test
'(%fun void ((int) (float) (%array (struct what * const))))
'(%fun void (int float (%array (struct what * const))))
(walk-type '(fn ((int) (float) (¤ (const * struct what))) void)))
(test
'(%fun void ((int) (%array float) (%array (struct what * const))))
'(%fun void (int (%array float) (%array (struct what * const))))
(walk-type '(fn ((int) (¤ float) (¤ (const * struct what))) void)))
(test
'(%array (%fun void ((int) (%array float) (%array (struct what * const)))))
'(%array (%fun void (int (%array float) (%array (struct what * const)))))
(walk-type '(¤ (fn ((int) (¤ float) (¤ (const * struct what))) void))))
;; Type convert to C
@@ -136,7 +136,7 @@
;;; Fn defs
(test
'(%fun void puk ((int) (%array float 8)))
'(%fun void puk ((int #f) ((%array float 8) #f)))
(walk-fn-def '(fn puk ((int) (¤ float 8)) void)))
(test
@@ -183,7 +183,7 @@
(test
'(struct mega_kebab ((int a)
((struct ((int year) (int month) (int day))) dob)
((%fun bool ((int) (%array int))) min)))
((%fun bool (int (%array int))) min)))
(walk-struct '(struct mega-kebab
((a int)
(dob (struct ((year int)