summaryrefslogtreecommitdiff
path: root/test/ruby/test_syntax.rb
AgeCommit message (Collapse)Author
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
2019-10-22Arguments forwarding [Feature #16253]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/2575
2019-10-17Make circular argument reference a SyntaxError instead of a warningJeremy Evans
Fixes [Bug #10314] Notes: Merged: https://github.com/ruby/ruby/pull/2569
2019-10-10Fixed numbered parameter checkNobuyoshi Nakada
* 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]
2019-10-02Treat return in block in class/module as LocalJumpError (#2511)Jeremy Evans
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>
2019-09-25Changed numbered parameters semanticsNobuyoshi Nakada
* `_1` (and no other numbered parameters) to work as `|x|`. * giving up `_0`. [ruby-core:95074] [Bug #16178]
2019-09-24Make numbered parameters exclusive in a scopeNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/2431
2019-09-24Changed numbered parameter prefixNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/2431
2019-09-19Fixed reserved numbered parameter warningNobuyoshi Nakada
2019-09-15Comment lines can be placed between fluent dot nowNobuyoshi Nakada
2019-09-05Fix code locations of array node inside hash node when multiple kw splatsJeremy Evans
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
2019-09-02Merge pull request #2418 from jeremyevans/array-empty-kwsplatJeremy Evans
Ignore empty keyword splats in arrays Notes: Merged: https://github.com/ruby/ruby/pull/2418 Merged-By: jeremyevans <code@jeremyevans.net>
2019-09-01Split warning messages for tag-jumpNobuyoshi Nakada
2019-08-30Fix remaining warning issues in the tests due to keyword argument separationJeremy Evans
Notes: Merged: https://github.com/ruby/ruby/pull/2395
2019-08-30Support **nil syntax for specifying a method does not accept keyword argumentsJeremy Evans
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
2019-08-30Fix test after keyword argument separationJeremy Evans
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
2019-08-29Refined warnings against literal in flip-flopNobuyoshi Nakada
2019-08-29Revert "Add pipeline operator [Feature #15799]"Nobuyoshi Nakada
This reverts commits: * d365fd5a024254d7c105a62a015a7ea29ccf3e5d * d780c3662484d6072b3a6945b840049de72c2096 * aa7211836b769231a2a8ef6b6ec2fd0ec882ef29 * 043f010c28e82ea38978bf8ed885416f133b5b75 * bb4dd7c6af05c7821d572e2592ea3d0cc748d81f * 043f010c28e82ea38978bf8ed885416f133b5b75 * f169043d81524b5b529f2c1e9c35437ba5bc3a7a http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/94645
2019-07-29Warn if using return at top-level with an argumentJeremy Evans
Fixes [Bug #14062]
2019-07-11Revert "parse.y: Deprecate flip-flops"Nobuyoshi Nakada
This reverts commit bae638ad5b782c44c80efe33834cb9039279af46. [Feature #5400]
2019-07-05Fix segfault when using method reference operator without using resultJeremy Evans
Fixes [Bug #15985]
2019-06-17Fix wrong "void value expression" errorNobuyoshi Nakada
* 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]
2019-06-17Fix wrong "void value expression" errorNobuyoshi Nakada
* 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]
2019-06-15Revert github/pull/2230, commit missNobuyoshi Nakada
2019-06-15Test for blank lines between leadinig dot method chainsJosh Cheek
2019-06-15Multiline method chain with leading dot works for blank linesJosh Cheek