Skip to content

Lossless Syntax Tree Pattern

andychu edited this page Feb 13, 2017 · 37 revisions

Hacker News Comments on "From AST to Lossless Syntax Tree"

Other Names

  • RedBaron: Full Syntax Tree
  • Go: AST
  • Roslyn: Syntax Tree

Relevant Docs / Designs / Discussions

Style-Preserving Source Translators

  • 2to3 -- for Python 2 to Python 3
  • RedBaron -- RedBaron, by relying on Baron, uses a Full Syntax Tree (FST). It’s like an AST except it keeps every information, included formatting, and is then a lossless representation of the source code.

Source Reformatters

TODO: What data structures do these use?

Transpilers

These don't need to use the Lossless Syntax Tree because the resulting code won't be edited by a human.

  • CoffeeScript, etc.
Clone this wiki locally