Add if statements
This commit is contained in:
14
lambdas.kl
14
lambdas.kl
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user