cel/interpreter/type_
Types
A reference in an expression
pub type Reference {
Constant(value: Value)
Variable(name: List(String))
Call(name: String)
}
Constructors
-
Constant(value: Value)
A constant in an expression
-
Variable(name: List(String))
The fully qualified name of the variable as a list
-
Call(name: String)
The fully qualified name of the function as a list
A [ReferenceMap
] contains references to constants, variables, and function calls of
an expression. Each reference is stored by their Expression ID as the key.
pub type ReferenceMap {
ReferenceMap(dict.Dict(Int, Reference))
}
Constructors
-
ReferenceMap(dict.Dict(Int, Reference))
Functions
pub fn functions(map: ReferenceMap) -> List(String)
Lists all the functions in the reference map
pub fn kind(value: Value) -> Type
Get the kind of type of a value. Will be the same as types for primitive types.
For collections, the inner type(s) will be set to [DynamicT
]
pub fn references(expr: ExpressionData) -> ReferenceMap
Collects all constants, variables and functions used in an expression along with their expression ID into a reference map.