summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Insley <dan.insley@eventtemple.com>2024-09-25 17:40:06 -0700
committergit <svn-admin@ruby-lang.org>2024-09-26 15:47:51 +0000
commita73d80db41ca3681bf316cb7741a254f6ba5a505 (patch)
tree614e1bdb22fb2ea271c33e84f4c0f6d152cce71e
parent1f431b63a2aa4b5c3827de8fbdc6001f6d4ab252 (diff)
[ruby/prism] Add fields documentation for AliasMethodNode and AlternationPatternNode
https://github.com/ruby/prism/commit/6953daebde
-rw-r--r--prism/config.yml37
1 files changed, 37 insertions, 0 deletions
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.