Control flow evaluator; Support for block-level let/const variables

This commit is contained in:
dcodeIO
2018-01-18 23:34:12 +01:00
parent 1c4b0ddc57
commit 7be4f9fabb
54 changed files with 3285 additions and 13138 deletions

14
tests/compiler/scoped.ts Normal file
View File

@ -0,0 +1,14 @@
var aGlobal: i32 = 1;
const aConstant: i32 = 3;
let aStartFunctionLocal: i32 = 2;
for (var anotherStartFunctionLocal: i32 = 0; anotherStartFunctionLocal < 1; ++anotherStartFunctionLocal);
for (let aGlobal /* that shadows */: i32 = 0; aGlobal < 1; ++aGlobal)
aGlobal;
{
let /* actually not */ aConstant: i64 = 5;
{
let /* still not */ aConstant: f32 = 10;
}
}