[ruby-cvs:68050] yui-knk:r60869 (trunk): parse.y: Fix the locations of NODE in percent strings

yui-knk at ruby-lang.org yui-knk at ruby-lang.org
Tue Nov 21 09:47:00 JST 2017


yui-knk	2017-11-21 09:47:00 +0900 (Tue, 21 Nov 2017)

  New Revision: 60869

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

  Log:
    parse.y: Fix the locations of NODE in percent strings
    
      * parse.y (parser_yylex): token_flush before
        calling parse_string. Without token_flush
        the first locations of NODE in percent strings
        are set to the location of %.
    
      e.g. The locations of NODE_STR is fixed:
    
      ```
      %w[a b]
      ```
    
      * Before
    
      ```
      NODE_STR (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 4) ("a")
      NODE_STR (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 6) ("b")
      ```
    
      * After
    
      ```
      NODE_STR (line: 1, first_lineno: 1, first_column: 3, last_lineno: 1, last_column: 4) ("a")
      NODE_STR (line: 1, first_lineno: 1, first_column: 5, last_lineno: 1, last_column: 6) ("b")
      ```

  Modified files:
    trunk/parse.y


More information about the ruby-cvs mailing list