[ruby-cvs:62726] naruse:r55562 (trunk): * regcomp.c (noname_disable_map): don't optimize out group 0

naruse at ruby-lang.org naruse at ruby-lang.org
Sat Jul 2 04:37:43 JST 2016


naruse	2016-07-02 04:37:43 +0900 (Sat, 02 Jul 2016)

  New Revision: 55562

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55562

  Log:
    * regcomp.c (noname_disable_map): don't optimize out group 0
      Ruby's Regexp doesn't allow normal numbered groups if the regexp
      has named groups. On such case it optimizes out related NT_ENCLOSE.
      But even on the case it can use \g<0>.
      This fix not to remove NT_ENCLOSE whose regnum is 0.
      [ruby-core:75828] [Bug #12454]

  Modified files:
    trunk/ChangeLog
    trunk/regcomp.c
    trunk/test/ruby/test_regexp.rb


More information about the ruby-cvs mailing list