summaryrefslogtreecommitdiffhomepage
path: root/tests/custom/04_bugs/22_compiler_break_continue_scoping
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-07-17 23:21:03 +0200
committerJo-Philipp Wich <jo@mein.io>2022-07-30 13:46:23 +0200
commit10e056d3744384a029f05de5903c489898722fc3 (patch)
treee6621194f1053fdc314dfee02358972028a6a5ff /tests/custom/04_bugs/22_compiler_break_continue_scoping
parent862e49de33bd07daea129d553968579019c79b59 (diff)
compiler: add support for import/export statements
This commit introduces syntax level support for ES6 style module import and export statements. Imports are resolved at compile time and the corresponding module code is compiled into the main program. Also add testcases to cover import and export statement semantics. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'tests/custom/04_bugs/22_compiler_break_continue_scoping')
-rw-r--r--tests/custom/04_bugs/22_compiler_break_continue_scoping59
1 files changed, 0 insertions, 59 deletions
diff --git a/tests/custom/04_bugs/22_compiler_break_continue_scoping b/tests/custom/04_bugs/22_compiler_break_continue_scoping
deleted file mode 100644
index 461b144..0000000
--- a/tests/custom/04_bugs/22_compiler_break_continue_scoping
+++ /dev/null
@@ -1,59 +0,0 @@
-When compiling a break or continue statement, the compiler emitted pop
-instructions for local variables within the scope the break or continue
-keyword appeared in, but it must also pop local variables in enclosing
-scopes up until the scope of the containing loop or switch body.
-
--- Expect stdout --
-1
-2
-3
--- End --
-
--- Testcase --
-{%
- for (let i = 1; i <= 3; i++) {
- while (true) {
- let n = i;
-
- print(n, "\n");
-
- {
- // The `let n` stack slot is not popped since it is
- // outside of break's scope...
- break;
- }
- }
- }
-%}
--- End --
-
--- Expect stdout --
-1
-2
-3
-2
-4
-6
-3
-6
-9
--- End --
-
--- Testcase --
-{%
- for (let i = 1; i <= 3; i++) {
- for (let j = 1; j <= 3; j++) {
- let n = i * j;
-
- print(n, "\n");
-
- if (j == 1)
- {
- // The `let n` stack slot is not popped since it is
- // outside of continue's scope...
- continue;
- }
- }
- }
-%}
--- End --