From 78a29c41098db5e5f8291e0345a3cd443c52b329 Mon Sep 17 00:00:00 2001 From: Mel Date: Mon, 30 May 2022 02:02:53 +0000 Subject: Specify arg count on VM Functions --- pkg/lang/vm/value/value.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pkg/lang/vm/value/value.go') 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 { -- cgit 1.4.1