diff options
| author | Mel <einebeere@gmail.com> | 2022-05-20 00:05:20 +0200 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2022-05-20 00:05:20 +0200 |
| commit | 360f092fe693f66219891581417026a3cffd2709 (patch) | |
| tree | 61370560419450ce0b306a68d20e85ce2c9f69a5 /pkg/lang/vm/errors.go | |
| parent | fe93d5c015e8e2c883d2c1e74f2e5ce071256cb5 (diff) | |
| download | jinx-360f092fe693f66219891581417026a3cffd2709.tar.zst jinx-360f092fe693f66219891581417026a3cffd2709.zip | |
More VM operations needed for Fib
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 9859feb..045f9a9 100644 --- a/pkg/lang/vm/errors.go +++ b/pkg/lang/vm/errors.go @@ -47,6 +47,15 @@ func (e ErrInvalidOp) Error() string { // Non-fatal errors, which will later be implemented as catchable exceptions +type ErrInvalidOperandType struct { + Op code.Op + X value.Type +} + +func (e ErrInvalidOperandType) Error() string { + return fmt.Sprintf("invalid operand type for op %s: %v", text.OpToString(e.Op), e.X) +} + type ErrInvalidOperandTypes struct { Op code.Op X value.Type |
