about summary refs log tree commit diff
path: root/pkg/lang/vm/value/value.go
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2022-05-30 02:02:53 +0000
committerGitHub <noreply@github.com>2022-05-30 02:02:53 +0000
commit78a29c41098db5e5f8291e0345a3cd443c52b329 (patch)
treebe8b3f1bba2491531e5be30165a6fc9b2a423fdc /pkg/lang/vm/value/value.go
parentd2f69dccb3643834a79da79be4ece189a7178c9e (diff)
downloadjinx-78a29c41098db5e5f8291e0345a3cd443c52b329.tar.zst
jinx-78a29c41098db5e5f8291e0345a3cd443c52b329.zip
Specify arg count on VM Functions
Diffstat (limited to 'pkg/lang/vm/value/value.go')
-rw-r--r--pkg/lang/vm/value/value.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/lang/vm/value/value.go b/pkg/lang/vm/value/value.go
index eb63503..05d3f09 100644
--- a/pkg/lang/vm/value/value.go
+++ b/pkg/lang/vm/value/value.go
@@ -48,12 +48,12 @@ func NewNull() Value {
 	return Value{t: CORE_TYPE_NULL}
 }
 
-func NewFunction(pc int) Value {
-	return Value{t: CORE_TYPE_FUNCTION, d: FunctionData{pc: pc}}
+func NewFunction(pc int, args uint) Value {
+	return Value{t: CORE_TYPE_FUNCTION, d: FunctionData{pc: pc, args: args}}
 }
 
-func NewNativeFunction(f NativeFunc) Value {
-	return Value{t: CORE_TYPE_FUNCTION, d: FunctionData{native: f}}
+func NewNativeFunction(f NativeFunc, args uint) Value {
+	return Value{t: CORE_TYPE_FUNCTION, d: FunctionData{native: f, args: args}}
 }
 
 func NewObject() Value {