Граф коммитов

1591 Коммитов

Автор SHA1 Сообщение Дата
yui-knk f9d8003c94 parse.y: Fix locations of NODE_ARRAY in NODE_BLOCK_PASS
* parse.y: Fix to only include a range of assocs.

  e.g. The locations of the NODE_ARRAY is fixed:

  ```
  m1(str: "bar", &blk)
  ```

  * Before

  ```
  NODE_ARRAY (line: 1, code_range: (1,3)-(1,19))
  ```

  * After

  ```
  NODE_ARRAY (line: 1, code_range: (1,3)-(1,13))
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-11 23:38:00 +00:00
yui-knk 2d719aef2b parse.y: Change locations of NODE_DVAR in NODE_MASGN
* parse.y: Change the last location of NODE_DVAR to
  be equal to the first location of NODE_DVAR.
  NODE_DVAR of NODE_MASGN (nd_value) is an internal variable,
  so it has no length.

  e.g. The locations of the NODE_DVAR is changed:

  ```
  a.b {|(c,d)| e}
  ```

  * Before

  ```
  NODE_DVAR (line: 1, code_range: (1,7)-(1,10))
  ```

  * After

  ```
  NODE_DVAR (line: 1, code_range: (1,7)-(1,7))
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-11 23:13:47 +00:00
yui-knk aaf309972e parse.y: Fix locations of NODE_DSTR generated by evstr2dstr_gen
* parse.y (evstr2dstr_gen): Fix to only include a range of node.

  e.g. The locations of the NODE_DSTR is fixed:

  ```
  %W[a #{b} c]
  ```

  * Before

  ```
  NODE_DSTR (line: 1, code_range: (1,3)-(1,9))
  ```

  * After

  ```
  NODE_DSTR (line: 1, code_range: (1,5)-(1,9))
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-11 02:19:43 +00:00
yui-knk ec073534ec parse.y: Remove not used argument
* parse.y (list_append_gen): location is not used.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-11 00:28:27 +00:00
yui-knk 14b6dc4c80 parse.y: Fix locations of NODE_SCOPE in NODE_MODULE
* parse.y: Fix to only include a range of bodystmt.

  e.g. The locations of the NODE_SCOPE is fixed:

  ```
  module M
    def m
    end
  end
  ```

  * Before

  ```
  NODE_SCOPE (line: 4, code_range: (1,0)-(4,3))
  ```

  * After

  ```
  NODE_SCOPE (line: 4, code_range: (1,8)-(4,3))
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-11 00:06:11 +00:00
yui-knk e038b794fe parse.y: Fix the last location of NODE_COLON2
* parse.y: Fix to only include a range from primary_value to tCONSTANT.

  e.g. The locations of the NODE_COLON2 is fixed:

  ```
  A::B ||= 1
  ```

  * Before

  ```
  NODE_COLON2 (line: 1, code_range: (1,0)-(1,10))
  ```

  * After

  ```
  NODE_COLON2 (line: 1, code_range: (1,0)-(1,4))
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-10 23:44:22 +00:00
yui-knk ad321cdea5 parse.y: Change the first location of NODE_ARRAY in NODE_DSTR (nd_next->nd_next)
* parse.y (list_append_gen): Change the first location to
  start with the location of item if new list is generated.

  e.g. The locations of the NODE_ARRAY is changed:

  ```
  "#{a}.#{b}"
  ```

  * Before

  ```
  NODE_ARRAY (line: 1, code_range: (1,0)-(1,6))
  ```

  * After

  ```
  NODE_ARRAY (line: 1, code_range: (1,5)-(1,6))
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-10 23:27:58 +00:00
yui-knk 4cfc1aa959 parse.y: Fix locations of NODE_ARRAY in NODE_ATTRASGN (nd_args)
* parse.y (arg_append_gen): Fix to only include a range of
  node2 if new list is generated.

  e.g. The locations of the NODE_ARRAY is fixed:

  ```
  x.default = 5
  ```

  * Before

  ```
  NODE_ARRAY (line: 1, code_range: (1,0)-(1,13))
  ```

  * After

  ```
  NODE_ARRAY (line: 1, code_range: (1,12)-(1,13))
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-09 13:13:58 +00:00
yui-knk 51d863e06a parse.y: Change locations of NODE_BLOCK in NODE_RESBODY (nd_body)
* parse.y: Change to only include a range from exc_var to compstmt.

  e.g. The locations of the NODE_BLOCK is changed:

  ```
  begin
    :a
  rescue E => e
    :b
  end
  ```

  * Before

  ```
  NODE_BLOCK (line: 3, code_range: (3,0)-(5,3))
  ```

  * After

  ```
  NODE_BLOCK (line: 3, code_range: (3,9)-(4,4))
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-09 09:44:03 +00:00
yui-knk 7a79d88161 parse.y: Fix locations of NODE_SCOPE in NODE_SCLASS
* parse.y: Fix to only include a range of bodystmt.

  e.g. The locations of the NODE_SCOPE is fixed:

  ```
  class << []
    def m; end
  end
  ```

  * Before

  ```
  NODE_SCOPE (line: 3, code_range: (1,0)-(3,3))
  ```

  * After

  ```
  NODE_SCOPE (line: 3, code_range: (2,2)-(3,3))
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-09 03:52:59 +00:00
yui-knk 933fabd1b9 parse.y: Fix locations of NODE_ARRAY in NODE_OPCALL(nd_args)
* parse.y: Fix to only include a range of arg1.

  e.g. The locations of the NODE_ARRAY is fixed:

  ```
  1 + 2
  ```

  * Before

  ```
  NODE_ARRAY (line: 1, code_range: (1,0)-(1,5))
  ```

  * After

  ```
  NODE_ARRAY (line: 1, code_range: (1,4)-(1,5))
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-09 03:18:55 +00:00
yui-knk 79aba225b2 parse.y: Fix locations of NODE_SCOPE in NODE_CLASS
* parse.y: Fix to only include a range of bodystmt.

  e.g. The locations of the NODE_SCOPE is fixed:

  ```
  class A
    def a; end
  end
  ```

  * Before

  ```
  NODE_SCOPE (line: 3, code_range: (1,0)-(3,3))
  ```

  * After

  ```
  NODE_SCOPE (line: 3, code_range: (1,7)-(3,3))
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-09 03:03:34 +00:00
yui-knk f8659dfd94 parse.y Fix compile error
ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-08 00:45:23 +00:00
yui-knk c6b31b76ee parse.y: Fix locations of modifier_rescue
* parse.y: Fix to only include a range from modifier_rescue
  to stmt (or arg).

  e.g. The locations of the NODE_RESBODY is fixed:

  ```
  a rescue 1
  ```

  * Before

  ```
  NODE_RESBODY (line: 1, code_range: (1,0)-(1,10))
  ```

  * After

  ```
  NODE_RESBODY (line: 1, code_range: (1,2)-(1,10))
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-08 00:33:38 +00:00
yui-knk f026add396 parse.y: Fix locations of string
* parse.y: Fix to include locations of tSTRING_BEG and tSTRING_END.

  e.g. The locations of the NODE_STR is fixed:

  ```
  "a"
  ```

  * Before

  ```
  NODE_STR (line: 1, code_range: (1,1)-(1,2))
  ```

  * After

  ```
  NODE_STR (line: 1, code_range: (1,0)-(1,3))
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-07 23:35:59 +00:00
yui-knk 15c977803d parse.y: Fix locations of array
* parse.y (make_array): Set locations of ary to
  include locations of start token (tLBRACK, tWORDS_BEG, ...)
  and end token (']', tSTRING_END, ...) of array.

  e.g. The locations of the NODE_ARRAY is fixed:

  ```
  [1, 2, 3]
  ```

  * Before

  ```
  NODE_ARRAY (line: 1, code_range: (1,1)-(1,8))
  ```

  * After

  ```
  NODE_ARRAY (line: 1, code_range: (1,0)-(1,9))
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-07 06:38:49 +00:00
nobu db2d28b08e parse.y: fix for old compilers
* parse.y (arg_value): initialization of aggregation type with
  non-constant values is not allowed in C89.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-07 04:12:42 +00:00
yui-knk 803d1753b7 parse.y: Fix locations of dsym
* parse.y: Fix to only include a range from tSTRING_BEG to tLABEL_END.

  e.g. The locations of the NODE_LIT is fixed:

  ```
  { "a": 10 }
  ```

  * Before

  ```
  NODE_LIT (line: 1, code_range: (1,2)-(1,9))
  ```

  * After

  ```
  NODE_LIT (line: 1, code_range: (1,2)-(1,6))
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-07 03:00:36 +00:00
yui-knk acf7e52d88 parse.y: Fix locations of dsym
* parse.y (dsym_node_gen): Always set locations
  to include locations of tSYMBEG and tSTRING_END.

  e.g. The locations of the NODE_LIT is fixed:

  ```
  :"a"
  ```

  * Before

  ```
  NODE_LIT (line: 1, code_range: (1,2)-(1,3))
  ```

  * After

  ```
  NODE_LIT (line: 1, code_range: (1,0)-(1,4))
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-07 02:48:38 +00:00
yui-knk 2c018e9646 parse.y: Fix locations of regexp
* parse.y (new_regexp_gen): Always set locations
  to include locations of tREGEXP_BEG and tREGEXP_END.

  e.g. The locations of the NODE_LIT is fixed:

  ```
  /a/
  ```

  * Before

  ```
  NODE_LIT (line: 1, code_range: (1,1)-(1,2))
  ```

  * After

  ```
  NODE_LIT (line: 1, code_range: (1,0)-(1,3))
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-07 02:36:51 +00:00
yui-knk d2d4839a39 parse.y: Fix locations of xstring
* parse.y (new_xstring_gen): Always set locations
  to include locations of tXSTRING_BEG and tSTRING_END.

  e.g. The locations of the NODE_XSTR is fixed:

  ```
  `a`
  ```

  * Before

  ```
  NODE_XSTR (line: 1, code_range: (1,1)-(1,2))
  ```

  * After

  ```
  NODE_XSTR (line: 1, code_range: (1,0)-(1,3))
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-07 02:25:37 +00:00
yui-knk c1bd83cef7 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))
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-06 03:09:55 +00:00
mame b7c17ad14d parse.y: remove redefined typedef
Clang told me that this is C11 feature.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-06 01:41:05 +00:00
yui-knk f7899d3c80 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))
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-06 00:44:18 +00:00
nobu f24efa287f parse.y: nd_line of new node
* parse.y (nd_set_loc): set nd_line of the newly created node to
  the first location.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-05 13:49:40 +00:00
nobu 4fe720eb36 parse.y: nd_line of call_uni_op
* parse.y (call_uni_op): set nd_line to the unary operator
  location, same as non-operator method calls.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-05 13:46:21 +00:00
nobu 2ed1230429 parse.y: nd_line of logop
* parse.y (logop): set nd_line to the logical operator location,
  same as non-operator method calls.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-05 13:42:46 +00:00
nobu b9e91bfba4 parse.y: nd_line of match_op
* parse.y (match_op): set nd_line to the match operator location,
  same as non-operator method calls.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-05 13:38:01 +00:00
nobu 60bca0214b parse.y: nd_line of call_bin_op
* parse.y (call_bin_op): set nd_line to the binary operator
  location, same as non-operator method calls.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-05 13:30:06 +00:00
yui-knk faf43e37ad parse.y: Fix locations of NODE_*ASGN and NODE_ERRINFO
* parse.y: Fix to only include a range of exc_var.

  e.g. The locations of the NODE_DASGN_CURR and NODE_ERRINFO are fixed:

  ```
  begin
    1
  rescue => e
    2
  end
  ```

  * Before

  ```
  NODE_DASGN_CURR (line: 3, first_lineno: 3, first_column: 0, last_lineno: 5, last_column: 3)
  NODE_ERRINFO (line: 5, first_lineno: 3, first_column: 0, last_lineno: 5, last_column: 3)
  ```

  * After

  ```
  NODE_DASGN_CURR (line: 3, first_lineno: 3, first_column: 7, last_lineno: 3, last_column: 11)
  NODE_ERRINFO (line: 5, first_lineno: 3, first_column: 7, last_lineno: 3, last_column: 11)
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-04 23:59:02 +00:00
yui-knk 4788522fa6 parse.y: Fix a location of NODE_BLOCK_PASS
* parse.y (arg_append_gen): Update the last location of
  NODE_BLOCK_PASS when NODE is appended to nd_head.

  e.g. The locations of the NODE_BLOCK_PASS is fixed:

  ```
  o[1, &bl] = :c
  ```

  * Before

  ```
  NODE_BLOCK_PASS (line: 1, first_lineno: 1, first_column: 2, last_lineno: 1, last_column: 8)
  ```

  * After

  ```
  NODE_BLOCK_PASS (line: 1, first_lineno: 1, first_column: 2, last_lineno: 1, last_column: 14)
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-04 08:20:07 +00:00
yui-knk 81d8c29a21 parse.y: Fix a location of NODE_ARGSCAT
* parse.y (arg_append_gen): Update the last location of
  NODE_ARGSCAT when NODE is appended to nd_body.

  e.g. The locations of the NODE_ARGSCAT is fixed:

  ```
  m(*a, :b, :c)
  ```

  * Before

  ```
  NODE_ARGSCAT (line: 1, first_lineno: 1, first_column: 2, last_lineno: 1, last_column: 8)
  ```

  * After

  ```
  NODE_ARGSCAT (line: 1, first_lineno: 1, first_column: 2, last_lineno: 1, last_column: 12)
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-04 07:50:42 +00:00
yui-knk 2208c6b442 parse.y: Fix a location of NODE_ARRAY in NODE_ARGSCAT
* parse.y: Fix the first location to be equal to the location
  of the first element of NODE_ARRAY.

  e.g. The locations of the NODE_ARRAY is fixed:

  ```
  m(*a, :b, :c)
  ```

  * Before

  ```
  NODE_ARRAY (line: 1, first_lineno: 1, first_column: 2, last_lineno: 1, last_column: 12)
  ```

  * After

  ```
  NODE_ARRAY (line: 1, first_lineno: 1, first_column: 6, last_lineno: 1, last_column: 12)
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-04 07:16:31 +00:00
yui-knk 64d1a9e3ac parse.y: Fix a location of NODE_ZARRAY
* parse.y: Fix to only include a range of opt_call_args.

  e.g. The locations of the NODE_ZARRAY is fixed:

  ```
  a[] ||= 1
  ```

  * Before

  ```
  NODE_ZARRAY (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 9)
  ```

  * After

  ```
  NODE_ZARRAY (line: 1, first_lineno: 1, first_column: 2, last_lineno: 1, last_column: 3)
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-03 23:12:01 +00:00
yui-knk c1a9911797 parse.y (new_args_gen): Set the location of NODE_ARGS
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-03 12:44:47 +00:00
yui-knk 8a24dc0e0d parse.y: Fix a location of NODE_DVAR in rb_args_info
* parse.y (new_args_tail_gen): Set only a location of NODE_DVAR.

  e.g. The locations of the NODE_DVAR is fixed:

  ```
  def a(k: 1, **kws) end
  ```

  * Before

  ```
  NODE_DVAR (line: 1, first_lineno: 1, first_column: 6, last_lineno: 1, last_column: 18)
  ```

  * After

  ```
  NODE_DVAR (line: 1, first_lineno: 1, first_column: 12, last_lineno: 1, last_column: 17)
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-03 12:27:01 +00:00
yui-knk 1b055cffbc parse.y: Set a location of NODE_NIL in `not()`
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-03 06:53:18 +00:00
nobu 61997a2168 parse.y: location of BEGIN
* parse.y (top_stmt): wrap BEGIN statement to store the whole
  location for each block.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-03 06:14:58 +00:00
yui-knk fef98fdd09 parse.y: Fix locations of NODEs generated by cond0
* parse.y: Fix to only include a range of the first argument of cond.

  e.g. The locations of the NODE_MATCH2 and NODE_GVAR are fixed:

  ```
  1 while /#{:a}/
  ```

  * Before

  ```
  NODE_MATCH2 (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 15)
  NODE_GVAR (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 15)
  ```

  * After

  ```
  NODE_MATCH2 (line: 1, first_lineno: 1, first_column: 8, last_lineno: 1, last_column: 15)
  NODE_GVAR (line: 1, first_lineno: 1, first_column: 8, last_lineno: 1, last_column: 15)
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-03 04:53:05 +00:00
yui-knk 5bf3657b9f parse.y: Fix locations of NODEs related to for statement
* parse.y: Fix to only include a range of for_var.

  e.g. The locations of the NODE_ARGS and NODE_DVAR are fixed:

  ```
  for a in m do n end
  ```

  * Before

  ```
  NODE_ARGS (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 19)
  NODE_DVAR (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 19)
  ```

  * After

  ```
  NODE_ARGS (line: 1, first_lineno: 1, first_column: 4, last_lineno: 1, last_column: 5)
  NODE_DVAR (line: 1, first_lineno: 1, first_column: 4, last_lineno: 1, last_column: 5)
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-01 13:40:03 +00:00
yui-knk 58d572d6aa parse.y: Fix a location of NODE_HASH
* parse.y: Fix to only include a range of assocs.

  e.g. The locations of the NODE_HASH is fixed:

  ```
  a(1, b: 10, &block)
  ```

  * Before

  ```
  NODE_HASH (line: 1, first_lineno: 1, first_column: 2, last_lineno: 1, last_column: 18)
  ```

  * After

  ```
  NODE_HASH (line: 1, first_lineno: 1, first_column: 5, last_lineno: 1, last_column: 10)
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-01 09:48:17 +00:00
yui-knk 0212d5dc74 parse.y: Fix a location of hash keys
* parse.y: Use @1 to only include a range of tLABEL.

  e.g. The locations of the NODE_LIT(:b) is fixed:

  ```
  a(1, b: 10)
  ```

  * Before

  ```
  NODE_LIT (line: 1, first_lineno: 1, first_column: 5, last_lineno: 1, last_column: 10)
  ```

  * After

  ```
  NODE_LIT (line: 1, first_lineno: 1, first_column: 5, last_lineno: 1, last_column: 7)
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-01 06:32:59 +00:00
yui-knk 89bfee6fd4 Fix typos
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-28 06:19:04 +00:00
yui-knk 2734867c16 parse.y: Fix the last location of NODE_KW_ARG
* parse.y (kwd_append): Update the last location of
  NODE_KW_ARG when NODE is appended to the last.

  e.g. The locations of the first NODE_KW_ARG is fixed:

  ```
  def a(b: 1, c: 2); end
  ```

  * Before

  ```
  NODE_KW_ARG (line: 1, first_lineno: 1, first_column: 6, last_lineno: 1, last_column: 10)
  ```

  * After

  ```
  NODE_KW_ARG (line: 1, first_lineno: 1, first_column: 6, last_lineno: 1, last_column: 16)
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-26 23:52:47 +00:00
yui-knk 62b5c62f3d parse.y: Fix the last location of NODE_OPT_ARG
* parse.y (opt_arg_append): Update the last location of
  NODE_OPT_ARG when NODE is appended to the last.

  e.g. The locations of the first NODE_OPT_ARG is fixed:

  ```
  def a(b = 1, c = 2); end
  ```

  * Before

  ```
  NODE_OPT_ARG (line: 1, first_lineno: 1, first_column: 6, last_lineno: 1, last_column: 11)
  ```

  * After

  ```
  NODE_OPT_ARG (line: 1, first_lineno: 1, first_column: 6, last_lineno: 1, last_column: 18)
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-26 23:33:23 +00:00
yui-knk c56ac08636 parse.y: opt_arg_append
* parse.y (opt_arg_append): extract optional arguments
  append.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-25 11:57:33 +00:00
yui-knk ce64157d97 parse.y: Fix a location of assignable nodes
* parse.y (new_op_assign_gen): Update the location of
  lhs when NODE_OP_ASGN_OR/NODE_OP_ASGN_AND are generated.
  When NODE_OP_ASGN_OR/NODE_OP_ASGN_AND are generated
  a nd_value of lhs is set, so it is needed to update
  a location of lhs to include a location of rhs (same as
  node_assign_gen).

  e.g. The locations of NODE_DASGN_CURR is fixed:

  ```
  a ||= 1
  ```

  * Before

  ```
  NODE_DASGN_CURR (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 1)
  ```

  * After

  ```
  NODE_DASGN_CURR (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 7)
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-25 01:39:45 +00:00
nobu f418f9b4ce parse.y: make_array
* parse.y (make_array): turn NULL node into zero length array.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-24 04:26:29 +00:00
nobu eb13bcec58 parse.y: refactor list literals
* parse.y (words, symbols, qwords, qsymbols): unify empty list and
  non-empty list.

* parse.y (parser_parse_string): always dispatch a word separator
  at the beginning of list literals.
  [ruby-core:83871] [Bug #14126]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-24 04:26:27 +00:00
yui-knk f8523d35bf parse.y: Fix a location of serial NODE_AND/NODE_OR
* parse.y (logop_gen): Update the last location of
  NODE_AND/NODE_OR when NODE is appended to the last.

  e.g. The locations of NODE_AND is fixed:

  ```
  a && b && c
  ```

  * Before

  ```
  NODE_AND (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 6)
  ```

  * After

  ```
  NODE_AND (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 11)
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-23 14:15:27 +00:00