From f7b36cb81d96817d1c69ffe9025b88112de7400c Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Sun, 24 Nov 2024 13:05:11 +0100 Subject: Implement the while loop --- tests/vm/print_after_loop.elna | 9 +++++++++ tests/vm/print_in_proc.elna | 7 +++++++ 2 files changed, 16 insertions(+) create mode 100644 tests/vm/print_after_loop.elna create mode 100644 tests/vm/print_in_proc.elna (limited to 'tests/vm') diff --git a/tests/vm/print_after_loop.elna b/tests/vm/print_after_loop.elna new file mode 100644 index 0000000..3fd9175 --- /dev/null +++ b/tests/vm/print_after_loop.elna @@ -0,0 +1,9 @@ +proc main() { + var x: int; + + x := 0; + while (x < 2) { + x := x + 1; + } + printi(x); +} diff --git a/tests/vm/print_in_proc.elna b/tests/vm/print_in_proc.elna new file mode 100644 index 0000000..8c4588b --- /dev/null +++ b/tests/vm/print_in_proc.elna @@ -0,0 +1,7 @@ +proc print2(a: int) { + printi(a); +} + +proc main() { + print2(14); +} -- cgit v1.2.3