Skip to content

Commit c7e9ecb

Browse files
authored
+ add blocknilarg for prism (#1087)
See https://bugs.ruby-lang.org/issues/19979 ``` def foo(&nil) end ```
1 parent dfd0e93 commit c7e9ecb

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

doc/AST_FORMAT.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,6 +1145,17 @@ Format:
11451145
~~~~~ expression
11461146
~~~
11471147

1148+
### Block nil argument (Prism only)
1149+
1150+
Format:
1151+
1152+
~~~
1153+
(blocknilarg)
1154+
"&nil"
1155+
~~~ name
1156+
~~~~ expression
1157+
~~~
1158+
11481159
### Objective-C arguments
11491160

11501161
MacRuby includes a few more syntactic "arguments" whose name becomes

lib/parser/meta.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module Meta
77
# These are node types required by `Prism::Translation::Parser`,
88
# which has advanced syntax support ahead of the Parser gem.
99
PRISM_TRANSLATION_PARSER_NODE_TYPES = %i(
10-
itarg itblock
10+
itarg itblock blocknilarg
1111
).freeze
1212
private_constant :PRISM_TRANSLATION_PARSER_NODE_TYPES
1313

0 commit comments

Comments
 (0)