From 9baad8b99f164fdb5d8b4e810b7586bcf549561c Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Mon, 16 Feb 2026 09:11:37 +0100 Subject: [PATCH] + add `blocknilarg` for prism See https://bugs.ruby-lang.org/issues/19979 ``` def foo(&nil) end ``` --- doc/AST_FORMAT.md | 11 +++++++++++ lib/parser/meta.rb | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/doc/AST_FORMAT.md b/doc/AST_FORMAT.md index 16f52f4d4..b53f582e2 100644 --- a/doc/AST_FORMAT.md +++ b/doc/AST_FORMAT.md @@ -1145,6 +1145,17 @@ Format: ~~~~~ expression ~~~ +### Block nil argument (Prism only) + +Format: + +~~~ +(blocknilarg) +"&nil" + ~~~ name + ~~~~ expression +~~~ + ### Objective-C arguments MacRuby includes a few more syntactic "arguments" whose name becomes diff --git a/lib/parser/meta.rb b/lib/parser/meta.rb index fcbaff167..b7ed0ece2 100644 --- a/lib/parser/meta.rb +++ b/lib/parser/meta.rb @@ -7,7 +7,7 @@ module Meta # These are node types required by `Prism::Translation::Parser`, # which has advanced syntax support ahead of the Parser gem. PRISM_TRANSLATION_PARSER_NODE_TYPES = %i( - itarg itblock + itarg itblock blocknilarg ).freeze private_constant :PRISM_TRANSLATION_PARSER_NODE_TYPES