Skip to content

Transformation process

icefapper edited this page Feb 11, 2017 · 1 revision

Transformation is the stage during which the higher-level constructs (destructuring assignments, for example) are broken into constructs that can be directly emitted in the target language. Transformation done a node differs based on the following criteria:

  • if the node has no yield in it, then
    • if it is inside a yield container, it will be transformed with that YC as its push target,
    • otherwise it is transformed with a null push target
  • if it has a yield any where in it, then
    • if there is a dedicated transformer for transforming the node when it has a yield in it, that transformer is used, and the yield container that the node is in is used as the push target,
    • otherwise it is transformed using the existing transformer, with the current yield container serving as the push target