fix nested types producing wrong C code #18
@@ -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
|
||||
|
||||
@@ -64,6 +64,14 @@
|
||||
'(%var (struct suc) s)
|
||||
(walk-var '(var s (struct suc))))
|
||||
|
||||
(test
|
||||
'(%var (const struct suc *) s s1)
|
||||
(walk-var '(var s (* const struct suc) s1)))
|
||||
|
||||
(test
|
||||
'(%var (const struct suc *) s s1)
|
||||
(walk-var '(var s (* (const struct suc)) s1)))
|
||||
|
||||
(test
|
||||
'(%var (struct suc) s (hoge piyo))
|
||||
(walk-var '(var s (struct suc) (hoge piyo))))
|
||||
|
||||
Reference in New Issue
Block a user