Fix some tests and do some cleanup.

This commit is contained in:
2025-01-01 23:06:53 +01:00
parent f13508262b
commit 4deb07027f
70 changed files with 439 additions and 361 deletions

View File

@@ -1,8 +1,8 @@
test/functions_with_same_name.shd:2,0: error: Redeclaration of 'foo'
test/functions_with_same_name.inx:2,0: error: Redeclaration of 'foo'
 foo :: () {
^^^
test/functions_with_same_name.shd:1,0: info: Here is the first declaration of 'foo'
test/functions_with_same_name.inx:1,0: info: Here is the first declaration of 'foo'
 foo :: () {
^^^


View File

@@ -0,0 +1,12 @@
scope (global) [
[pixel__ps_main] : () -> float4
[vertex__vs_main] : (pos : float4) -> float4
[props] : {color : float4}
scope (props) [
[color] : float4
]
scope (vertex__vs_main) [
[pos] : float4
]
scope (pixel__ps_main) []
]

View File

@@ -1,8 +1,8 @@
test/redeclared_variable.shd:3,0: error: Redeclaration of 'x'
test/redeclared_variable.inx:3,0: error: Redeclaration of 'x'
 x : float = 5.0
^
test/redeclared_variable.shd:2,0: info: Here is the first declaration of 'x'
test/redeclared_variable.inx:2,0: info: Here is the first declaration of 'x'
 x : float = 1.0
^


View File

@@ -1,4 +1,4 @@
test/struct_access_primitive_type.shd:3,0: error: Attempting to access a field on a primitive type 'int'.
test/struct_access_primitive_type.inx:3,0: error: Attempting to access a field on a primitive type 'int'.
x.d = 4;
^
declaration:

View File

@@ -1,4 +1,4 @@
test/type_as_variable_name.shd:2,0: error: Invalid variable name 'int'
test/type_as_variable_name.inx:2,0: error: Invalid variable name 'int'
 int : float = 4.0
^^^


View File

@@ -1,4 +1,4 @@
test/undeclared_function.shd:2,0: error: Attempt to call undeclared function 'foo'.
test/undeclared_function.inx:2,0: error: Attempt to call undeclared function 'foo'.
 foo();
^^^

View File

@@ -1,4 +1,4 @@
test/undeclared_symbol.shd:2,10: error: Use of undeclared symbol 'f'
test/undeclared_symbol.inx:2,10: error: Use of undeclared symbol 'f'
 b : int = f;
^


View File

@@ -1,4 +1,4 @@
test/unknown_overload.shd:6,0: error: Procedure call did not match any of the possible overloads for 'foo'
test/unknown_overload.inx:6,0: error: Procedure call did not match any of the possible overloads for 'foo'
 found:
foo(v, v);
^^^
@@ -7,10 +7,10 @@
 foo(v, v);
^
 Possible overloads:
 foo :: (v1 : float3, v2 : float3) { (test/unknown_overload.shd:1)
 foo :: (v1 : float2, v2 : float2, v3 : float2) { (test/unknown_overload.shd:2)
 foo :: (v1 : float3, v2 : float3) { (test/unknown_overload.inx:1)
 foo :: (v1 : float2, v2 : float2, v3 : float2) { (test/unknown_overload.inx:2)
test/unknown_overload.shd:6,4: error: Type mismatch. Expected float3 got float
test/unknown_overload.inx:6,4: error: Type mismatch. Expected float3 got float
 found:
foo(v, v);
^
@@ -20,7 +20,7 @@
got:
v : float = 2.0
test/unknown_overload.shd:6,7: error: Type mismatch. Expected float3 got float
test/unknown_overload.inx:6,7: error: Type mismatch. Expected float3 got float
 found:
foo(v, v);
^

View File

@@ -1,15 +1,15 @@
test/wrong_argument_count.shd:5,19: error: Use of undeclared symbol 'w'
test/wrong_argument_count.inx:5,19: error: Use of undeclared symbol 'w'
 return x * y * z * w;
^
test/wrong_argument_count.shd:9,0: error: Procedure call did not match any of the possible overloads for 'foo'
test/wrong_argument_count.inx:9,0: error: Procedure call did not match any of the possible overloads for 'foo'
 found:
foo(2.0, 3.0);
^^^
 Possible overloads:
 foo :: (x : float, y : float, z : float) -> float { (test/wrong_argument_count.shd:1)
 foo :: (x : float, y : float, z : float) -> float { (test/wrong_argument_count.inx:1)
 Not enough arguments: Wanted 3, got 2.
 foo :: (x : float, y : float, z : float, w : float) -> float { (test/wrong_argument_count.shd:4)
 foo :: (x : float, y : float, z : float, w : float) -> float { (test/wrong_argument_count.inx:4)
 Not enough arguments: Wanted 4, got 2.

View File

@@ -1,4 +1,4 @@
test/wrong_multiply.shd:4,34: error: Type mismatch. Expected float got float2
test/wrong_multiply.inx:4,34: error: Type mismatch. Expected float got float2
 found:
result : float4 = float4(1.0, foo * res, 0.0, 1.0);
^

View File

@@ -1,4 +1,4 @@
test/wrong_type_for_function.shd:11,17: error: Procedure call did not match any of the possible overloads for 'float4'
test/wrong_type_for_function.inx:11,17: error: Procedure call did not match any of the possible overloads for 'float4'
 found:
color : float4 = float4(y, 1.0, 1.0, 1.0);
^^^^^^
@@ -7,9 +7,9 @@
 color : float4 = float4(y, 1.0, 1.0, 1.0);
^
 Possible overloads:
 foreign float4 :: (float, float, float, float) -> float4; (test/wrong_type_for_function.shd:78)
 foreign float4 :: (float, float, float, float) -> float4; (test/wrong_type_for_function.inx:78)
test/wrong_type_for_function.shd:11,24: error: Type mismatch. Expected float got float2
test/wrong_type_for_function.inx:11,24: error: Type mismatch. Expected float got float2
 found:
color : float4 = float4(y, 1.0, 1.0, 1.0);
^