MCPcopy Create free account
hub / github.com/cel-expr/cel-go / ComprehensionExpr

Interface ComprehensionExpr

common/ast/expr.go:267–305  ·  view source on GitHub ↗

ComprehensionExpr defines an interface for inspecting a comprehension expression.

Source from the content-addressed store, hash-verified

265
266// ComprehensionExpr defines an interface for inspecting a comprehension expression.
267type ComprehensionExpr interface {
268 // IterRange returns the iteration range expression.
269 IterRange() Expr
270
271 // IterVar returns the iteration variable name.
272 //
273 // For one-variable comprehensions, the iter var refers to the element value
274 // when iterating over a list, or the map key when iterating over a map.
275 //
276 // For two-variable comprehneions, the iter var refers to the list index or the
277 // map key.
278 IterVar() string
279
280 // IterVar2 returns the second iteration variable name.
281 //
282 // When the value is non-empty, the comprehension is a two-variable comprehension.
283 IterVar2() string
284
285 // HasIterVar2 returns true if the second iteration variable is non-empty.
286 HasIterVar2() bool
287
288 // AccuVar returns the accumulation variable name.
289 AccuVar() string
290
291 // AccuInit returns the accumulation variable initialization expression.
292 AccuInit() Expr
293
294 // LoopCondition returns the loop condition expression.
295 LoopCondition() Expr
296
297 // LoopStep returns the loop step expression.
298 LoopStep() Expr
299
300 // Result returns the comprehension result expression.
301 Result() Expr
302
303 // marker interface method
304 isExpr()
305}
306
307var _ Expr = &expr{}
308

Callers 70

VisitExprMethod · 0.65
TestPruneFunction · 0.65
planComprehensionMethod · 0.65
pruneMethod · 0.65
visitFunction · 0.65
costComprehensionMethod · 0.65
isBindMethod · 0.65
costBindMethod · 0.65
planComprehensionMethod · 0.65
pruneMethod · 0.65
costComprehensionMethod · 0.65
checkComprehensionMethod · 0.65

Implementers 1

baseComprehensionExprcommon/ast/expr.go

Calls

no outgoing calls

Tested by

no test coverage detected