From da7e7dae2b690308fb7ff3aba34145233c740bce Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Fri, 24 Sep 2021 01:26:49 +0200 Subject: Made the interpreter pass most of the mycology test suite --- pkg/pointer/stack.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pkg/pointer/stack.go') diff --git a/pkg/pointer/stack.go b/pkg/pointer/stack.go index 1832dbb..ba51c7c 100644 --- a/pkg/pointer/stack.go +++ b/pkg/pointer/stack.go @@ -23,6 +23,9 @@ func (s *Stack) Clear() { func (s *Stack) Duplicate() { if s.height > 0 { s.Push(s.data[s.height-1]) + } else { + s.Push(0) + s.Push(0) } } -- cgit v1.2.3