Dissecting and Reconstructing Ruby Syntactic Structures
summary
Describes a concrete refactor of Ruby grammar: switching the parser generator to Ryama, adding node location info via ParseY, and introducing %rule parameterization to factor repeated BNF patterns. Claims the change reduces duplication and fixes a top-level operator-assignment ambiguity by moving arg handling into a parameterized op-assign rule. Works on master (patch merged). Surprising scale numbers: about 16,000 files in the codebase and roughly 162 terminal symbol types.
AI-written summary · about
chapters (6)
- 0:00Introduction and self-introduction
- 3:51What is grammar and syntax
- 6:53Ruby parser generators
- 11:53Ruby’s grammar structure
- 18:53Reconstructing Ruby’s grammar
- 24:13Conclusion and future work
related talks
32mParsing Ruby
46mGrammar a BNF like Ruby DSL Parsing
54mHacking parse.y
29mHow does Lrama make the Ruby parser grammar G.O.A.T.?
52mTreetop: Syntactic Analysis with Ruby
43mGrammars, Parsers, and Interpreters, In Ruby
26mLiberating Ruby's Parser from Lexer Hacks
32mTime flies like an arrow; Fruit flies like a banana: Parsers for Great Good
