diff options
| author | Marc Vertes <mvertes@free.fr> | 2026-01-23 13:05:10 +0100 |
|---|---|---|
| committer | Marc Vertes <mvertes@free.fr> | 2026-01-23 13:05:10 +0100 |
| commit | 3113c7f058e427c49e936f82a518766ddb869c58 (patch) | |
| tree | b79e34e358514d1e0301722251cce3b195043670 /comp/compiler.go | |
| parent | 2837dabf7818666a9366d659d2da3b9055140740 (diff) | |
feat: add Next2 and Pull2 instructions in vm.
These will be used for range clause assigning both key and value.
Diffstat (limited to 'comp/compiler.go')
| -rw-r--r-- | comp/compiler.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/comp/compiler.go b/comp/compiler.go index ef379ea..4817914 100644 --- a/comp/compiler.go +++ b/comp/compiler.go @@ -128,7 +128,6 @@ func (c *Compiler) Generate(tokens parser.Tokens) (err error) { c.emit(t, vm.Deref) case lang.Index: - showStack(stack) pop() s := pop() if s.Type.Rtype.Kind() == reflect.Map { @@ -361,7 +360,6 @@ func (c *Compiler) Generate(tokens parser.Tokens) (err error) { if len(stack) < 1 { return errorf("missing symbol") } - showStack(stack) s := pop() switch s.Kind { case symbol.Pkg: @@ -419,6 +417,7 @@ func (c *Compiler) Generate(tokens parser.Tokens) (err error) { c.emit(t, vm.Next, i, k.Index) case lang.Range: + showStack(stack) // FIXME: handle all iterator types. // set the correct type to the iterator variables. switch t := top().Type; t.Rtype.Kind() { |
