MockeryExtras.MacroX (Mockery Extras v0.3.1) View Source

Link to this section Summary

Functions

A function that takes two forms of function call and returns their constitutent parts. The forms are syntax trees (typically given to a macro that uses the results of this function.)

Link to this section Functions

Link to this function

alias_to_module(the_alias, env)

View Source
Link to this function

decompose_call_alt(funcall)

View Source

A function that takes two forms of function call and returns their constitutent parts. The forms are syntax trees (typically given to a macro that uses the results of this function.)

  1. The first form is like Module.function(1, 2, 3). In this case, the following structure is returned:

     {:in_named_module, Module, [function: 3], [1, 2, 3]}

    The module part of the function call may be multi-part, like Module.Submodule. That's what will appear in the second tuple position. The module may be the use of an alias, like alias Module.Submodule, as: S. In that case, the alias (S) will appear in the second position.

  2. The second form has no module component, like function(1, 2, 3), which returns:

     {:in_calling_module, :use__MODULE__, [function: 3], [1, 2, 3]}

    This value signals that the caller must supply the module. If the caller is a macro, it will probably use __MODULE__.

Any other form will raise RuntimeError.