summaryrefslogtreecommitdiff
path: root/parser/decl.go
diff options
context:
space:
mode:
authorMarc Vertes <mvertes@free.fr>2026-01-27 16:37:02 +0100
committerMarc Vertes <mvertes@free.fr>2026-01-27 16:37:02 +0100
commit60f6ebc8d8369721e105d826145af2b8856ac67e (patch)
tree002073b75edc68aba95399db89f50b24ebb6935f /parser/decl.go
parentaa5861917ac2543f85bf4cfefbb69cf501d4de41 (diff)
fix: improve multiple define
The VM Vassign instruction now takes an argument to indicates the number of assignations to perform on the stack. Definitions with a function returning multiple values now work. There is still some simplifications, and also to apply the same strategy to var declarations with assign.
Diffstat (limited to 'parser/decl.go')
-rw-r--r--parser/decl.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/parser/decl.go b/parser/decl.go
index 378eb56..0ba0075 100644
--- a/parser/decl.go
+++ b/parser/decl.go
@@ -358,7 +358,7 @@ func (p *Parser) parseVarLine(in Tokens) (out Tokens, err error) {
}
out = append(out, newIdent(vars[i], 0))
out = append(out, v...)
- out = append(out, newToken(lang.Assign, "", 0))
+ out = append(out, newToken(lang.Assign, "", 0, 1))
}
return out, err
}