Age | Commit message (Collapse) | Author |
|
Notes:
Merged: https://github.com/ruby/ruby/pull/2575
|
|
Fixes [Bug #10314]
Notes:
Merged: https://github.com/ruby/ruby/pull/2569
|
|
* parse.y (struct local_vars): moved numbered parameter NODEs for
nesting check to separate per local variable scopes, as numbered
parameters should belong to local variable scopes. [Bug #16248]
|
|
return directly in class/module is an error, so return in
proc in class/module should also be an error. I believe the
previous behavior was an unintentional oversight during the
addition of top-level return in 2.4.
Notes:
Merged-By: jeremyevans <code@jeremyevans.net>
|
|
* `_1` (and no other numbered parameters) to work as `|x|`.
* giving up `_0`.
[ruby-core:95074] [Bug #16178]
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/2431
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/2431
|
|
|
|
|
|
This is broken at least since 2.5 (I didn't check earlier versions).
It resulted in failure in test_ast.rb when the tests were added before
the parser change.
Basically, in remove_duplicate_keys, if the node is modified, set
the location information to the previous location information. The
removal of keys should not affect the location in the code.
Notes:
Merged: https://github.com/ruby/ruby/pull/2428
|
|
Ignore empty keyword splats in arrays
Notes:
Merged: https://github.com/ruby/ruby/pull/2418
Merged-By: jeremyevans <code@jeremyevans.net>
|
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/2395
|
|
This syntax means the method should be treated as a method that
uses keyword arguments, but no specific keyword arguments are
supported, and therefore calling the method with keyword arguments
will raise an ArgumentError. It is still allowed to double splat
an empty hash when calling the method, as that does not pass
any keyword arguments.
Notes:
Merged: https://github.com/ruby/ruby/pull/2395
|
|
Now that keyword splats accept non-Symbols, the type of exception
changes.
Previously, a TypeError (hash key "k1" is not a Symbol) was raised
for this test, but now an ArgumentError (unknown keyword: "k1") is
raised.
Notes:
Merged: https://github.com/ruby/ruby/pull/2395
|
|
|
|
This reverts commits:
* d365fd5a024254d7c105a62a015a7ea29ccf3e5d
* d780c3662484d6072b3a6945b840049de72c2096
* aa7211836b769231a2a8ef6b6ec2fd0ec882ef29
* 043f010c28e82ea38978bf8ed885416f133b5b75
* bb4dd7c6af05c7821d572e2592ea3d0cc748d81f
* 043f010c28e82ea38978bf8ed885416f133b5b75
* f169043d81524b5b529f2c1e9c35437ba5bc3a7a
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/94645
|
|
Fixes [Bug #14062]
|
|
This reverts commit bae638ad5b782c44c80efe33834cb9039279af46.
[Feature #5400]
|
|
Fixes [Bug #15985]
|
|
* parse.y (value_expr_check): `then` or `else` only `if` is not a
void value expression, as the counterpart is evaluated as `nil`.
[Bug #15932]
|
|
* parse.y (value_expr_check): if either of `then` or `else`
statements is not a void value expression, the whole `if` is not
also a void value expression. [Bug #15932]
|
|
|
|
|
|
|
|
|
|
https://twitter.com/yukihiro_matz/status/1139454774640726019
|
|
|
|
To allow arguments without parentheses.
|
|
|
|
|
|
https://hackerone.com/reports/605262
|
|
* parse.y: continue parsing the rest of the here-document starting
line, after the terminator was not found.
|
|
* parse.y (here_document): broke the terminator condition down
into each piece, the positional condition, resetting the
dedented here-document indentation, and matching identifier.
suppress a false warning by icc.
|
|
|
|
Heredocs are parsed line-by-line, so we need to keep track of the
temporary encoding of the string. Previously, a heredoc would
only detect mixed encoding errors if they were on the same line,
this changes things so they will be caught on different lines.
Fixes [Bug #15839]
|
|
This allows cases such as:
```ruby
m ->(a = ->{@1}) {a}
m.call.call(1)
m2 ->(a: ->{@1}) {a}
m2.call.call(2)
```
Previously, this would cause a syntax error.
[Bug#15789]
|
|
Because `proc{|| @1}` is a syntax error, the following should
also be syntax errors:
```ruby
proc { |
| @1}
```
```ruby
proc { |; a| @1 }
```
This fixes both cases.
[Bug #15825]
|
|
* parse.y (case_args): moved "duplicated when clause" warning from
compile phase, so that `ruby -wc` shows them.
|
|
* parse.y (heredoc_identifier): CR in here-document identifier
might or might not result in a syntax error, by the EOL code.
make a syntax error regardless of the EOL code.
|
|
* parse.y (heredoc_identifier): quoted here-document identifier
must end within the same line.
the only corner case that here-document identifier can contain a
newline is that the closing qoute is placed at the beginning of
the next line, and has been warned since 2.4.
```ruby
<<"EOS
" # warning: here document identifier ends with a newline
EOS
```
|
|
[Fix GH-2139] [Bug #15783]
|
|
[Fix GH-2139] [Bug #15783]
|
|
* parse.y (lambda): support numbered parameters, only when no
argument list including empty parentheses, like empty vertical
bars. [ruby-core:91859] [Bug #15672]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* parse.y (parser_yyerror): trim a newline at the end of the erred
code which was replaced with an extra space in the succeeding
cursor line.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* parse.y (parse_string): bail out when word-list meets end of
input not to show an extra "unexpected" error message after the
preceding error.
$ ruby -e "%w["
-e:1: unterminated string meets end of file
-e:1: syntax error, unexpected terminator, expecting ' '
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* parse.y (rb_yytnamerr): strip enclosing double-quotes, same as
the default yytnamerr except for that single-quotes matching
back-quotes do not stop stripping.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* parse.y: refine error messages for tSYMBEG and tSTRING_BEG, which
can appear at invalid places.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
Introduce the new operator for method reference, `.:`.
[Feature #12125] [Feature #13581]
[EXPERIMENTAL]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|