Commit Graph

6 Commits

Author SHA1 Message Date
a9b00f2135 use true bool, since we target c99 onwards 2026-09-27 18:06:59 +03:00
c483b81f1c replace fold-right append with flatten in type-convert-to-c
They are not equivalent, but it'll be allright in this
case. Probably. Passes tests at least.
2025-10-30 18:05:44 +03:00
e9de3409ec optimize fmt-c-writer type unwrapping 2025-10-30 18:05:44 +03:00
Ekaterina Vaartis
fc332311d3 fix nested types producing wrong C code 2025-10-30 18:05:44 +03:00
0d314388f0 fix arrays of structs, multiple struct fields with same type 2025-10-30 18:05:44 +03:00
48a3d06925 move Sex to better types
Types, fns and vars are now written in another, better, more intuitive
and readable way.

Types:
"pointer to const char" is "* const char"
"array of pointers to volatile int" is "[* volatile int]"
Read left to right

Vars (as well as fn args, struct fields):
(var name type)
(struct vec3 ((x float) (y float) (z float))
(fn vec3-add ((v1 vec3) (v2 vec3)) vec3 ...)

Also fns are now have return types after arg list.

* is now must not be attached to any type name (or variable for that
matter)
2025-10-30 18:05:44 +03:00