diff options
author | Koichi ITO <[email protected]> | 2024-03-13 10:46:10 +0900 |
---|---|---|
committer | git <[email protected]> | 2024-03-13 12:38:45 +0000 |
commit | 5fa28ce015a595ba8042be58a951b2f2a83eef10 (patch) | |
tree | 88e26cfec87a46e599428968278a9737afe2bb2d /ext/stringio/stringio.c | |
parent | 824e3e6c3d2a172a7dbffbff0b29c0e25e022e13 (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_amp @message="ambiguous `&` has been interpreted as an argument prefix"
@location=#<Prism::Location @start_offset=4 @length=1 start_line=1> @level=:verbose>]
```
https://github.com/ruby/prism/commit/312f99cd1e
Diffstat (limited to 'ext/stringio/stringio.c')
0 files changed, 0 insertions, 0 deletions