Working on Any arrays and vargs

This commit is contained in:
Krzosa Karol
2022-06-20 10:02:23 +02:00
parent 4e288dcfab
commit 99b0ba2673
3 changed files with 73 additions and 29 deletions

View File

@@ -1,9 +1,23 @@
main :: (argc: int, argv: **char): int
test_arrays()
test_any()
test_arrays()
test_type()
test_array_any :: (any: Any, array_of_any: ..)
for array_of_any
pass
test_any :: ()
some_int_value := 10
thing: Any = some_int_value
other_any: Any = thing
imp_any := thing
assert(thing.type != Any)
any_array := []Any{some_int_value, thing}
for any_array
assert(it.type == S64)
test_arrays :: ()
array1 := []S64{1,2,3,4,5}
array2: []S64 = {0,9,8}
@@ -17,16 +31,7 @@ test_arrays :: ()
for array2;; *it = 0
for i := 0, i < length_of(array1), i+=1;; assert(0 == array1[i])
test_any :: ()
some_int_value := 10
thing: Any = some_int_value
other_any: Any = thing
imp_any := thing
assert(thing.type != Any)
any_array := []Any{some_int_value, thing}
for any_array
assert(it.type == S64)
test_array_any(10, 20, 30)
Some_Struct :: struct
thing: int