Hacking parse.y
summary
Patch edits parse.y in MRI 1.9.2 and touches a ~10,000+ line parser to add concrete syntax: added ++ operator, hash association as emoticon-style :=, and new symbol quoting. Changes are C and yacc/lex patches that regenerate token tables; building Ruby on stage repeatedly stalls and once segfaults, so demos are flaky. The claim is implementable but invasive: parsing states and lexer transitions change, tests and make install sometimes fail.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 3:18Ruby parse.y basics
- 9:03Colon syntax states
- 13:37parse.y source structure
- 20:53New symbol syntax
- 30:29Unary plus operators
- 35:53Incremental ++ operator
- 41:02Hash emoticon syntax
- 46:51No post-increment in Ruby
- 51:38Conclusion
related talks
32mParsing Ruby
32mTime flies like an arrow; Fruit flies like a banana: Parsers for Great Good
43mGrammars, Parsers, and Interpreters, In Ruby
27mGenerate Parsers! Prevent Exploits!
32mRuby Macros
30mGarnet.js: Implementing the YARV Virtual Machine
26mLiberating Ruby's Parser from Lexer Hacks
33mRuby the Hard Way: Writing Bytecode to Optimize Plain Ruby
