Added unary expressions to semcheck and codegen.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
[1;37mtest/functions_with_same_name.inx:2,0: [31merror: [37mRedeclaration of 'foo'
|
||||
[1;37mtest/functions_with_same_name.ink:2,0: [31merror: [37mRedeclaration of 'foo'
|
||||
[96m foo :: () {
|
||||
^^^
|
||||
|
||||
[97mtest/functions_with_same_name.inx:1,0: info: Here is the first declaration of 'foo'
|
||||
[97mtest/functions_with_same_name.ink:1,0: info: Here is the first declaration of 'foo'
|
||||
[96m foo :: () {
|
||||
^^^
|
||||
[36m[37m
|
||||
@@ -1,8 +1,8 @@
|
||||
[1;37mtest/redeclared_variable.inx:3,0: [31merror: [37mRedeclaration of 'x'
|
||||
[1;37mtest/redeclared_variable.ink:3,0: [31merror: [37mRedeclaration of 'x'
|
||||
[96m x : float = 5.0
|
||||
^
|
||||
|
||||
[97mtest/redeclared_variable.inx:2,0: info: Here is the first declaration of 'x'
|
||||
[97mtest/redeclared_variable.ink:2,0: info: Here is the first declaration of 'x'
|
||||
[96m x : float = 1.0
|
||||
^
|
||||
[36m[37m
|
||||
@@ -1,4 +1,4 @@
|
||||
[1;37mtest/struct_access_primitive_type.inx:3,0: [31merror: [37mAttempting to access a field on a primitive type 'int'.
|
||||
[1;37mtest/struct_access_primitive_type.ink:3,0: [31merror: [37mAttempting to access a field on a primitive type 'int'.
|
||||
[96mx.d = 4;
|
||||
^
|
||||
declaration:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[1;37mtest/type_as_variable_name.inx:2,0: [31merror: [37mInvalid variable name 'int'
|
||||
[1;37mtest/type_as_variable_name.ink:2,0: [31merror: [37mInvalid variable name 'int'
|
||||
[36m int : float = 4.0
|
||||
^^^
|
||||
[37m
|
||||
10
test/semant/unary.golden
Normal file
10
test/semant/unary.golden
Normal file
@@ -0,0 +1,10 @@
|
||||
scope (global) [
|
||||
[pixel__ps_ps_main] : (position : float4) -> float4
|
||||
[vertex__vs_vs_main] : (position : float3) -> float4
|
||||
scope (vertex__vs_vs_main) [
|
||||
[position] : float3
|
||||
]
|
||||
scope (pixel__ps_ps_main) [
|
||||
[position] : float4
|
||||
]
|
||||
]
|
||||
@@ -1,4 +1,4 @@
|
||||
[1;37mtest/undeclared_function.inx:2,0: [31merror: [37mAttempt to call undeclared function 'foo'.
|
||||
[1;37mtest/undeclared_function.ink:2,0: [31merror: [37mAttempt to call undeclared function 'foo'.
|
||||
|
||||
[96m foo();
|
||||
^^^
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[1;37mtest/undeclared_symbol.inx:2,10: [31merror: [37mUse of undeclared symbol 'f'
|
||||
[1;37mtest/undeclared_symbol.ink:2,10: [31merror: [37mUse of undeclared symbol 'f'
|
||||
[96m b : int = f;
|
||||
^
|
||||
[36m[37m
|
||||
@@ -1,4 +1,4 @@
|
||||
[1;37mtest/unknown_overload.inx:6,0: [31merror: [37mProcedure call did not match any of the possible overloads for 'foo'
|
||||
[1;37mtest/unknown_overload.ink:6,0: [31merror: [37mProcedure call did not match any of the possible overloads for 'foo'
|
||||
[96m found:
|
||||
foo(v, v);
|
||||
^^^
|
||||
@@ -7,10 +7,10 @@
|
||||
[96m foo(v, v);
|
||||
^
|
||||
[97m Possible overloads:
|
||||
[96m foo :: (v1 : float3, v2 : float3) { (test/unknown_overload.inx:1)
|
||||
[96m foo :: (v1 : float2, v2 : float2, v3 : float2) { (test/unknown_overload.inx:2)
|
||||
[96m foo :: (v1 : float3, v2 : float3) { (test/unknown_overload.ink:1)
|
||||
[96m foo :: (v1 : float2, v2 : float2, v3 : float2) { (test/unknown_overload.ink:2)
|
||||
|
||||
[36m[37m[1;37mtest/unknown_overload.inx:6,4: [31merror: [37mType mismatch. Expected float3 got float
|
||||
[36m[37m[1;37mtest/unknown_overload.ink:6,4: [31merror: [37mType mismatch. Expected float3 got float
|
||||
[96m found:
|
||||
foo(v, v);
|
||||
^
|
||||
@@ -20,7 +20,7 @@
|
||||
got:
|
||||
v : float = 2.0
|
||||
|
||||
[36m[37m[1;37mtest/unknown_overload.inx:6,7: [31merror: [37mType mismatch. Expected float3 got float
|
||||
[36m[37m[1;37mtest/unknown_overload.ink:6,7: [31merror: [37mType mismatch. Expected float3 got float
|
||||
[96m found:
|
||||
foo(v, v);
|
||||
^
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
[1;37mtest/wrong_argument_count.inx:5,19: [31merror: [37mUse of undeclared symbol 'w'
|
||||
[1;37mtest/wrong_argument_count.ink:5,19: [31merror: [37mUse of undeclared symbol 'w'
|
||||
[96m return x * y * z * w;
|
||||
^
|
||||
[36m[37m[1;37mtest/wrong_argument_count.inx:9,0: [31merror: [37mProcedure call did not match any of the possible overloads for 'foo'
|
||||
[36m[37m[1;37mtest/wrong_argument_count.ink:9,0: [31merror: [37mProcedure call did not match any of the possible overloads for 'foo'
|
||||
[96m found:
|
||||
foo(2.0, 3.0);
|
||||
^^^
|
||||
[97m Possible overloads:
|
||||
[96m foo :: (x : float, y : float, z : float) -> float { (test/wrong_argument_count.inx:1)
|
||||
[96m foo :: (x : float, y : float, z : float) -> float { (test/wrong_argument_count.ink:1)
|
||||
[97m Not enough arguments: Wanted 3, got 2.
|
||||
|
||||
[96m foo :: (x : float, y : float, z : float, w : float) -> float { (test/wrong_argument_count.inx:4)
|
||||
[96m foo :: (x : float, y : float, z : float, w : float) -> float { (test/wrong_argument_count.ink:4)
|
||||
[97m Not enough arguments: Wanted 4, got 2.
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[1;37mtest/wrong_multiply.inx:4,34: [31merror: [37mType mismatch. Expected float got float2
|
||||
[1;37mtest/wrong_multiply.ink:4,34: [31merror: [37mType mismatch. Expected float got float2
|
||||
[96m found:
|
||||
result : float4 = float4(1.0, foo * res, 0.0, 1.0);
|
||||
^
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[1;37mtest/wrong_type_for_function.inx:11,17: [31merror: [37mProcedure call did not match any of the possible overloads for 'float4'
|
||||
[1;37mtest/wrong_type_for_function.ink:11,17: [31merror: [37mProcedure call did not match any of the possible overloads for 'float4'
|
||||
[96m found:
|
||||
color : float4 = float4(y, 1.0, 1.0, 1.0);
|
||||
^^^^^^
|
||||
@@ -7,9 +7,9 @@
|
||||
[96m color : float4 = float4(y, 1.0, 1.0, 1.0);
|
||||
^
|
||||
[97m Possible overloads:
|
||||
[96m foreign float4 :: (float, float, float, float) -> float4; (test/wrong_type_for_function.inx:78)
|
||||
[96m foreign float4 :: (float, float, float, float) -> float4; (test/wrong_type_for_function.ink:78)
|
||||
|
||||
[36m[37m[1;37mtest/wrong_type_for_function.inx:11,24: [31merror: [37mType mismatch. Expected float got float2
|
||||
[36m[37m[1;37mtest/wrong_type_for_function.ink:11,24: [31merror: [37mType mismatch. Expected float got float2
|
||||
[96m found:
|
||||
color : float4 = float4(y, 1.0, 1.0, 1.0);
|
||||
^
|
||||
|
||||
Reference in New Issue
Block a user