New syntax that's easier to parse, parsing doesn't need variable lookup

This commit is contained in:
Krzosa Karol
2022-05-03 11:31:21 +02:00
parent 3c376bbe30
commit 8c04044ea2
12 changed files with 1216 additions and 244 deletions

View File

@@ -1,5 +1,41 @@
Thing :: struct{
data: (U32) U32; // Function pointer
data: (U32) U32 @ [32]; // Array of function pointers
data: (U32) U32* @ [32]; // Array of function pointers, they return a pointer
actual_function :: (first: Thing*, last: Thing*, node: Thing*)/*no type == void*/{
if first == 0 {
first = last = node;
}
else{
last = last->next = node;
}
}
StructInside :: struct { // This is not part of struct
// just in scope
some_val: U16;
some_val2: U16;
}
insider: StructInside;
named_union_part_of_struct: union{
some_val: U16;
some_val2: U32;
}
_: union {
// Unamed union
val: U32;
}
}
Thingy::enum{
Thingy::enum:U32{
@str=10 Value = 1,
}