[ruby-cvs:67995] yui-knk:r60814 (trunk): Fix location of NODEs generated by new_op_assign_gen

yui-knk at ruby-lang.org yui-knk at ruby-lang.org
Fri Nov 17 08:13:24 JST 2017


yui-knk	2017-11-17 08:13:24 +0900 (Fri, 17 Nov 2017)

  New Revision: 60814

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

  Log:
    Fix location of NODEs generated by new_op_assign_gen
    
    * parse.y (new_op_assign_gen): Use a location of lhs
      when call gettable, bacause gettable creates a variable
      node. Use a location of rhs when call new_list,
      because item of new_list is rhs.
    
      The locations of NODE_DVAR(nd_vid: :a) and NODE_ARRAY
      are fixed:
    
      ```
      a -= 1
      ```
    
      * Before
    
      ```
      NODE_DVAR (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 6)
      NODE_ARRAY (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 6)
      ```
    
      * After
    
      ```
      NODE_DVAR (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 1)
      NODE_ARRAY (line: 1, first_lineno: 1, first_column: 5, last_lineno: 1, last_column: 6)
      ```

  Modified files:
    trunk/parse.y


More information about the ruby-cvs mailing list