Exmbus.Parser.Context (Exmbus v0.3.0)

View Source

Parsing context, accumulating errors and layers.

Summary

Functions

Add an error to the context and return the updated context.

Add a warning to the context and return the updated context.

Append additional handlers to the context.

Return the list of default handlers.

Apply the context to the next handler in the list.

Merge options with the existing options in the context.

Create a new context with default handlers, and merge the given attributes into the context.

Prepend additional handlers to the context.

Types

t()

@type t() :: %Exmbus.Parser.Context{
  apl: any(),
  bin: binary() | nil,
  dib: any(),
  dll: any(),
  ell: any(),
  errors: [any()],
  handler: term(),
  handlers: term(),
  opts: map(),
  tpl: any(),
  vib: any(),
  warnings: term()
}

Functions

add_error(ctx, error)

Add an error to the context and return the updated context.

add_warning(ctx, warning)

Add a warning to the context and return the updated context.

append_handlers(ctx, handlers)

Append additional handlers to the context.

default_handlers()

Return the list of default handlers.

handle(ctx)

Apply the context to the next handler in the list.

merge_opts(ctx, opts)

Merge options with the existing options in the context.

new(attrs \\ [])

Create a new context with default handlers, and merge the given attributes into the context.

prepend_handlers(ctx, handlers)

Prepend additional handlers to the context.

Prepending handlers will make the given handlers run before the existing handlers.