Fixed some error handling for invalid if statements. Started if codegen.
This commit is contained in:
4
test/parse/else_if_after_else.golden
Normal file
4
test/parse/else_if_after_else.golden
Normal file
@@ -0,0 +1,4 @@
|
||||
[1;37mtest/else_if_after_else.ink:6,6: [31merror: [37m'else if' without 'if'
|
||||
[96m } else if 0 > 200 {
|
||||
^^^^[97m
|
||||
[36m[37m
|
||||
6
test/parse/float_if_cond.golden
Normal file
6
test/parse/float_if_cond.golden
Normal file
@@ -0,0 +1,6 @@
|
||||
(program
|
||||
(fun vertex vs_main -> float4 (@position)
|
||||
[(:= pos float3 (@position))]
|
||||
(if 1
|
||||
(return (float4 pos 1)))
|
||||
(return (float4 0))))
|
||||
6
test/parse/if_cond_assign.golden
Normal file
6
test/parse/if_cond_assign.golden
Normal 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))))
|
||||
4
test/parse/if_if_if.golden
Normal file
4
test/parse/if_if_if.golden
Normal file
@@ -0,0 +1,4 @@
|
||||
[1;37mtest/if_if_if.ink:2,3: [31merror: [37mExpected expression after 'if'.
|
||||
[96mif if if 0 > 100 {
|
||||
^^
|
||||
[36m[37m
|
||||
Reference in New Issue
Block a user