From 360f092fe693f66219891581417026a3cffd2709 Mon Sep 17 00:00:00 2001 From: Mel Date: Fri, 20 May 2022 00:05:20 +0200 Subject: More VM operations needed for Fib --- 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 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 -- cgit 1.4.1