diff options
| author | Mel <einebeere@gmail.com> | 2022-05-30 02:02:53 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-30 02:02:53 +0000 |
| commit | 78a29c41098db5e5f8291e0345a3cd443c52b329 (patch) | |
| tree | be8b3f1bba2491531e5be30165a6fc9b2a423fdc /pkg/lang/vm/errors.go | |
| parent | d2f69dccb3643834a79da79be4ece189a7178c9e (diff) | |
| download | jinx-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.go | 9 |
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) +} |
