From bf17093a425a95f046f895d91ba79b3d54add1f8 Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Thu, 14 Mar 2024 01:25:14 +0900 Subject: [PATCH] [ruby/prism] Fix diagnostic incompatibility for `Prism::Translation::Parser` In the case of the `**` and `&` ambiguous prefixes, incompatibilities remained among https://github.com/ruby/prism/issues/2513. https://github.com/ruby/prism/commit/3b8b231aae --- lib/prism/translation/parser.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/prism/translation/parser.rb b/lib/prism/translation/parser.rb index 7a2d8e547b..6a2a9bbf24 100644 --- a/lib/prism/translation/parser.rb +++ b/lib/prism/translation/parser.rb @@ -193,8 +193,12 @@ module Prism Diagnostic.new(:warning, :ambiguous_prefix, { prefix: "+" }, diagnostic_location, []) when :ambiguous_first_argument_minus Diagnostic.new(:warning, :ambiguous_prefix, { prefix: "-" }, diagnostic_location, []) + when :ambiguous_prefix_ampersand + Diagnostic.new(:warning, :ambiguous_prefix, { prefix: "&" }, diagnostic_location, []) when :ambiguous_prefix_star Diagnostic.new(:warning, :ambiguous_prefix, { prefix: "*" }, diagnostic_location, []) + when :ambiguous_prefix_star_star + Diagnostic.new(:warning, :ambiguous_prefix, { prefix: "**" }, diagnostic_location, []) when :ambiguous_slash Diagnostic.new(:warning, :ambiguous_regexp, {}, diagnostic_location, []) when :dot_dot_dot_eol