about summary refs log tree commit diff
path: root/pkg/lang/vm/errors.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/errors.go
parentd2f69dccb3643834a79da79be4ece189a7178c9e (diff)
downloadjinx-78a29c41098db5e5f8291e0345a3cd443c52b329.tar.zst
jinx-78a29c41098db5e5f8291e0345a3cd443c52b329.zip
Specify arg count on VM Functions
Diffstat (limited to 'pkg/lang/vm/errors.go')
-rw-r--r--pkg/lang/vm/errors.go9
1 files changed, 9 insertions, 0 deletions
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)
+}