IsConst returns whether the expression is constant. A constant expression does not contain variables, as defined by ContainsVars, nor impure functions.
(evalCtx *EvalContext, expr Expr)
| 844 | // IsConst returns whether the expression is constant. A constant expression |
| 845 | // does not contain variables, as defined by ContainsVars, nor impure functions. |
| 846 | func IsConst(evalCtx *EvalContext, expr Expr) bool { |
| 847 | v := isConstVisitor{ctx: evalCtx} |
| 848 | return v.run(expr) |
| 849 | } |
| 850 | |
| 851 | // fastIsConstVisitor is similar to isConstVisitor, but it only visits |
| 852 | // at most two levels of the tree (with one exception, see below). |
no test coverage detected
searching dependent graphs…