IsVariadic returns true if the expression is a list "[...]".
()
| 85 | |
| 86 | // IsVariadic returns true if the expression is a list "[...]". |
| 87 | func (e Expr) IsVariadic() bool { |
| 88 | return !e.IsLiteral() && !e.IsFuncall() && len(e.sexp) > 0 && |
| 89 | (e.sexp[0].token == '[' || e.sexp[0].token == '(') |
| 90 | } |
| 91 | |
| 92 | // IsUnary returns true if e is a binary expression. |
| 93 | func (e Expr) IsUnary() bool { |