Basic type system working

This commit is contained in:
Neemek 2025-03-16 22:46:49 +01:00
parent 3f260e7ffd
commit 84cc845748
Signed by: neemek
GPG key ID: 28360A8951CD0E9B
19 changed files with 900 additions and 131 deletions

View file

@ -22,13 +22,22 @@ func GetAllTestCases() map[string]AllTestCase {
},
},
"func": {
"func sum(a, b) {\n\treturn a + b\n}\nsum(1, 2)",
"func sum(a: number, b: number) {\n\treturn a + b\n}\nsum(1, 2)",
[]Value{
&VariableValue{
"sum",
&FunctionValue{
Name: "sum",
Params: []string{"a", "b"},
Name: "sum",
Params: []FunctionParameter{
{
"a",
&NumberSignature{},
},
{
"b",
&NumberSignature{},
},
},
Chunk: &Chunk{
Bytecode: []Bytecode{
InstructionDescend,