Basic type system working
This commit is contained in:
parent
3f260e7ffd
commit
84cc845748
19 changed files with 900 additions and 131 deletions
|
|
@ -441,8 +441,17 @@ func GetExecutionTestData() map[string]struct {
|
|||
&NumberValue{1},
|
||||
&NumberValue{2},
|
||||
&FunctionValue{
|
||||
Name: "sum",
|
||||
Params: []string{"a", "b"},
|
||||
Name: "sum",
|
||||
Params: []FunctionParameter{
|
||||
{
|
||||
"a",
|
||||
&NumberSignature{},
|
||||
},
|
||||
{
|
||||
"b",
|
||||
&NumberSignature{},
|
||||
},
|
||||
},
|
||||
Chunk: NewChunk(
|
||||
[]Bytecode{
|
||||
InstructionGetLocal, 0,
|
||||
|
|
@ -475,8 +484,17 @@ func GetExecutionTestData() map[string]struct {
|
|||
&NumberValue{1},
|
||||
&NumberValue{2},
|
||||
&FunctionValue{
|
||||
Name: "sum",
|
||||
Params: []string{"a", "b"},
|
||||
Name: "sum",
|
||||
Params: []FunctionParameter{
|
||||
{
|
||||
"a",
|
||||
&NumberSignature{},
|
||||
},
|
||||
{
|
||||
"b",
|
||||
&NumberSignature{},
|
||||
},
|
||||
},
|
||||
Chunk: NewChunk(
|
||||
[]Bytecode{
|
||||
InstructionGetLocal, 0,
|
||||
|
|
@ -492,8 +510,13 @@ func GetExecutionTestData() map[string]struct {
|
|||
),
|
||||
},
|
||||
&FunctionValue{
|
||||
Name: "square",
|
||||
Params: []string{"n"},
|
||||
Name: "square",
|
||||
Params: []FunctionParameter{
|
||||
{
|
||||
"n",
|
||||
&NumberSignature{},
|
||||
},
|
||||
},
|
||||
Chunk: NewChunk(
|
||||
[]Bytecode{
|
||||
InstructionGetLocal, 0,
|
||||
|
|
@ -513,8 +536,13 @@ func GetExecutionTestData() map[string]struct {
|
|||
&VariableValue{
|
||||
"square",
|
||||
&FunctionValue{
|
||||
Name: "square",
|
||||
Params: []string{"n"},
|
||||
Name: "square",
|
||||
Params: []FunctionParameter{
|
||||
{
|
||||
"n",
|
||||
&NumberSignature{},
|
||||
},
|
||||
},
|
||||
Chunk: NewChunk(
|
||||
[]Bytecode{
|
||||
InstructionGetLocal, 0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue