[ruby-cvs:68218] yui-knk:r61037 (trunk): parse.y: Fix locations of HEREDOC

yui-knk at ruby-lang.org yui-knk at ruby-lang.org
Wed Dec 6 09:44:18 JST 2017


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

  New Revision: 61037

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

  Log:
    parse.y: Fix locations of HEREDOC
    
    * parse.y (rb_parser_set_location_from_strterm_heredoc):
      Set locations based on rb_strterm_heredoc_t.
    
    * parse.y (yylex): Set yylloc based on rb_strterm_heredoc_t
      when parsing heredoc.
    
      e.g. The locations of the NODE_DSTR is changed:
    
      ```
      a <<STR
      123
      #{:a}
      STR
      ```
    
      * Before
    
      ```
      NODE_DSTR (line: 3, code_range: (3,0)-(1,7))
      ```
    
      * After
    
      ```
      NODE_DSTR (line: 3, code_range: (1,3)-(1,7))
      ```

  Modified files:
    trunk/parse.y


More information about the ruby-cvs mailing list