From 2ddb215e3b0d3818b3fac8f315d97d8020eb699f Mon Sep 17 00:00:00 2001 From: Mel Date: Sat, 28 May 2022 14:28:46 +0000 Subject: Extract stack package and hide behind interface --- pkg/lang/vm/errors.go | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'pkg/lang/vm/errors.go') diff --git a/pkg/lang/vm/errors.go b/pkg/lang/vm/errors.go index 2f5b56a..a717c09 100644 --- a/pkg/lang/vm/errors.go +++ b/pkg/lang/vm/errors.go @@ -25,35 +25,9 @@ func (e Error) Error() string { // Fatal errors var ( - ErrStackOverflow = errors.New("stack overflow (max depth: 1000)") - ErrStackUnderflow = errors.New("local stack underflow") - - ErrReachedMaxCallDepth = errors.New("reached max call depth (max depth: 1000)") - ErrReachedRootCallFrame = errors.New("reached root call frame") - - ErrCallBaseCantBeNegative = errors.New("call base cannot be negative") - ErrEnvNotSet = errors.New("env not set") ) -type ErrLocalIndexOutOfBounds struct { - Index int - Len int -} - -func (e ErrLocalIndexOutOfBounds) Error() string { - return fmt.Sprintf("local index out of bounds: %d (len: %d)", e.Index, e.Len) -} - -type ErrStackIndexOutOfBounds struct { - Index int - Len int -} - -func (e ErrStackIndexOutOfBounds) Error() string { - return fmt.Sprintf("stack index out of bounds: %d (len: %d)", e.Index, e.Len) -} - type ErrInvalidOp struct { Op uint8 } -- cgit 1.4.1