cel/parser

Types

pub type Arithmetic {
  Add
  Sub
  Mul
  Div
  Mod
}

Constructors

  • Add
  • Sub
  • Mul
  • Div
  • Mod
pub type Atom {
  Int(Int)
  UInt(Int)
  Float(Float)
  String(String)
  Bytes(BitArray)
  Bool(Bool)
  Null
}

Constructors

  • Int(Int)
  • UInt(Int)
  • Float(Float)
  • String(String)
  • Bytes(BitArray)
  • Bool(Bool)
  • Null
pub type BinaryOp {
  Arithmetic(Arithmetic)
  Relation(Relation)
  Logical(Logical)
}

Constructors

  • Arithmetic(Arithmetic)
  • Relation(Relation)
  • Logical(Logical)
pub type Error {
  UnexpectedEndOfFile
  UnexpectedSourceStr(String, Int)
  UnexpectedToken(t.Token, Int)
  DeadEnd(Tokens)
}

Constructors

  • UnexpectedEndOfFile
  • UnexpectedSourceStr(String, Int)
  • UnexpectedToken(t.Token, Int)
  • DeadEnd(Tokens)
pub type Expression {
  BinaryOperation(ExpressionData, BinaryOp, ExpressionData)
  Unary(UnaryOp, ExpressionData)
  Ternary(ExpressionData, ExpressionData, ExpressionData)
  List(List(ExpressionData))
  Map(List(#(ExpressionData, ExpressionData)))
  Member(ExpressionData, Member)
  FunctionCall(
    String,
    option.Option(ExpressionData),
    List(ExpressionData),
  )
  Atom(Atom)
  Ident(String)
}

Constructors

  • BinaryOperation(ExpressionData, BinaryOp, ExpressionData)
  • Unary(UnaryOp, ExpressionData)
  • Ternary(ExpressionData, ExpressionData, ExpressionData)
  • List(List(ExpressionData))
  • Map(List(#(ExpressionData, ExpressionData)))
  • Member(ExpressionData, Member)
  • FunctionCall(
      String,
      option.Option(ExpressionData),
      List(ExpressionData),
    )
  • Atom(Atom)
  • Ident(String)
pub opaque type ExpressionData
pub type Logical {
  And
  Or
}

Constructors

  • And
  • Or
pub type Member {
  Attribute(String)
  Index(ExpressionData)
}

Constructors

  • Attribute(String)
  • Index(ExpressionData)
pub type Relation {
  LessThan
  LessThanEq
  GreaterThan
  GreaterThanEq
  Equals
  NotEquals
  In
}

Constructors

  • LessThan
  • LessThanEq
  • GreaterThan
  • GreaterThanEq
  • Equals
  • NotEquals
  • In
pub type UnaryOp {
  Not
  UnarySub
}

Constructors

  • Not
  • UnarySub

Functions

pub fn expr(data: ExpressionData) -> Expression
pub fn id(data: ExpressionData) -> Int
pub fn parse(source: String) -> Result(ExpressionData, Error)
pub fn with_id(expr: Expression, id: Int) -> ExpressionData

You probably don’t want to use this. Only used for testing

Search Document