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

@ -231,7 +231,17 @@ func GetCompileTestData() map[string]CompileTestData {
"sum",
&FunctionNode{
"sum",
[]string{"a", "b"},
[]FunctionParameter{
{
"a",
&NumberSignature{},
},
{
"b",
&NumberSignature{},
},
},
&NumberSignature{},
&BlockNode{
[]Node{
&ReturnNode{
@ -254,7 +264,16 @@ func GetCompileTestData() map[string]CompileTestData {
&FunctionValue{
"sum",
[]string{"a", "b"},
[]FunctionParameter{
{
"a",
&NumberSignature{},
},
{
"b",
&NumberSignature{},
},
},
NewChunk(
[]Bytecode{
InstructionDescend,
@ -281,7 +300,8 @@ func GetCompileTestData() map[string]CompileTestData {
"a",
&FunctionNode{
"a",
[]string{},
[]FunctionParameter{},
&NilSignature{},
&BlockNode{
[]Node{
&AssignNode{
@ -311,7 +331,7 @@ func GetCompileTestData() map[string]CompileTestData {
"a",
&FunctionValue{
"a",
[]string{},
[]FunctionParameter{},
NewChunk(
[]Bytecode{
InstructionDescend,