summaryrefslogtreecommitdiff
path: root/test/ruby/test_syntax.rb
AgeCommit message (Collapse)Author
2024-07-21merge revision(s) b15e88e0fcccb03b9cc5e4c1478ec9b10e26c961: [Backport #19619]nagachika
[Bug #19619] Preserve numbered parameters context Preserve numbered parameters context across method definitions
2024-07-20merge revision(s) 2dd46bb82ffc4dff01d7ea70922f0e407acafb4e: [Backport #20468]nagachika
[Bug #20468] Fix safe navigation in `for` variable
2024-06-15Fix inconsistent evaluation of keyword splat (#10959)Peter Zhu
[Bug #20180] Backports #9624.
2024-02-25Revert "merge revision(s) c8d162c889008028b148437d02f36f4edaa749fd: ↵nagachika
[Backport #19973]" This reverts commit 24dd529750c08b5603fb418a4f34998b9bf6c8f9.
2024-02-25merge revision(s) c8d162c889008028b148437d02f36f4edaa749fd: [Backport #19973]nagachika
[Bug #19973] Warn duplicated keyword arguments after keyword splat --- parse.y | 11 +++++++---- test/ruby/test_syntax.rb | 6 ++++++ 2 files changed, 13 insertions(+), 4 deletions(-)
2023-07-22merge revision(s) ↵nagachika
9c94db7cfc584e982a6449b72e58a1cf25024177,fe4d906f5fbacbe6e9267af3bd3503339bad63a9: [Backport #19774] Add tests for `return` in `BEGIN` and `END` blocks --- spec/ruby/language/return_spec.rb | 15 +++++++++++++++ test/ruby/test_syntax.rb | 1 + 2 files changed, 16 insertions(+) [Bug #19774] Fix segfault at `return` in `END` --- eval_error.c | 7 ++++++- test/ruby/test_syntax.rb | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-)
2023-07-22merge revision(s) 91c004885fc75a93cadf0094fa86ec3bd0ec25f5: [Backport #19025]nagachika
[Bug #19025] Numbered parameter names are always local variables --- parse.y | 2 +- test/ruby/test_syntax.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
2022-12-15Disallow mixed usage of ... and */**Shugo Maeda
[Feature #19134] Notes: Merged: https://github.com/ruby/ruby/pull/6934
2022-11-29Add tests for [Feature #19134]Shugo Maeda
https://bugs.ruby-lang.org/issues/19134?next_issue_id=19133&prev_issue_id=19135#note-4
2022-11-29Allow ** in def foo(...)Shugo Maeda
[Feature #19134] Notes: Merged: https://github.com/ruby/ruby/pull/6818
2022-11-19Add test cases for args forwarding after rest argumentyui-knk
Notes: Merged: https://github.com/ruby/ruby/pull/6761
2022-11-18Allow anonymous keyword rest parameter with other keyword parametersShugo Maeda
Fixes [Bug #19132] Notes: Merged: https://github.com/ruby/ruby/pull/6743
2022-07-21Do not have class/module keywords look up ancestors of ObjectJeremy Evans
Fixes case where Object includes a module that defines a constant, then using class/module keyword to define the same constant on Object itself. Implements [Feature #18832] Notes: Merged: https://github.com/ruby/ruby/pull/6048
2022-06-17Respect the encoding of the source [Bug #18827]Nobuyoshi Nakada
Do not override the input string encoding at the time of preparation, the source encoding is not determined from the input yet. Notes: Merged: https://github.com/ruby/ruby/pull/6015
2022-04-05Fix using anonymous block in method accepting explicit keywordsJeremy Evans
Record block ID before vtable_pop, so the incorrect one doesn't override it. Fixes [Bug #18673] Notes: Merged: https://github.com/ruby/ruby/pull/5761
2021-12-30Add support for anonymous rest and keyword rest argument forwardingJeremy Evans
This allows for the following syntax: ```ruby def foo(*) bar(*) end def baz(**) quux(**) end ``` This is a natural addition after the introduction of anonymous block forwarding. Anonymous rest and keyword rest arguments were already supported in method parameters, this just allows them to be used as arguments to other methods. The same advantages of anonymous block forwarding apply to rest and keyword rest argument forwarding. This has some minor changes to #parameters output. Now, instead of `[:rest], [:keyrest]`, you get `[:rest, :*], [:keyrest, :**]`. These were already used for `...` forwarding, so I think it makes it more consistent to include them in other cases. If we want to use `[:rest], [:keyrest]` in both cases, that is also possible. I don't think the previous behavior of `[:rest], [:keyrest]` in the non-... case and `[:rest, :*], [:keyrest, :**]` in the ... case makes sense, but if we did want that behavior, we'll have to make more substantial changes, such as using a different ID in the ... forwarding case. Implements [Feature #18351] Notes: Merged: https://github.com/ruby/ruby/pull/5148
2021-12-15Fix arg_forward without parentheses [Bug #18267]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/5269
2021-11-18Anonymous block forwarding allows a method to forward a passedJeremy Evans
block to another method without having to provide a name for the block parameter. Implements [Feature #11256] Co-authored-by: Yusuke Endoh mame@ruby-lang.org Co-authored-by: Nobuyoshi Nakada nobu@ruby-lang.org Notes: Merged: https://github.com/ruby/ruby/pull/5051
2021-10-31Argument forwarding definition without parentheses [Bug #18267]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/5065
2021-10-18Fix evaluation order of hash values for duplicate keysJeremy Evans
Fixes [Bug #17719] Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> Co-authored-by: Ivo Anjo <ivo@ivoanjo.me> Notes: Merged: https://github.com/ruby/ruby/pull/4969 Merged-By: jeremyevans <code@jeremyevans.net>
2021-10-04The same warning for static symbol literalNobuyoshi Nakada
2021-10-04Fix the warning message for dynamic symbol literal in conditionNobuyoshi Nakada
2021-08-03Add keyrest to ruby2_keywords parameters [Bug #18011]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4705
2021-05-13parse.y: Allow "command" syntax in endless method definitionYusuke Endoh
This change allows `def hello = puts "Hello"` without parentheses. Note that `private def hello = puts "Hello"` does not parse for technical reason. [Feature #17398]
2021-05-12test_cdhash: refactor change class卜部昌平
It is now strange to test Complex in a class named Rational_Test. Notes: Merged: https://github.com/ruby/ruby/pull/4469
2020-12-24Reset paren_nest at tAREF and tASET [Bug #17431]Nobuyoshi Nakada
2020-11-04Rightward assignment is replaced by one-line pattern matchingKazuki Tsujimoto
2020-10-26Allow non-argument endless-def with a space instead of parenthesesNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3704
2020-10-26Assoc pattern matching (#3703)Nobuyoshi Nakada
[Feature #17260] One-line pattern matching using tASSOC R-assignment is rejected instead. Notes: Merged-By: nobu <nobu@ruby-lang.org>
2020-10-16test/ruby/test_syntax.rb: avoid "warning: assigned but unused variable"Yusuke Endoh
2020-10-16Adjust sp for `if true or ...`/`if false and ...`wanabe
Notes: Merged: https://github.com/ruby/ruby/pull/3445
2020-10-16Adjust sp for `x = false; y = (return until x unless x)` [Bug #16695]wanabe
Notes: Merged: https://github.com/ruby/ruby/pull/3445
2020-10-12Prohibit setter method names in all kinds of endless methodsNobuyoshi Nakada
Also unwrap NODE_RIPPER to check the method name. Notes: Merged: https://github.com/ruby/ruby/pull/3649
2020-08-31Prohibit setter method names in endless method definitionYusuke Endoh
https://bugs.ruby-lang.org/issues/16746#note-26 Notes: Merged: https://github.com/ruby/ruby/pull/3479
2020-07-22Switch reserved for numbered parameter warning to SyntaxErrorJeremy Evans
Notes: Merged: https://github.com/ruby/ruby/pull/3163
2020-06-07Differentiate `...` in lambda argumentsNobuyoshi Nakada
2020-06-06Add leading arguments support to arguments forwardingJeremy Evans
The idFWD_KWREST sections may be wrong. However, the existing idFWD_KWREST sections for ... without leading arguments are already broken. Implements [Feature #16378] Notes: Merged: https://github.com/ruby/ruby/pull/3190
2020-05-15Fixed argument forwarding in reserved word method [Bug #16854]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3112
2020-05-14Endless method definition including `rescue` modifierNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3108
2020-04-22Made parentheses mandatory in endless method defitionNobuyoshi Nakada
Even for empty argument list, not to be confusing with a writer method name. Notes: Merged: https://github.com/ruby/ruby/pull/3051
2020-04-22Disallow R-assign in endless defNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3051
2020-04-22Revert "Allow simple R-assign in endless def"Nobuyoshi Nakada
This reverts commit 67bcac879a2e0ddfb4e7bbd7cb5e5401422de76a. Notes: Merged: https://github.com/ruby/ruby/pull/3051
2020-04-15Disallow line-continuation before R-assignNobuyoshi Nakada
2020-04-13Allow simple R-assign in endless defNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3025
2020-04-12Relaxed of R-assign value to argNobuyoshi Nakada
2020-04-10Endless method definition [Feature #16746]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/2996
2020-04-10Rightward-assign by ASSOCNobuyoshi Nakada
[Feature #15921] Notes: Merged: https://github.com/ruby/ruby/pull/3012
2020-03-17Make {**{}} return unfrozen empty hashJeremy Evans
Previously, method call keyword splats and hash keyword splats were compiled exactly the same. This is because parse-wise, they operate on indentical nodes when it comes to compiling the **{}. Fix this by using an ugly hack of temporarily modifying the nd_brace flag in the method call keyword splat case. Inside compile_hash, only optimize the **{} case for hashes where the nd_brace flag has been modified to reflect we are in the method call keyword splat case and it is safe to do so. Since compile_keyword_args is only called in one place, move the keyword_node_p call out of that method to the single caller to avoid duplicating the code. Notes: Merged: https://github.com/ruby/ruby/pull/2945
2020-02-04Do not warn CR inside string literalNobuyoshi Nakada
2020-01-16Separate numbered parameter scope in evalNobuyoshi Nakada
[Feature #16432]