[ruby-cvs:68220] yui-knk:r61039 (trunk): parse.y: Fix the first location of heredoc identifier

yui-knk at ruby-lang.org yui-knk at ruby-lang.org
Wed Dec 6 12:09:55 JST 2017


yui-knk	2017-12-06 12:09:55 +0900 (Wed, 06 Dec 2017)

  New Revision: 61039

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

  Log:
    parse.y: Fix the first location of heredoc identifier
    
    * parse.y (parser_heredoc_identifier):
      Put length of term at the head of rb_strterm_heredoc_struct.term.
    
    * parse.y (rb_parser_set_location_from_strterm_heredoc):
      Use length of term to calculate first_loc.column.
    
      e.g. The locations of the NODE_DSTR is fixed:
    
      ```
      a <<STR
      123
      #{:a}
      STR
      ```
    
      * Before
    
      ```
      NODE_DSTR (line: 3, code_range: (1,3)-(1,7))
      ```
    
      * After
    
      ```
      NODE_DSTR (line: 3, code_range: (1,2)-(1,7))
      ```

  Modified files:
    trunk/parse.y


More information about the ruby-cvs mailing list