Skip to content

ExprFactory

ExprFactory mirrors the cel-go construction seams for AST values.

accuIdent(id): Expr

AccuIdent creates an Expr value representing an accumulator identifier within a comprehension.

number

Expr


accuIdentName(): string

AccuIdentName reports the accumulator variable name to be used within a comprehension.

string


call(id, fn, …args): Expr

Call creates an Expr value representing a global function call.

number

string

…Expr[]

Expr


comprehension(id, iterRange, iterVar, accuVar, accuInit, loopCondition, loopStep, result): Expr

Comprehension creates an Expr value representing a one-variable comprehension over a value range.

number

Expr

string

string

Expr

Expr

Expr

Expr

Expr


comprehensionTwoVar(id, iterRange, iterVar, iterVar2, accuVar, accuInit, loopCondition, loopStep, result): Expr

ComprehensionTwoVar creates an Expr value representing a two-variable comprehension over a value range.

number

Expr

string

string

string

Expr

Expr

Expr

Expr

Expr


copyEntryExpr(entry): EntryExpr

CopyEntryExpr creates a deep copy of the input EntryExpr value.

EntryExpr

EntryExpr


copyExpr(expr): Expr

CopyExpr creates a deep copy of the input Expr value.

Expr

Expr


ident(id, name): Expr

Ident creates an Expr value representing an identifier.

number

string

Expr


list(id, elems, optionalIndices): Expr

List creates an Expr value representing a list literal expression with optional indices.

Optional indices will typically be empty unless CEL optional types are enabled.

number

Expr[]

number[]

Expr


literal(id, value): Expr

Literal creates an Expr value representing a literal value, such as a string or integer.

number

ConstantValue

Expr


map(id, entries): Expr

Map creates an Expr value representing a map literal expression.

number

EntryExpr[]

Expr


mapEntry(id, key, value, optional): EntryExpr

MapEntry creates a MapEntry with a given key, value, and a flag indicating whether the key is optionally set.

number

Expr

Expr

boolean

EntryExpr


memberCall(id, fn, receiver, …args): Expr

MemberCall creates an Expr value representing a member function call.

number

string

Expr

…Expr[]

Expr


presenceTest(id, operand, field): Expr

PresenceTest creates an Expr representing a field presence test on an operand expression.

number

Expr

string

Expr


select(id, operand, field): Expr

Select creates an Expr representing a field selection on an operand expression.

number

Expr

string

Expr


struct(id, typeName, fields): Expr

Struct creates an Expr value representing a struct literal with a given type name and a set of field initializers.

number

string

EntryExpr[]

Expr


structField(id, field, value, optional): EntryExpr

StructField creates a StructField with a given field name, value, and a flag indicating whether the field is optionally set.

number

string

Expr

boolean

EntryExpr


unspecified(id): Expr

Unspecified creates an empty expression node.

number

Expr