diff options
Diffstat (limited to 'vendor/github.com/d5/tengo/v2/compiler.go')
-rw-r--r-- | vendor/github.com/d5/tengo/v2/compiler.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/vendor/github.com/d5/tengo/v2/compiler.go b/vendor/github.com/d5/tengo/v2/compiler.go index cb1c8f30..1937a1d6 100644 --- a/vendor/github.com/d5/tengo/v2/compiler.go +++ b/vendor/github.com/d5/tengo/v2/compiler.go @@ -506,7 +506,11 @@ func (c *Compiler) Compile(node parser.Node) error { return err } } - c.emit(node, parser.OpCall, len(node.Args)) + ellipsis := 0 + if node.Ellipsis.IsValid() { + ellipsis = 1 + } + c.emit(node, parser.OpCall, len(node.Args), ellipsis) case *parser.ImportExpr: if node.ModuleName == "" { return c.errorf(node, "empty module name") @@ -526,7 +530,7 @@ func (c *Compiler) Compile(node parser.Node) error { return err } c.emit(node, parser.OpConstant, c.addConstant(compiled)) - c.emit(node, parser.OpCall, 0) + c.emit(node, parser.OpCall, 0, 0) case Object: // builtin module c.emit(node, parser.OpConstant, c.addConstant(v)) default: @@ -556,7 +560,7 @@ func (c *Compiler) Compile(node parser.Node) error { return err } c.emit(node, parser.OpConstant, c.addConstant(compiled)) - c.emit(node, parser.OpCall, 0) + c.emit(node, parser.OpCall, 0, 0) } else { return c.errorf(node, "module '%s' not found", node.ModuleName) } |