Fixed some error handling for invalid if statements. Started if codegen.

This commit is contained in:
2025-01-18 22:22:16 +01:00
parent b4d119230b
commit 45ea54cf93
23 changed files with 344 additions and 11 deletions

View File

@@ -0,0 +1,4 @@
test/else_if_after_else.ink:6,6: error: 'else if' without 'if'
 } else if 0 > 200 {
^^^^


View File

@@ -0,0 +1,6 @@
(program
(fun vertex vs_main -> float4 (@position)
[(:= pos float3 (@position))]
(if 1
(return (float4 pos 1)))
(return (float4 0))))

View File

@@ -0,0 +1,6 @@
(program
(fun vertex vs_main -> float4 (@position)
[(:= pos float3 (@position))]
(if (= 0 100)
(return (float4 pos 1)))
(return (float4 0))))

View File

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