Var args sort of working, but I feel like all this stuff will need to get yanked out

or tested and refactored
This commit is contained in:
Krzosa Karol
2022-09-30 22:33:47 +02:00
parent 4c6497c5d6
commit 0646ae9279
6 changed files with 75 additions and 25 deletions

View File

@@ -1,11 +1,26 @@
VariadicArguments :: (string: *char, args: ..)
pass
AnyArguments :: (values: []Any)
for values
Assert(it.type == S64)
Assert(*(values[0].data->*S64) == 10)
Assert(*(values[1].data->*S64) == 20)
printf :: #foreign (string: *char, args: ..): int
main :: (): int
a := 10
b := 20
values := []Any{a, b}
printf("Test %d", {a})
for values
Assert(it.type == S64)
AnyArguments({a,b})
VariadicArguments("Test", args = {a+b,b})
Assert(*(values[0].data->*S64) == 10)
Assert(*(values[1].data->*S64) == 20)