From 2f473b07136e95878a3cf4385ddf2c1e12a5c012 Mon Sep 17 00:00:00 2001 From: ydah Date: Wed, 4 Dec 2024 09:18:35 +0900 Subject: [PATCH] Add document CaseNode fields Partially: https://github.com/ruby/prism/issues/2123 --- config.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/config.yml b/config.yml index ac8c83f688..4271c58471 100644 --- a/config.yml +++ b/config.yml @@ -1735,16 +1735,41 @@ nodes: - name: predicate type: node? kind: non-void expression + comment: | + Represents the predicate of the case statement. This can be either `nil` or any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + + case true; when false; end + ^^^^ - name: conditions type: node[] kind: WhenNode + comment: | + Represents the conditions of the case statement. + + case true; when false; end + ^^^^^^^^^^ - name: else_clause type: node? kind: ElseNode + comment: | + Represents the else clause of the case statement. + + case true; when false; else; end + ^^^^ - name: case_keyword_loc type: location + comment: | + Represents the location of the `case` keyword. + + case true; when false; end + ^^^^ - name: end_keyword_loc type: location + comment: | + Represents the location of the `end` keyword. + + case true; when false; end + ^^^ comment: | Represents the use of a case statement.