ExGram.Macros.Helpers (ex_gram v0.65.0)

Copy Markdown View Source

Helpers for the ExGram.Macros module

Summary

Functions

analyze_params(params)

Entry point for all the macros that has parameters (model + method).

It analyzed the AST and return the list of params with the following format:

  • For mandatory parameters: [name, types, description]
  • For optional parameters: [name, types, description, :optional]

All the other methods in this module that deal with parameters expect this format.

file_parameters(analyzed)

mandatory_parameters(analyzed)

mandatory_type_specs(analyzed)

mandatory_value_type(analyzed)

optional_parameters(analyzed)

optional_type_specs(analyzed)

params_descriptions(params)

params_to_decode_as(params)

struct_type_specs(initial)

struct_type_specs(arg1, acc)

type_to_spec(f)