Project

General

Profile

Actions

Bug #21712

closed

Prism and parse.y inconsistency in command call with block and `.()`

Bug #21712: Prism and parse.y inconsistency in command call with block and `.()`

Added by tompng (tomoya ishida) 19 days ago. Updated 4 days ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 4.0.0dev (2025-11-26T06:41:42Z master 43ed35de6c) +YJIT +MN +PRISM [arm64-darwin24]
[ruby-core:123914]

Description

a b do end.() a b do end&.() are parsed differently.
Prism: parse success, parse.y: SyntaxError

I personally like Prism's behavior: .() and &.() are accepted where .f() and &.f() are accepted.

Updated by kddnewton (Kevin Newton) 15 days ago Actions #1 [ruby-core:123952]

  • Assignee set to prism

Updated by kddnewton (Kevin Newton) 15 days ago Actions #2 [ruby-core:123953]

  • Assignee deleted (prism)

Actually I didn't finish reading the ticket before I assigned to Prism. Should we put this to the next dev meeting if Prism's behavior is preferred?

Updated by matz (Yukihiro Matsumoto) 4 days ago Actions #3 [ruby-core:124133]

parse.y should be fixed to adopt this case.

Matz.

Updated by yui-knk (Kaneko Yuichiro) 4 days ago Actions #4

  • Status changed from Open to Closed

Applied in changeset git|c5b51bdd8c69ae038daf80cb227df854ca0110f1.


[Bug #21712] Allow .() call for command with block

This commit allows codes like a b do end.() and a b do end&.().

Actions

Also available in: PDF Atom