summaryrefslogtreecommitdiff
path: root/test/ruby/test_syntax.rb
AgeCommit message (Collapse)Author
2024-07-08merge revision(s) 2dd46bb82ffc4dff01d7ea70922f0e407acafb4e: [Backport #20468]Takashi Kokubun
[Bug #20468] Fix safe navigation in `for` variable
2024-06-11Raise SyntaxError on invalid encoding symbol (#10967)Peter Zhu
[Bug #20280] Backport of #10014.
2024-06-10Fix inconsistent evaluation of keyword splat (#10959)Peter Zhu
[Bug #20180] Backports #9624.
2024-03-14Fix test session reuse but expire (#9824) (#10250)NARUSE, Yui
merge revision(s) 596db9c1f486d6609a4e97d82c8c71b54609fb6f: [Backport #20090] [Feature #19370] Blocks without anonymous parameters should not affect --- parse.y | 4 ++-- test/ruby/test_syntax.rb | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-)
2023-12-25[Feature #19370] Prohibit nesting anonymous parameter forwardingNobuyoshi Nakada
2023-12-23Adjust indent [ci skip]Nobuyoshi Nakada
2023-12-16[Bug #20062] Fixed numbered parameter syntax errorNobuyoshi Nakada
At the method definition, the local scope that saves the context of the numbered parameters needs to be pushed before saving.
2023-12-12Prevent a warning: method redefinedYusuke Endoh
2023-12-07Support eval "return" at toplevelJeremy Evans
Since Ruby 2.4, `return` is supported at toplevel. This makes `eval "return"` also supported at toplevel. This mostly uses the same tests as direct `return` at toplevel, with a couple differences: `END {return if false}` is a SyntaxError, but `END {eval "return" if false}` is not an error since the eval is never executed. `END {return}` is a SyntaxError, but `END {eval "return"}` is a LocalJumpError. The following is a SyntaxError: ```ruby class X nil&defined?0--begin e=no_method_error(); return; 0;end end ``` However, the following is not, because the eval is never executed: ```ruby class X nil&defined?0--begin e=no_method_error(); eval "return"; 0;end end ``` Fixes [Bug #19779]
2023-12-07Warn `it` (#9152)Takashi Kokubun
https://bugs.ruby-lang.org/issues/18980
2023-11-21Add a testTSUYUSATO Kitsune
2023-10-26Prevent a warning: assigned but unused variable - zYusuke Endoh
2023-10-26[Bug #19973] Warn duplicated keyword arguments after keyword splatNobuyoshi Nakada
2023-09-01[Bug #19281] Allow semicolon in parenthesis at the first argument of command ↵yui-knk
call Allow compstmt in the first argument of command call wrapped with parenthesis like following arguments with parenthesis. Notes: Merged: https://github.com/ruby/ruby/pull/8347
2023-09-01[Bug-18878] Parse qualified const with brace block as method callNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/8343
2023-08-03Remove --disable-gems for assert_separatelyPeter Zhu
assert_separately adds --disable=gems so we don't need to add --disable-gems when calling assert_separately. Notes: Merged: https://github.com/ruby/ruby/pull/8162
2023-07-19Add a corner case for `return`Nobuyoshi Nakada
2023-07-19[Bug #19774] Fix segfault at `return` in `END`Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/8093
2023-07-19Add tests for `return` in `BEGIN` and `END` blocksNobuyoshi Nakada
2023-05-14[Bug #19025] Numbered parameter names are always local variablesNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/7810
2023-05-02[Bug #19619] Preserve numbered parameters contextNobuyoshi Nakada
Preserve numbered parameters context across method definitions
2023-03-21Use indented heredocNobuyoshi Nakada
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