DbgMate.Backport (dbg_mate v0.1.2)

This module includes features that will be enabled in elixir 1.18, plus a commit for with that was not merged.

Backport module currently includes dbg implementation for:

  • pipes
  • binary operators: and, or, ||, &&
  • code blocks wrapped in brackets
  • conditions: case, cond, if, unless, with

To use it just set the config value in config or run this before your dbg call

config :elixir, :dbg_callback, {DbgMate,Backport, :dbg, []})

Summary

Types

The inputs of a macro

The output of a macro

t()

Abstract Syntax Tree (AST)

Types

Link to this type

captured_remote_function()

@type captured_remote_function() :: (... -> any())
@type input() ::
  input_expr() | {input(), input()} | [input()] | atom() | number() | binary()

The inputs of a macro

@type metadata() :: keyword()
@type output() ::
  output_expr()
  | {output(), output()}
  | [output()]
  | atom()
  | number()
  | binary()
  | captured_remote_function()
  | pid()

The output of a macro

@type t() :: input()

Abstract Syntax Tree (AST)

Functions

Link to this function

dbg(code, options, env)

(since 1.14.0)
@spec dbg(t(), t(), Macro.Env.t()) :: t()

Default backend for Kernel.dbg/2.

This function provides a default backend for Kernel.dbg/2. See the Kernel.dbg/2 documentation for more information.

This function:

  • prints information about the given env
  • prints information about code and its returned value (using opts to inspect terms)
  • returns the value returned by evaluating code

You can call this function directly to build Kernel.dbg/2 backends that fall back to this function.

This function raises if the context of the given env is :match or :guard.