From 6fe6e6546c4801f850d943c699fccdd5dc6ea723 Mon Sep 17 00:00:00 2001 From: Mel Date: Fri, 20 May 2022 20:28:17 +0200 Subject: Continuous VM stack implementation --- pkg/lang/vm/errors.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'pkg/lang/vm/errors.go') diff --git a/pkg/lang/vm/errors.go b/pkg/lang/vm/errors.go index 045f9a9..bbc66b8 100644 --- a/pkg/lang/vm/errors.go +++ b/pkg/lang/vm/errors.go @@ -20,12 +20,13 @@ func (e Error) Error() string { // Fatal errors var ( - ErrCallStackOverflow = errors.New("call stack overflow (max depth: 1000)") - ErrLocalStackOverflow = errors.New("local stack overflow (max depth: 1000)") - ErrNoPreviousCallFrame = errors.New("no previous call frame") - ErrCantPopRootFrame = errors.New("cannot pop root frame") + ErrStackOverflow = errors.New("stack overflow (max depth: 1000)") + ErrStackUnderflow = errors.New("local stack underflow") - ErrCallFrameEmpty = errors.New("current call frame is empty") + 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") ) type ErrLocalIndexOutOfBounds struct { -- cgit 1.4.1