New syntax that's easier to parse, parsing doesn't need variable lookup
This commit is contained in:
38
ideas.cpp
38
ideas.cpp
@@ -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,
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user