Celixir.Lexer (Celixir v0.2.0)

Copy Markdown View Source

Tokenizer for the Common Expression Language. Converts a CEL source string into a list of tokens.

Summary

Types

token()

@type token() :: {token_type(), any(), pos_integer()}

token_type()

@type token_type() ::
  :int
  | :uint
  | :float
  | :string
  | :bytes
  | true
  | false
  | :null
  | :ident
  | :in
  | :plus
  | :minus
  | :star
  | :slash
  | :percent
  | :eq
  | :neq
  | :lt
  | :lte
  | :gt
  | :gte
  | :and
  | :or
  | :not
  | :question
  | :colon
  | :dot
  | :comma
  | :lparen
  | :rparen
  | :lbracket
  | :rbracket
  | :lbrace
  | :rbrace
  | :eof

Functions

tokenize(input)

@spec tokenize(String.t()) :: {:ok, [token()]} | {:error, String.t()}