Liquex.Context (liquex v0.7.0) View Source

Stores contextual information for the parser

Link to this section Summary

Functions

Assign a new variable to the context

Create a new Context using predefined variables map

Assign an error to the error logs

Link to this section Types

Specs

t() :: %Liquex.Context{
  cycles: map(),
  errors: [Liquex.Error.t()],
  filter_module: module(),
  private: map(),
  render_module: module() | nil,
  variables: map()
}

Link to this section Functions

Link to this function

assign(context, key, value)

View Source

Specs

assign(t(), String.t() | atom(), any()) :: t()

Assign a new variable to the context

Set a variable named key with the given value in the current context

Link to this function

new(variables, opts \\ [])

View Source

Specs

new(map(), Keyword.t()) :: t()

Create a new Context using predefined variables map

Returns a new, initialized context object

Link to this function

push_error(context, error)

View Source

Specs

push_error(t(), struct()) :: t()

Assign an error to the error logs