about summary refs log tree commit diff
path: root/pkg/lang/vm/stack.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/lang/vm/stack.go')
-rw-r--r--pkg/lang/vm/stack.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/lang/vm/stack.go b/pkg/lang/vm/stack.go
index 433c0b7..1d028e5 100644
--- a/pkg/lang/vm/stack.go
+++ b/pkg/lang/vm/stack.go
@@ -4,6 +4,10 @@ import "jinx/pkg/lang/vm/value"
 
 type CallStack []*LocalStack
 
+func NewCallStack() CallStack {
+	return []*LocalStack{{}}
+}
+
 func (cs *CallStack) Push() {
 	*cs = append(*cs, &LocalStack{})
 }