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))

A CEL type

pub type Type {
  DynamicT
  ListT(Type)
  MapT(Type, Type)
  FunctionT(Type, List(Type))
  IntT
  UIntT
  FloatT
  StringT
  BytesT
  BoolT
  NullT
}

Constructors

  • DynamicT
  • ListT(Type)
  • MapT(Type, Type)
  • FunctionT(Type, List(Type))
  • IntT
  • UIntT
  • FloatT
  • StringT
  • BytesT
  • BoolT
  • NullT

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.

pub fn variables(map: ReferenceMap) -> List(List(String))

Lists all the variables in the reference map

Search Document