ox

The Ox programming language, compiler and tools (WIP)
Log | Files | Refs | README | LICENSE

commit 40ec4f670212682fb942a2110b5de43d3cbf8725
parent 59223dd86c45c9e1b13bba429aaf2083d03e62be
Author: citbl <citbl@citbl.org>
Date:   Sun, 16 Nov 2025 20:09:54 +1000

add inner blocks test (WIP)

Diffstat:
M.zed/debug.json | 2+-
MTODO | 5++++-
Atests/ex-blocks-inner.ox | 10++++++++++
3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/.zed/debug.json b/.zed/debug.json @@ -11,7 +11,7 @@ "cwd": "$ZED_WORKTREE_ROOT" }, "program": "$ZED_WORKTREE_ROOT/oxc", - "args": ["$ZED_WORKTREE_ROOT/tests/ex-if-no-parens.ox"], + "args": ["$ZED_WORKTREE_ROOT/tests/ex-blocks-inner.ox"], "request": "launch", "adapter": "CodeLLDB" } diff --git a/TODO b/TODO @@ -11,7 +11,9 @@ [x] print anything else than a string [x] call another function from main, that prints something, [x] call another function that prints the passed argument -[ ] if without { } should be an error, e.g. `if(true) break;` doesn't work +[x] if without { } should be an error, e.g. `if(true) break;` doesn't work +[ ] inner blocks are ignored completely { { } } +[ ] while loops @later @@ -21,3 +23,4 @@ [x] redo arguments as list and not linked list, handle in parse and in gen (2 places in gen?) [x] get rid of count_args and search for 'argc' +[ ] clean up symbols table from parsing to jit time diff --git a/tests/ex-blocks-inner.ox b/tests/ex-blocks-inner.ox @@ -0,0 +1,10 @@ +void main() { + + int x = 1; + { + int y = 2; + print(x); + print(y); + } + print(x); +}