Implicitly alias stdlib exports as program globals, see #8

This commit is contained in:
dcodeIO
2018-01-12 15:36:17 +01:00
parent 3980e53bb7
commit 2df318a7ec
27 changed files with 417 additions and 179 deletions

View File

@ -5,12 +5,18 @@ export function ifThenElse(n: i32): bool {
return false;
}
assert(ifThenElse(0) == false);
assert(ifThenElse(1) == true);
export function ifThen(n: i32): bool {
if (n)
return true;
return false;
}
assert(ifThen(0) == false);
assert(ifThen(1) == true);
export function ifThenElseBlock(n: i32): bool {
if (n) {
; // nop
@ -20,3 +26,6 @@ export function ifThenElseBlock(n: i32): bool {
return false;
}
}
assert(ifThenElseBlock(0) == false);
assert(ifThenElseBlock(1) == true);