| 275 | } |
| 276 | |
| 277 | func matchIsConstantValue(e NavigableExpr) bool { |
| 278 | if e.Kind() == LiteralKind { |
| 279 | return true |
| 280 | } |
| 281 | if e.Kind() == StructKind || e.Kind() == MapKind || e.Kind() == ListKind { |
| 282 | for _, child := range e.Children() { |
| 283 | if !matchIsConstantValue(child) { |
| 284 | return false |
| 285 | } |
| 286 | } |
| 287 | return true |
| 288 | } |
| 289 | return false |
| 290 | } |
| 291 | |
| 292 | func newNavigableExpr(ast *AST, parent NavigableExpr, expr Expr, depth int) NavigableExpr { |
| 293 | // Reduce navigable expression nesting by unwrapping the embedded Expr value. |