A parser based syntax highlighter
summary
A robust Ruby syntax highlighter called Iro gem and Iro.vim parses code with uses Ripper (the Ruby stdlib) instead of regexes so it correctly colors bizarre but valid constructs like `????::?:` and `def end(def:def def;end)end`, and recovers from broken/unfinished files. It distinguishes local variables from method calls, handles complex here-doc and nested interpolation cases, targets multiple editors via a shared backend, and reports acceptable performance on files up to ~3,000 lines.
AI-written summary · about
chapters (10)
- 0:00Introduction and background
- 2:09Existing highlighters and issues
- 8:19Problems with regex-based highlight
- 9:28Introducing Ripper-based highlighter
- 11:41Advantages of Ripper approach
- 15:53How Ripper works in practice
- 22:39Implementation details of the highlighter
- 24:50Future plans and goals
- 27:53Handling broken Ruby code
- 29:01Summary and call to action
related talks
37mRuby Parser In IRB 20th Anniversary...Now Let Time Resume
30mDropping down to The Metal™
26mThe future of Ruby documentation
28mFantastic ASTs and where to find them
27mParsing, Compiling, and Static Metaprogramming
30mGarnet.js: Implementing the YARV Virtual Machine
45mCoffeeScript for the Rubyist
33mThe Ruby Racer: Under the Hood
