summaryrefslogtreecommitdiff
path: root/test/ruby/test_syntax.rb
AgeCommit message (Collapse)Author
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]
2020-01-16Fixed the location of args node with numbered parameterNobuyoshi Nakada
2020-01-02Update tests for full keyword argument separationJeremy Evans
Notes: Merged: https://github.com/ruby/ruby/pull/2794
2019-12-23Reword keyword arguments warning messages to convey these are deprecation ↵Marc-Andre Lafortune
warnings
2019-12-20vm_args.c: rephrase the warning message of keyword argument separationYusuke Endoh
(old) test.rb:4: warning: The last argument is used as the keyword parameter test.rb:1: warning: for `foo' defined here; maybe ** should be added to the call? (new) test.rb:4: warning: The last argument is used as keyword parameters; maybe ** should be added to the call test.rb:1: warning: The called method `foo' is defined here
2019-12-20Refined the warning message for numbered-parameter like variablesNobuyoshi Nakada
[Bug #16438]
2019-12-20Refined the warning message for numbered-parameter like variablesNobuyoshi Nakada
[Bug #16438]
2019-12-20Warn also numbered parameter like methodsNobuyoshi Nakada
2019-12-20Warn also numbered parameter like parametersNobuyoshi Nakada
[Feature #16433]
2019-11-12Revert "Method reference operator"Nobuyoshi Nakada
This reverts commit 67c574736912003c377218153f9d3b9c0c96a17b. [Feature #16275]
2019-11-12Warn on `...` at EOLNobuyoshi Nakada
2019-11-12Clear current argument name at empty block argument [Bug #16343]Nobuyoshi Nakada
2019-11-11Revert "Warn EOF char in comment"NARUSE, Yui
This reverts commit 69ec3f70fab0c1c537c68fb135cc315181b1d750.
2019-11-11Revert "Elaborated EOF char message a little"NARUSE, Yui
This reverts commit 6eaac7cfac668d6669be694fd7b723c4982ed218.
2019-11-11Elaborated EOF char message a littleNobuyoshi Nakada
2019-11-11Warn EOF char in commentNobuyoshi Nakada
2019-11-11Prefer assert_syntax_error and assert_valid_syntaxNobuyoshi Nakada
2019-11-06Numbered parameter is an ID_LOCAL now [Bug #16293]Nobuyoshi Nakada
2019-11-06Numbered parameter cannot appear outside block now [Bug #16293]Nobuyoshi Nakada
2019-10-25Define arguments forwarding as `ruby2_keywords` styleNobuyoshi Nakada
Get rid of these redundant and useless warnings. ``` $ ruby -e 'def bar(a) a; end; def foo(...) bar(...) end; foo({})' -e:1: warning: The last argument is used as the keyword parameter -e:1: warning: for `foo' defined here -e:1: warning: The keyword argument is passed as the last hash parameter -e:1: warning: for `bar' defined here ```
2019-10-25Assert no-kwrest caseNobuyoshi Nakada
2019-10-25Assert no-block caseNobuyoshi Nakada
2019-10-25Set method locationsNobuyoshi Nakada
2019-10-25Arguments forwarding is not allowed in lambda [Feature #16253]Nobuyoshi Nakada