-
-
Notifications
You must be signed in to change notification settings - Fork 163
Lossless Syntax Tree Pattern
andychu edited this page Feb 13, 2017
·
37 revisions
Hacker News Comments on "From AST to Lossless Syntax Tree"
- RedBaron: Full Syntax Tree
- Go: AST
- Roslyn: Syntax Tree
- Red-Green Trees? TODO: read this
-
Roslyn -- Microsoft's C# compiler platform
-
Haskell GHC AST Annotations -- Simplify the roundtripping and modification of source by explicitly capturing the missing location information for the syntactic markers
-
Making Tools Kythe-Compatible -- I would have thought that Kythe had the LST concept, because it's basically an IDE, but I don't see it. I guess that is because it's read-only?
-
What to do about comments? on Lambda the Ultimate
- 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.
TODO: What data structures do these use?
- clang-format -- Clang AST, which is huge
- http://clang.llvm.org/docs/LibFormat.html -- design is undocumented
- gofmt -- uses the Go AST package, which is reputed to be messy
- dartfmt -- The Hardest Program I've Ever Written
- yapf for Python
- scalafmt
- prettier for JavaScript
- rustfmt Design -- Blog Post
These don't need to use the Lossless Syntax Tree because the resulting code won't be edited by a human.
- CoffeeScript, etc.