ox

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

commit 7953d92fe1573a6907978315341a3457738fc3c8
parent 9495b60a08733b7cebab422f321dac3213262544
Author: citbl <citbl@citbl.org>
Date:   Wed, 22 Oct 2025 18:27:27 +1000

more comments to tests

Diffstat:
Mex1.ox | 2++
Mex2.ox | 1+
Mex3.ox | 4+++-
Mex4.ox | 2+-
Mex5.ox | 7++-----
Mex6.ox | 2++
Mex7.ox | 2++
Mex8.ox | 11++++++++++-
Mex9.ox | 2+-
9 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/ex1.ox b/ex1.ox @@ -1,3 +1,5 @@ +// Hello world and comment + void main(int param1) { print("hello world\n"); //print(param1); diff --git a/ex2.ox b/ex2.ox @@ -1,4 +1,5 @@ // test var decl and print + void main() { string steve = "His name is Steeeve"; string harry = "His name is Harry"; diff --git a/ex3.ox b/ex3.ox @@ -1,5 +1,7 @@ +// conditional to be handled + void main() { if (a == true) { - print("yes"); + print("conditional test passed"); } } diff --git a/ex4.ox b/ex4.ox @@ -1,6 +1,6 @@ void main() { if (a == true) { - print("yes"); + print("yes is expected"); } else { print("no"); } diff --git a/ex5.ox b/ex5.ox @@ -1,10 +1,7 @@ -// typedef Person { -// string name; -// int age; -// } +// more conditional test, else case should be taken void main() { - if (a == true) { + if (a == false) { print("yes"); } else { print("no"); diff --git a/ex6.ox b/ex6.ox @@ -1,3 +1,5 @@ +// simple loop + int main() { for (int a = 0; b < 10; c++) { print("hi"); diff --git a/ex7.ox b/ex7.ox @@ -1,3 +1,5 @@ +infinite loop break test + int main() { int a = 1; for(;;) { diff --git a/ex8.ox b/ex8.ox @@ -1,5 +1,14 @@ +// nested ifs + void main() { - print("test 1"); + int a = 10; + if(true == true) { + if(a == 11) { + print("this is wrong"); + } else { + print("this is right"); + } + } } // void test() { diff --git a/ex9.ox b/ex9.ox @@ -1,4 +1,4 @@ -// test multiple functions decl and variables decl. +// test multiple functions and variables declarations int jack = 111;