View Source Hologram.Compiler.Transformer (hologram v0.2.0)

Summary

Functions

Prints debug info for intercepted transform/2 calls.

Transforms Elixir AST to Hologram IR.

Functions

debug(arg, result, start_timestamp)

@spec debug(
  {module(), atom(),
   [Hologram.Compiler.AST.t() | Hologram.Compiler.Context.t()]},
  Hologram.Compiler.IR.t() | %FunctionClauseError{},
  integer()
) :: :ok

Prints debug info for intercepted transform/2 calls.

transform(ast, context)

Transforms Elixir AST to Hologram IR.

Examples

iex> ast = quote do {1, 2, 3} end
{:{}, [], [1, 2, 3]}
iex> transform(ast)
%IR.TupleType{data: [%IR.IntegerType{value: 1}, %IR.IntegerType{value: 2}, %IR.IntegerType{value: 3}]}