summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/d5/tengo/v2/parser/expr.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/d5/tengo/v2/parser/expr.go')
-rw-r--r--vendor/github.com/d5/tengo/v2/parser/expr.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/vendor/github.com/d5/tengo/v2/parser/expr.go b/vendor/github.com/d5/tengo/v2/parser/expr.go
index 71e5155b..b6b6c62b 100644
--- a/vendor/github.com/d5/tengo/v2/parser/expr.go
+++ b/vendor/github.com/d5/tengo/v2/parser/expr.go
@@ -111,10 +111,11 @@ func (e *BoolLit) String() string {
// CallExpr represents a function call expression.
type CallExpr struct {
- Func Expr
- LParen Pos
- Args []Expr
- RParen Pos
+ Func Expr
+ LParen Pos
+ Args []Expr
+ Ellipsis Pos
+ RParen Pos
}
func (e *CallExpr) exprNode() {}
@@ -134,6 +135,9 @@ func (e *CallExpr) String() string {
for _, e := range e.Args {
args = append(args, e.String())
}
+ if len(args) > 0 && e.Ellipsis.IsValid() {
+ args[len(args)-1] = args[len(args)-1] + "..."
+ }
return e.Func.String() + "(" + strings.Join(args, ", ") + ")"
}