Init new repository

This commit is contained in:
Krzosa Karol
2024-04-13 15:29:53 +02:00
commit 5a2e3dcec4
335 changed files with 61571 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
// #failed: resolve
BUILTIN_sizeof := sizeof(:int);
BUILTIN_alignof := sizeof(:int);
BUILTIN_typedef := typeof(F);
BUILTIN_offsetof := offsetof(:STRUCT, a);
A: int;
B: *int = &A;
PROC :: proc(): int {return 10;}
ARR: [4]int = {1,2,3,4};
// #error: non constant global declarations are illegal
ARR_PROC_VAL := :[]int{PROC(),2,3,4};
// #error: non constant global declarations are illegal
ARR_VAL := ARR[0];
// #error: non constant global declarations are illegal
C := *B;
// #error: non constant global declarations are illegal
D := B[0];
//// #error: non constant global declarations are illegal
//E := B^[0];
// #error: non constant global declarations are illegal
VAR := PROC();
// #error: cannot assign, can assign only const integer equal to 0, variable type: '*int' expression type: 'UntypedInt'
F: *int = 1 - 1;
// #error: cannot assign, can assign only const integer equal to 0, variable type: '*int' expression type: 'UntypedInt'
G: *int = -(1-1);
STRUCT :: struct { a: int; b: int; }
STRUCT_VAL: STRUCT = { 1, 2 };
GG := STRUCT_VAL.a;
// #error: non constant global declarations are illegal
STRUCT_VAL_PROC: STRUCT = {PROC()};