fix nested types producing wrong C code

This commit was merged in pull request #18.
This commit is contained in:
Ekaterina Vaartis
2025-10-26 20:54:11 +03:00
committed by Alex Egorov
parent 1ca7e2ee15
commit c48ebc7585
2 changed files with 13 additions and 4 deletions

View File

@@ -141,10 +141,11 @@
;; * const char -> const char *
;; const * const char -> const char * const
(if (atom? type) (atom-to-fmt-c type)
(tree-map atom-to-fmt-c
(fold-right append (list)
(list-join (reverse (list-split type '*))
'(*))))))
(flatten
(tree-map atom-to-fmt-c
(fold-right append (list)
(list-join (reverse (list-split type '*))
'(*)))))))
(define (walk-fn-def form)
(match form