Rewriting the Ruby parser
It's not true "the best chance you have is reading the 14 thousand-line parse.y file and trying to understand it", there are several tools to navigate yacc/bnf style grammars like <a href="https://www.bottlecaps.de/convert/" rel="nofollow noreferrer">https://www.bottlecaps.de/convert/</a> and it's companion <a href="https://www.bottlecaps.de/convert/" rel="nofollow noreferrer">https://www.bottlecaps.de/convert/</a> that make relatively easy to understand/document/debug/compare the grammar.<p>Just added several ruby grammars here <a href="https://github.com/mingodad/plgh/tree/main/ruby">https://github.com/mingodad/plgh/tree/main/ruby</a> they are converted (mainly using <a href="https://www.bottlecaps.de/convert/" rel="nofollow noreferrer">https://www.bottlecaps.de/convert/</a>) to an EBNF understood by <a href="https://bottlecaps.de/rr/ui" rel="nofollow noreferrer">https://bottlecaps.de/rr/ui</a> to generate navigable railroad diagrams.<p>Copy and paste the EBNF on <a href="https://www.bottlecaps.de/rr/ui" rel="nofollow noreferrer">https://www.bottlecaps.de/rr/ui</a> on the tab "Edit Grammar" the click on the tab "View Diagram" to see/download a navigable railroad diagram.