NewFuncall returns an expression representing a function call.
(token int, op string, oprd ExprList)
| 162 | |
| 163 | // NewFuncall returns an expression representing a function call. |
| 164 | func NewFuncall(token int, op string, oprd ExprList) (*Expr, error) { |
| 165 | fn, e := NewLiteral(token, op) |
| 166 | if e != nil { |
| 167 | return nil, e |
| 168 | } |
| 169 | return &Expr{ |
| 170 | sexp: append(ExprList{fn}, oprd...), |
| 171 | funcall: true, |
| 172 | }, nil |
| 173 | } |
| 174 | |
| 175 | func (e *Expr) String() string { |
| 176 | if !e.IsLiteral() { /* a compound expression */ |