Syntax Tree
summary
Syntax Tree is a concrete Ruby object layer that takes Ripper output and builds an immutable AST (about 162 nodes), provides a formatter powered by a prettier printer and a new prettier_print gem, a CLI with match/search pattern tools, and a working language server for format-on-save. It translates to other ASTs (ruby_parser, Whitequark) and even to YARV bytecode, supports visitor-based mutation for codemods, and already runs as a usable formatter and LSP implementation.
AI-written summary · about
chapters (15)
- 0:00Syntax Tree project intro
- 2:18What is a parser
- 3:43Building syntax trees
- 6:30Visitor pattern explained
- 9:20Syntax Tree project features
- 10:22Ruby syntax tree
- 12:30Ripper syntax trees
- 14:55Handling Ruby comments
- 15:57Inspecting syntax trees
- 17:01Pretty printing algorithms
- 20:30CLI tools
- 22:15Language server integration
- 24:00Translating syntax trees
- 26:49Use cases and plans
- 27:11Q&A
related talks
52mTreetop: Syntactic Analysis with Ruby
39mTree-sitter - a new parsing system for programming tools
29mAST: the Secret Weapon to Transform a Codebase
32mParsing Ruby
27mSwiftSyntax: for good and evil
51mForbidden Fruit: A Test of Ruby's Parse Tree
43mGrammars, Parsers, and Interpreters, In Ruby
29mMy Little Parser: Tooling is Magic
