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(Expression, BinaryOp, Expression)
  Unary(UnaryOp, Expression)
  Ternary(Expression, Expression, Expression)
  List(List(Expression))
  Map(List(#(Expression, Expression)))
  Member(Expression, Member)
  FunctionCall(
    String,
    option.Option(Expression),
    List(Expression),
  )
  Atom(Atom)
  Ident(String)
}

Constructors

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

Constructors

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

Constructors

  • Attribute(String)
  • Index(Expression)
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 parse(source: String) -> Result(Expression, Error)
Search Document