Rename of files, improved for handling, add cb hints

- Rename Test to Ink as main file
- Support more errors for for loops.
- Add hints to cbs
This commit is contained in:
2025-09-02 11:55:27 +02:00
parent 9e0728f952
commit 603b625e21
10 changed files with 114 additions and 35 deletions

View File

@@ -1,6 +1,6 @@
vertex main :: () {
x := 0.0;
for i : {
for i : 0.. {
x += 2.0;
}
}

View File

@@ -0,0 +1,6 @@
(program
(fun vertex vs_main
[]
(:= x 0)
(for i : 0..10
(+= x 1))))

View File

@@ -0,0 +1,4 @@
test/for_i_one_liner.ink:3,0: error: Unable to parse statement here. 'for' currently expects a brace-enclosed block as a body.
for i : 0..10 x += 2.0;
^^^


View File

@@ -0,0 +1,9 @@
test/for_no_iter.ink:3,9: error: Expected expression after '..'. Expected end of iterator.
for i : 0.. {
x += 2.0;
^^
test/for_no_iter.ink:3,0: error: Unable to parse statement here.
for i : 0.. {
x += 2.0;
^^^


View File

@@ -1,4 +1,4 @@
test/if_if_if.ink:2,3: error: Expected expression after 'if'.
test/if_if_if.ink:2,0: error: Expected expression after 'if'. Expected if condition.
if if if 0 > 100 {
^^
^^


View File

@@ -10,6 +10,7 @@ test/field_assignment.ink parse
test/field_without_type_specifier.ink parse
test/float_if_cond.ink parse
test/float_suffix.ink parse
test/for_i_loop.ink parse
test/function_call.ink parse
test/function_call_out_of_order_declaration.ink parse
test/function_call_return.ink parse