Add if statements

This commit is contained in:
Krzosa Karol
2022-05-26 18:13:37 +02:00
parent 3cd79040bc
commit 3d9a38494c
7 changed files with 134 additions and 15 deletions

View File

@@ -1,5 +1,18 @@
if_stmt :: (cond: int): int
CONSTANT :: 10
if cond + CONSTANT
return cond + CONSTANT
else if cond - CONSTANT
return cond - CONSTANT
else
return CONSTANT
add_10 :: (size: int): int
// @todo: before the generation c pass, each stage should have it's own
// tree transformation phase, where it yanks functions etc.
add_20 :: (new_size: int): int
return 20
@@ -13,3 +26,4 @@ return_constant :: (): int
returning_void :: (insert: int)
return