Skip to content

Prism::Translation::Parser incompatibility AST for foo.~@ bar #3820

Description

@koic

AST regression for foo.~@ bar in Prism 1.7.0 (translation Parser33):

Expected Behavior

Prism 1.6.0 returns "~@":

$ bundle exec ruby -rprism -rprism/translation/parser33 -ve 'p Prism::Translation::Parser33.parse("foo.~@ bar")'
ruby 4.0.0dev (2025-11-08T11:52:39Z master 4365c4fb6b) +PRISM [arm64-darwin24]
s(:send,
  s(:send, nil, :foo), :"~@",
  s(:send, nil, :bar))

and Parser gem returns "~@" too:

$ bundle exec ruby -rparser/ruby33 -ve 'p Parser::Ruby33.parse("foo.~@ bar")'
ruby 4.0.0dev (2025-11-08T11:52:39Z master 4365c4fb6b) +PRISM [arm64-darwin24]
s(:send,
  s(:send, nil, :foo), :"~@",
  s(:send, nil, :bar))

Actual Behavior

Prism 1.7.0 returns "~":

$ bundle exec ruby -rprism -rprism/translation/parser33 -ve 'p Prism::Translation::Parser33.parse("foo.~@ bar")'
ruby 4.0.0dev (2025-11-08T11:52:39Z master 4365c4fb6b) +PRISM [arm64-darwin24]
s(:send,
  s(:send, nil, :foo), :~,
  s(:send, nil, :bar))

This breaks compatibility with Parser's AST for unary ~@ calls. And "foo.!@ bar" has the same issue as "foo.~@ bar".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions