RNode with code positions
summary
Ruby 2.5 adds precise position data so AST nodes record start/end column as well as line numbers enabling exact branch coverage, finer warnings and better Proc#source_location. Implementation touches lexer (yy_lex) to capture byte offsets, parser to thread locations into nodes, a new nd_loc field on NODE and node ids propagated into iseq so exceptions can be mapped back by reparsing. Lexer uses zero based columns and tests live in ext and xfail style test harnesses. The change lands and works in preview releases.
AI-written summary · about
chapters (13)
- 0:00Introduction
- 1:10RNode and code positions overview
- 5:57Need for code positions
- 8:11Ruby interpreter structure
- 13:25AST data structure
- 16:55Implementing code positions
- 21:53Using position data
- 25:09Commits and contributors
- 26:54Test system and rules
- 29:28Code position applications
- 33:49Ruby 2.6 extensions
- 34:32Debugging support features
- 37:13Summary and acknowledgments








