init commit

This commit is contained in:
2024-06-09 21:34:23 +02:00
commit b81c0af596
177 changed files with 8799 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
scope (global) [
[vertex__vs_main] : ()
scope (vertex__vs_main) [
[x] : float
]
]

View 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) []
]

View File

@@ -0,0 +1,8 @@
scope (global) [
[vertex__vs_main] : ()
scope (vertex__vs_main) [
[x] : float
[z] : float
[y] : float
]
]

View File

@@ -0,0 +1,4 @@
scope (global) [
[Foo] : {}
scope (Foo) []
]

View File

@@ -0,0 +1,4 @@
scope (global) [
[vertex__vs_main] : ()
scope (vertex__vs_main) []
]

View File

@@ -0,0 +1,6 @@
scope (global) [
[vertex__vs_main] : (pos : float3) -> float3
scope (vertex__vs_main) [
[pos] : float3
]
]

View File

@@ -0,0 +1,7 @@
scope (global) [
[vertex__vs_main] : (pos : float4)
scope (vertex__vs_main) [
[x] : float
[pos] : float4
]
]

View File

@@ -0,0 +1,4 @@
test/field_without_type_specifier.shd:2,0: error: Expected type specifier after field name.
x := 5.0;
^


View File

@@ -0,0 +1,4 @@
test/float_suffix.shd:2,12: error: We don't use 'f' suffixes for floating point values.
 x : float = 2.0f
^^^^


View File

@@ -0,0 +1,6 @@
scope (global) [
[foo] : () -> int
[vertex__vs_main] : ()
scope (foo) []
scope (vertex__vs_main) []
]

View File

@@ -0,0 +1,6 @@
scope (global) [
[foo] : ()
[vertex__vs_main] : ()
scope (vertex__vs_main) []
scope (foo) []
]

View File

@@ -0,0 +1,6 @@
scope (global) [
[pixel__ps_main] : () -> float4
[vertex__vs_main] : ()
scope (vertex__vs_main) []
scope (pixel__ps_main) []
]

View File

@@ -0,0 +1,6 @@
scope (global) [
[vertex__vs_main] : (pos : float3)
scope (vertex__vs_main) [
[pos] : float3
]
]

View File

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


View 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) []
]

View 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
]
]

View 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
]
]

View File

@@ -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
]
]

View 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) []
]

View 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
]
]

View File

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


View 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
]
]

View File

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


View 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
]
]

View File

@@ -0,0 +1,4 @@
test/type_as_function_name.shd:1,0: error: Invalid function name 'int'
 int :: () {
^^^


View File

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


View File

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


View File

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


View File

@@ -0,0 +1,33 @@
test/unknown_overload.shd:6,0: error: Procedure call did not match any of the possible overloads for 'foo'
 found:
foo(v, v);
^^^
 While matching argument 1 in function call.
 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)
test/unknown_overload.shd:6,4: error: Type mismatch. Expected float3 got float
 found:
foo(v, v);
^
expected:
float3
got:
v : float = 2.0
test/unknown_overload.shd:6,7: error: Type mismatch. Expected float3 got float
 found:
foo(v, v);
^
expected:
float3
got:
v : float = 2.0


View File

@@ -0,0 +1,6 @@
scope (global) [
[vertex__vs_main] : ()
scope (vertex__vs_main) [
[f] : float4
]
]

View File

@@ -0,0 +1,16 @@
test/wrong_argument_count.shd: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'
 found:
foo(2.0, 3.0);
^^^
 Possible overloads:
 foo :: (x : float, y : float, z : float) -> float { (test/wrong_argument_count.shd:1)
 Not enough arguments: Wanted 3, got 2.
 foo :: (x : float, y : float, z : float, w : float) -> float { (test/wrong_argument_count.shd:4)
 Not enough arguments: Wanted 4, got 2.


View File

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


View File

@@ -0,0 +1,22 @@
test/wrong_type_for_function.shd: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);
^^^^^^
 While matching argument 1 in function call.
 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:79)
test/wrong_type_for_function.shd:11,24: error: Type mismatch. Expected float got float2
 found:
color : float4 = float4(y, 1.0, 1.0, 1.0);
^
expected:
float
got:
y : float2 = foo()