This is a somewhat less naive patch than my previous attempt, and this one appears to work well enough for Rails to continue. It basically just looks through the iter stack (which specifies whether blocks are about to be or currently are being executed) and if it finds an ITER_CUR, meaning a block is being run, it adds the topmost dynamic variables to the RubyParserConfiguration. This in turn is used by ParserSupport to appropriately create nodes for variables, either DVar/DAsgn if within a block or LocalVar/LocalAsgn if not.
The patch is naive because it does not accurately set the "current block count" in ParserSupport, and it may be over-inclusive by doing a linear search of the iter stack. I'm not sure if it's perfect, but it works and hasn't broken anything... With this, Rails gets quite a bit further. I'll send another email updating that. -- Charles Oliver Nutter @ headius.blogspot.com JRuby Developer @ jruby.sourceforge.net Application Architect @ www.ventera.com
runtime_parse_block_scoping.patch
Description: Binary data
