From a73d80db41ca3681bf316cb7741a254f6ba5a505 Mon Sep 17 00:00:00 2001 From: Daniel Insley Date: Wed, 25 Sep 2024 17:40:06 -0700 Subject: [PATCH] [ruby/prism] Add fields documentation for AliasMethodNode and AlternationPatternNode https://github.com/ruby/prism/commit/6953daebde --- prism/config.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/prism/config.yml b/prism/config.yml index cc07b386a1..31ce8c2015 100644 --- a/prism/config.yml +++ b/prism/config.yml @@ -822,6 +822,17 @@ nodes: kind: - SymbolNode - InterpolatedSymbolNode + comment: | + Represents the new name of the method that will be aliased. + + alias foo bar + ^^^ + + alias :foo :bar + ^^^^ + + alias :"#{foo}" :"#{bar}" + ^^^^^^^^^ - name: old_name type: node kind: @@ -829,6 +840,17 @@ nodes: - InterpolatedSymbolNode - on error: GlobalVariableReadNode # alias a $b - on error: MissingNode # alias a 42 + comment: | + Represents the old name of the method that will be aliased. + + alias foo bar + ^^^ + + alias :foo :bar + ^^^^ + + alias :"#{foo}" :"#{bar}" + ^^^^^^^^^ - name: keyword_loc type: location comment: | @@ -841,11 +863,26 @@ nodes: - name: left type: node kind: pattern expression + comment: | + Represents the left side of the expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + + foo => bar | baz + ^^^ - name: right type: node kind: pattern expression + comment: | + Represents the right side of the expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + + foo => bar | baz + ^^^ - name: operator_loc type: location + comment: | + Represents the alternation operator location. + + foo => bar | baz + ^ comment: | Represents an alternation pattern in pattern matching.