[#122973] [PATCH] Add Gem.default_install — Felipe Contreras via ruby-core <ruby-core@...>
We need a way to enable user installs by default so that tools like
3 messages
2025/08/17
[ruby-core:123134] [Ruby Bug#21168] Prism doesn't require argument parentheses (in some cases) when a block is present but parse.y does
From:
"Earlopain (Earlopain _) via ruby-core" <ruby-core@...>
Date:
2025-08-30 09:56:22 UTC
List:
ruby-core #123134
Issue #21168 has been updated by Earlopain (Earlopain _).
I found out that this was discussed in a developer meeting: https://github.com/ruby/dev-meeting-log/blob/c35441297cd397fa3626ca0aa38efd7c61e430b2/2025/DevMeeting-2025-03-13.md?plain=1#L323
matz said:
> matz: I'll reply it. I like parse.y behavior. I don't want to allow the code any more
I revisited this and got more weird behaviour:
```rb
# Accepted by both
foo(
bar baz {
}
)
# Accepted by both
(
bar baz do
end
)
```
I don't think these are so different that they should suddenly be allowed. Should this be consistenly rejected in both parsers?
----------------------------------------
Bug #21168: Prism doesn't require argument parentheses (in some cases) when a block is present but parse.y does
https://bugs.ruby-lang.org/issues/21168#change-114463
* Author: Earlopain (Earlopain _)
* Status: Assigned
* Assignee: prism
* ruby -v: ruby 3.4.2 (2025-02-15 revision d2930f8e7a) +PRISM [x86_64-linux]
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
It's a bit more than that but explaining it in full would be a bit much. Instead, see this:
```rb
foo(
bar baz do
end
)
```
```sh
$ ruby -c --parser=prism test.rb
Syntax OK
$ ruby -c --parser=parse.y test.rb
ruby: test.rb:2: syntax error, unexpected 'do' for block, expecting ')' (SyntaxError)
bar baz do
^~
```
OTOH, this is consistently rejected:
```rb
[
foo bar do
end,
]
# And also
foo || bar baz do
end
```
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/