Structs, unions and enums
s Point
x,y: f64
u Number
i: i32
d: f64
e Color red,green=5,blue
f main()
p: Point = {1,2}
n: Number
n.i=3
< p.x+p.y != n.i || blue != 6typedef struct Point Point;
struct Point {
double x,y;
};
typedef union Number Number;
union Number {
int i;
double d;
};
typedef enum {
red,
green=5,
blue
} Color;
int main(void) {
Point p = {1,2};
Number n;
n.i=3;
return p.x+p.y != n.i || blue != 6;
}Types are NanoC type words (i8 to i64, u8 to u64, f32, f64, bool, char, str, size, ptr), prefix pointers such as next: *Node, and record, enum or typedef names. Any other C spelling (multi-word types, function pointers, attributes) goes in backticks or an @c block; unmarked C is rejected with a diagnostic. Grouped named fields are supported; initialized local declarations require one name to avoid duplicated evaluation.