Pathex.Common (Pathex v1.3.0) View Source

Util functions for working with AST in Pathex Shared among all Pathex projects

Link to this section Summary

Functions

Creates clause which matches index-th element in list with inner variable

Pinns variable for matchings

This functions puts generated: true flag in meta for every node in AST to avoid raising errors for dead code and stuff

Creates case from list of clauses

Link to this section Functions

Link to this function

list_match(index, inner \\ {:x, [], Elixir})

View Source

Specs

list_match(non_neg_integer(), Macro.t()) :: Macro.t()

Creates clause which matches index-th element in list with inner variable

Specs

pin(Macro.t()) :: Macro.t()

Pinns variable for matchings

Specs

set_generated(Macro.t()) :: Macro.t()

This functions puts generated: true flag in meta for every node in AST to avoid raising errors for dead code and stuff

Specs

to_case([Macro.t()]) :: Macro.t()

Creates case from list of clauses