Proton v0.1.0 Proton.Expander

Functions relating to the expansion of references in source specs. expand(spec data) -> [specdata, specdata…]

Link to this section Summary

Functions

Convert a node path into a nested list(s) of spec literals (i.e., maps), to be flattened/merged elsewhere

Link to this section Functions

Link to this function expand!(path, resolver, current_paths \\ [])
Link to this function expand(path, resolver, current_paths \\ [])

Convert a node path into a nested list(s) of spec literals (i.e., maps), to be flattened/merged elsewhere.

Parameters

  • path: A path to another node of the same type
  • resolver: A function from a path to that node’s spec data; this abstracts both the type of the node (which is necessary knowledge for parsing its path) and the actual, material cache itself.
  • current_paths: a list of the paths we are currently expanding; we prevent infinite loops by bailing if our own path is included here.