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/errors.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'pkg/lang/vm/errors.go') diff --git a/pkg/lang/vm/errors.go b/pkg/lang/vm/errors.go index 5423070..640ab21 100644 --- a/pkg/lang/vm/errors.go +++ b/pkg/lang/vm/errors.go @@ -91,3 +91,12 @@ type ErrArrayIndexOutOfBounds struct { func (e ErrArrayIndexOutOfBounds) Error() string { return fmt.Sprintf("array index out of bounds: %d (len: %d)", e.Index, e.Len) } + +type ErrNotEnoughArguments struct { + Needed uint + Got uint +} + +func (e ErrNotEnoughArguments) Error() string { + return fmt.Sprintf("not enough arguments: needed %d, got %d", e.Needed, e.Got) +} -- cgit 1.4.1