init commit
This commit is contained in:
6
test/semant/assign_arithmetic_expression.golden
Normal file
6
test/semant/assign_arithmetic_expression.golden
Normal file
@@ -0,0 +1,6 @@
|
||||
scope (global) [
|
||||
[vertex__vs_main] : ()
|
||||
scope (vertex__vs_main) [
|
||||
[x] : float
|
||||
]
|
||||
]
|
||||
12
test/semant/basic_property_and_return_value.golden
Normal file
12
test/semant/basic_property_and_return_value.golden
Normal file
@@ -0,0 +1,12 @@
|
||||
scope (global) [
|
||||
[pixel__ps_main] : () -> float4
|
||||
[vertex__vs_main] : (pos : float3) -> float3
|
||||
[properties] : {color : float4}
|
||||
scope (properties) [
|
||||
[color] : float4
|
||||
]
|
||||
scope (vertex__vs_main) [
|
||||
[pos] : float3
|
||||
]
|
||||
scope (pixel__ps_main) []
|
||||
]
|
||||
8
test/semant/complicated_computation.golden
Normal file
8
test/semant/complicated_computation.golden
Normal file
@@ -0,0 +1,8 @@
|
||||
scope (global) [
|
||||
[vertex__vs_main] : ()
|
||||
scope (vertex__vs_main) [
|
||||
[x] : float
|
||||
[z] : float
|
||||
[y] : float
|
||||
]
|
||||
]
|
||||
4
test/semant/empty_struct.golden
Normal file
4
test/semant/empty_struct.golden
Normal file
@@ -0,0 +1,4 @@
|
||||
scope (global) [
|
||||
[Foo] : {}
|
||||
scope (Foo) []
|
||||
]
|
||||
4
test/semant/empty_vertex_main.golden
Normal file
4
test/semant/empty_vertex_main.golden
Normal file
@@ -0,0 +1,4 @@
|
||||
scope (global) [
|
||||
[vertex__vs_main] : ()
|
||||
scope (vertex__vs_main) []
|
||||
]
|
||||
@@ -0,0 +1,6 @@
|
||||
scope (global) [
|
||||
[vertex__vs_main] : (pos : float3) -> float3
|
||||
scope (vertex__vs_main) [
|
||||
[pos] : float3
|
||||
]
|
||||
]
|
||||
7
test/semant/field_assignment.golden
Normal file
7
test/semant/field_assignment.golden
Normal file
@@ -0,0 +1,7 @@
|
||||
scope (global) [
|
||||
[vertex__vs_main] : (pos : float4)
|
||||
scope (vertex__vs_main) [
|
||||
[x] : float
|
||||
[pos] : float4
|
||||
]
|
||||
]
|
||||
4
test/semant/field_without_type_specifier.golden
Normal file
4
test/semant/field_without_type_specifier.golden
Normal file
@@ -0,0 +1,4 @@
|
||||
[1;37mtest/field_without_type_specifier.shd:2,0: [31merror: [37mExpected type specifier after field name.
|
||||
[96mx := 5.0;
|
||||
^
|
||||
[36m[37m
|
||||
4
test/semant/float_suffix.golden
Normal file
4
test/semant/float_suffix.golden
Normal file
@@ -0,0 +1,4 @@
|
||||
[1;37mtest/float_suffix.shd:2,12: [31merror: [37mWe don't use 'f' suffixes for floating point values.
|
||||
[36m x : float = 2.0f
|
||||
^^^^
|
||||
[37m
|
||||
6
test/semant/function_call.golden
Normal file
6
test/semant/function_call.golden
Normal file
@@ -0,0 +1,6 @@
|
||||
scope (global) [
|
||||
[foo] : () -> int
|
||||
[vertex__vs_main] : ()
|
||||
scope (foo) []
|
||||
scope (vertex__vs_main) []
|
||||
]
|
||||
@@ -0,0 +1,6 @@
|
||||
scope (global) [
|
||||
[foo] : ()
|
||||
[vertex__vs_main] : ()
|
||||
scope (vertex__vs_main) []
|
||||
scope (foo) []
|
||||
]
|
||||
6
test/semant/function_call_return.golden
Normal file
6
test/semant/function_call_return.golden
Normal file
@@ -0,0 +1,6 @@
|
||||
scope (global) [
|
||||
[pixel__ps_main] : () -> float4
|
||||
[vertex__vs_main] : ()
|
||||
scope (vertex__vs_main) []
|
||||
scope (pixel__ps_main) []
|
||||
]
|
||||
6
test/semant/function_with_int_return.golden
Normal file
6
test/semant/function_with_int_return.golden
Normal file
@@ -0,0 +1,6 @@
|
||||
scope (global) [
|
||||
[vertex__vs_main] : (pos : float3)
|
||||
scope (vertex__vs_main) [
|
||||
[pos] : float3
|
||||
]
|
||||
]
|
||||
8
test/semant/functions_with_same_name.golden
Normal file
8
test/semant/functions_with_same_name.golden
Normal file
@@ -0,0 +1,8 @@
|
||||
[1;37mtest/functions_with_same_name.shd:2,0: [31merror: [37mRedeclaration of 'foo'
|
||||
[96m foo :: () {
|
||||
^^^
|
||||
|
||||
[97mtest/functions_with_same_name.shd:1,0: info: Here is the first declaration of 'foo'
|
||||
[96m foo :: () {
|
||||
^^^
|
||||
[36m[37m
|
||||
13
test/semant/meta_block.golden
Normal file
13
test/semant/meta_block.golden
Normal file
@@ -0,0 +1,13 @@
|
||||
scope (global) [
|
||||
[pixel__ps_main] : () -> float4
|
||||
[vertex__vs_main] : (pos : float3, uv : float2) -> float3
|
||||
[properties] : properties
|
||||
scope (properties) [
|
||||
[color] : float4
|
||||
]
|
||||
scope (vertex__vs_main) [
|
||||
[pos] : float3
|
||||
[uv] : float2
|
||||
]
|
||||
scope (pixel__ps_main) []
|
||||
]
|
||||
11
test/semant/multiple_functions.golden
Normal file
11
test/semant/multiple_functions.golden
Normal file
@@ -0,0 +1,11 @@
|
||||
scope (global) [
|
||||
[foo] : () -> int
|
||||
[vertex__vs_main] : ()
|
||||
[bar] : () -> float
|
||||
scope (foo) []
|
||||
scope (bar) []
|
||||
scope (vertex__vs_main) [
|
||||
[x] : int
|
||||
[y] : float
|
||||
]
|
||||
]
|
||||
13
test/semant/multiple_semicolons_everywhere.golden
Normal file
13
test/semant/multiple_semicolons_everywhere.golden
Normal file
@@ -0,0 +1,13 @@
|
||||
scope (global) [
|
||||
[pixel__ps_main] : () -> float4
|
||||
[foo] : () -> float4
|
||||
[vertex__vs_main] : (pos : float3) -> float3
|
||||
scope (vertex__vs_main) [
|
||||
[pos] : float3
|
||||
]
|
||||
scope (foo) []
|
||||
scope (pixel__ps_main) [
|
||||
[y] : float4
|
||||
[color] : float4
|
||||
]
|
||||
]
|
||||
@@ -0,0 +1,15 @@
|
||||
scope (global) [
|
||||
[foo] : (f : Foo) -> float
|
||||
[vertex__vs_main] : ()
|
||||
[Foo] : {some_data : float}
|
||||
scope (Foo) [
|
||||
[some_data] : float
|
||||
]
|
||||
scope (foo) [
|
||||
[f] : Foo
|
||||
]
|
||||
scope (vertex__vs_main) [
|
||||
[d] : float
|
||||
[f] : Foo
|
||||
]
|
||||
]
|
||||
8
test/semant/passthrough.golden
Normal file
8
test/semant/passthrough.golden
Normal file
@@ -0,0 +1,8 @@
|
||||
scope (global) [
|
||||
[pixel__ps_main] : () -> float4
|
||||
[vertex__vs_main] : (pos : float3) -> float3
|
||||
scope (vertex__vs_main) [
|
||||
[pos] : float3
|
||||
]
|
||||
scope (pixel__ps_main) []
|
||||
]
|
||||
9
test/semant/precedence_test.golden
Normal file
9
test/semant/precedence_test.golden
Normal file
@@ -0,0 +1,9 @@
|
||||
scope (global) [
|
||||
[vertex__vs_main] : (x : float, y : float, z : float, w : float)
|
||||
scope (vertex__vs_main) [
|
||||
[x] : float
|
||||
[z] : float
|
||||
[y] : float
|
||||
[w] : float
|
||||
]
|
||||
]
|
||||
8
test/semant/redeclared_variable.golden
Normal file
8
test/semant/redeclared_variable.golden
Normal file
@@ -0,0 +1,8 @@
|
||||
[1;37mtest/redeclared_variable.shd:3,0: [31merror: [37mRedeclaration of 'x'
|
||||
[96m x : float = 5.0
|
||||
^
|
||||
|
||||
[97mtest/redeclared_variable.shd:2,0: info: Here is the first declaration of 'x'
|
||||
[96m x : float = 1.0
|
||||
^
|
||||
[36m[37m
|
||||
11
test/semant/simple_struct_access.golden
Normal file
11
test/semant/simple_struct_access.golden
Normal file
@@ -0,0 +1,11 @@
|
||||
scope (global) [
|
||||
[Data] : {color : float4}
|
||||
[vertex__vs_main] : ()
|
||||
scope (Data) [
|
||||
[color] : float4
|
||||
]
|
||||
scope (vertex__vs_main) [
|
||||
[x] : float4
|
||||
[d] : Data
|
||||
]
|
||||
]
|
||||
6
test/semant/struct_access_primitive_type.golden
Normal file
6
test/semant/struct_access_primitive_type.golden
Normal file
@@ -0,0 +1,6 @@
|
||||
[1;37mtest/struct_access_primitive_type.shd:3,0: [31merror: [37mAttempting to access a field on a primitive type 'int'.
|
||||
[96mx.d = 4;
|
||||
^
|
||||
declaration:
|
||||
x : int = 5
|
||||
[36m[37m
|
||||
15
test/semant/struct_within_struct.golden
Normal file
15
test/semant/struct_within_struct.golden
Normal file
@@ -0,0 +1,15 @@
|
||||
scope (global) [
|
||||
[Bar] : {t : Foo}
|
||||
[vertex__vs_main] : ()
|
||||
[Foo] : {color : float4}
|
||||
scope (Foo) [
|
||||
[color] : float4
|
||||
]
|
||||
scope (Bar) [
|
||||
[t] : Foo
|
||||
]
|
||||
scope (vertex__vs_main) [
|
||||
[b] : Bar
|
||||
[f] : Foo
|
||||
]
|
||||
]
|
||||
4
test/semant/type_as_function_name.golden
Normal file
4
test/semant/type_as_function_name.golden
Normal file
@@ -0,0 +1,4 @@
|
||||
[1;37mtest/type_as_function_name.shd:1,0: [31merror: [37mInvalid function name 'int'
|
||||
[36m int :: () {
|
||||
^^^
|
||||
[37m
|
||||
4
test/semant/type_as_variable_name.golden
Normal file
4
test/semant/type_as_variable_name.golden
Normal file
@@ -0,0 +1,4 @@
|
||||
[1;37mtest/type_as_variable_name.shd:2,0: [31merror: [37mInvalid variable name 'int'
|
||||
[36m int : float = 4.0
|
||||
^^^
|
||||
[37m
|
||||
7
test/semant/undeclared_function.golden
Normal file
7
test/semant/undeclared_function.golden
Normal file
@@ -0,0 +1,7 @@
|
||||
[1;37mtest/undeclared_function.shd:2,0: [31merror: [37mAttempt to call undeclared function 'foo'.
|
||||
|
||||
[96m foo();
|
||||
^^^
|
||||
|
||||
|
||||
[36m[37m
|
||||
4
test/semant/undeclared_symbol.golden
Normal file
4
test/semant/undeclared_symbol.golden
Normal file
@@ -0,0 +1,4 @@
|
||||
[1;37mtest/undeclared_symbol.shd:2,10: [31merror: [37mUse of undeclared symbol 'f'
|
||||
[96m b : int = f;
|
||||
^
|
||||
[36m[37m
|
||||
33
test/semant/unknown_overload.golden
Normal file
33
test/semant/unknown_overload.golden
Normal file
@@ -0,0 +1,33 @@
|
||||
[1;37mtest/unknown_overload.shd:6,0: [31merror: [37mProcedure call did not match any of the possible overloads for 'foo'
|
||||
[96m found:
|
||||
foo(v, v);
|
||||
^^^
|
||||
|
||||
[97m While matching argument 1 in function call.
|
||||
[96m foo(v, v);
|
||||
^
|
||||
[97m Possible overloads:
|
||||
[96m foo :: (v1 : float3, v2 : float3) { (test/unknown_overload.shd:1)
|
||||
[96m foo :: (v1 : float2, v2 : float2, v3 : float2) { (test/unknown_overload.shd:2)
|
||||
|
||||
[36m[37m[1;37mtest/unknown_overload.shd:6,4: [31merror: [37mType mismatch. Expected float3 got float
|
||||
[96m found:
|
||||
foo(v, v);
|
||||
^
|
||||
expected:
|
||||
float3
|
||||
|
||||
got:
|
||||
v : float = 2.0
|
||||
|
||||
[36m[37m[1;37mtest/unknown_overload.shd:6,7: [31merror: [37mType mismatch. Expected float3 got float
|
||||
[96m found:
|
||||
foo(v, v);
|
||||
^
|
||||
expected:
|
||||
float3
|
||||
|
||||
got:
|
||||
v : float = 2.0
|
||||
|
||||
[36m[37m
|
||||
6
test/semant/use_builtin_functions.golden
Normal file
6
test/semant/use_builtin_functions.golden
Normal file
@@ -0,0 +1,6 @@
|
||||
scope (global) [
|
||||
[vertex__vs_main] : ()
|
||||
scope (vertex__vs_main) [
|
||||
[f] : float4
|
||||
]
|
||||
]
|
||||
16
test/semant/wrong_argument_count.golden
Normal file
16
test/semant/wrong_argument_count.golden
Normal file
@@ -0,0 +1,16 @@
|
||||
[1;37mtest/wrong_argument_count.shd:5,19: [31merror: [37mUse of undeclared symbol 'w'
|
||||
[96m return x * y * z * w;
|
||||
^
|
||||
[36m[37m[1;37mtest/wrong_argument_count.shd: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.shd:1)
|
||||
[97m Not enough arguments: Wanted 3, got 2.
|
||||
|
||||
[96m foo :: (x : float, y : float, z : float, w : float) -> float { (test/wrong_argument_count.shd:4)
|
||||
[97m Not enough arguments: Wanted 4, got 2.
|
||||
|
||||
|
||||
[36m[37m
|
||||
11
test/semant/wrong_multiply.golden
Normal file
11
test/semant/wrong_multiply.golden
Normal file
@@ -0,0 +1,11 @@
|
||||
[1;37mtest/wrong_multiply.shd:4,34: [31merror: [37mType mismatch. Expected float got float2
|
||||
[96m found:
|
||||
result : float4 = float4(1.0, foo * res, 0.0, 1.0);
|
||||
^
|
||||
expected:
|
||||
float
|
||||
|
||||
got:
|
||||
res : float2 = float2(2.0, 2.0)
|
||||
|
||||
[36m[37m
|
||||
22
test/semant/wrong_type_for_function.golden
Normal file
22
test/semant/wrong_type_for_function.golden
Normal file
@@ -0,0 +1,22 @@
|
||||
[1;37mtest/wrong_type_for_function.shd: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);
|
||||
^^^^^^
|
||||
|
||||
[97m While matching argument 1 in function call.
|
||||
[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.shd:79)
|
||||
|
||||
[36m[37m[1;37mtest/wrong_type_for_function.shd:11,24: [31merror: [37mType mismatch. Expected float got float2
|
||||
[96m found:
|
||||
color : float4 = float4(y, 1.0, 1.0, 1.0);
|
||||
^
|
||||
expected:
|
||||
float
|
||||
|
||||
got:
|
||||
y : float2 = foo()
|
||||
|
||||
[36m[37m
|
||||
Reference in New Issue
Block a user