Builtin Library
README.md
procgen.reference
Replaces a section of a graph's code (a run of its statements, named by the
lines it spans) with a call of a node that already exists: how a graph adopts a
node lifted out of another graph by procgen.collapse, or swaps hand-written
calls for a library node doing the same work.
- Each input of the node takes the value the section reads under the same name
(a graph input under the name it is declared with).
inputs = { <node input> = "<code>" }wires one from any local or expression. - Each value the section makes that the code after it reads is taken from the
node's output of the same name.
outputs = { <local> = "<node output>" }says which output when the names differ. - An input the node needs that nothing wires, an input it does not take, and a value the code after the section reads that the node does not give are refused, naming what the node takes and gives.
The node is named the way a graph calls it: points.disc, its ~ path
(~/fx/Strew), its path or its guid. The graph's new source is written only
once it builds.
Part of procgen.toolbox, called as tools.use("procgen", "reference", ...) (zero procgen reference in the engine shell). Returns
{ node, call, inputs, outputs, source, diagnostics }.