diff options
| author | Koichi ITO <koic.ito@gmail.com> | 2024-03-13 09:47:26 +0900 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2024-03-13 12:38:44 +0000 |
| commit | 824e3e6c3d2a172a7dbffbff0b29c0e25e022e13 (patch) | |
| tree | ebd9933af88e2da6c3905f581b9681c43ebef72b /spec/ruby/command_line | |
| parent | 7eea268b70b0a401bc8b8094b4ecbaf34aac9fa8 (diff) | |
[ruby/prism] Warn `**` interpreted as argument prefix
This PR makes Prism warn `**` interpreted as argument prefix.
This carries a similar meaning to the following Ruby warning:
```console
$ ruby -cwe "foo **bar"
-e:1: warning: `**' interpreted as argument prefix
Syntax OK
```
Previously, it did not issue a warning:
```console
$ bundle exec ruby -rprism -ve "p Prism.parse('foo **bar').warnings"
ruby 3.3.0 (2023-12-25 revision https://github.com/ruby/prism/commit/5124f9ac75) [x86_64-darwin22]
[]
```
From now on, it will issue a warning similar to Ruby's:
```console
$ bundle exec ruby -rprism -ve "p Prism.parse('foo **bar').warnings"
ruby 3.3.0 (2023-12-25 revision https://github.com/ruby/prism/commit/5124f9ac75) [x86_64-darwin22]
[#<Prism::ParseWarning @type=:ambiguous_prefix_star_star @message="ambiguous `**` has been interpreted as an argument prefix"
@location=#<Prism::Location @start_offset=4 @length=2 start_line=1> @level=:verbose>]
```
https://github.com/ruby/prism/commit/f6cb5c314c
Diffstat (limited to 'spec/ruby/command_line')
0 files changed, 0 insertions, 0 deletions
