From 5f247416b6b46b6f99c9f5229fab36ba721fd975 Mon Sep 17 00:00:00 2001 From: harasho Date: Thu, 29 May 2025 14:05:28 +0900 Subject: [PATCH] [ruby/prism] Document ClassNode fields - Adds documentation for the fields of the `ClassNode`. - Part of #2123 https://github.com/ruby/prism/commit/99615b43ac --- prism/config.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/prism/config.yml b/prism/config.yml index 3d5eee190f..cb154500b3 100644 --- a/prism/config.yml +++ b/prism/config.yml @@ -1828,6 +1828,11 @@ nodes: type: constant[] - name: class_keyword_loc type: location + comment: | + Represents the location of the `class` keyword. + + class Foo end + ^^^^^ - name: constant_path type: node kind: @@ -1836,18 +1841,43 @@ nodes: - on error: CallNode # class 0.X end - name: inheritance_operator_loc type: location? + comment: | + Represents the location of the `<` operator. + + class Foo < Bar + ^ - name: superclass type: node? kind: non-void expression + comment: | + Represents the superclass of the class. + + class Foo < Bar + ^^^ - name: body type: node? kind: - StatementsNode - BeginNode + comment: | + Represents the body of the class. + + class Foo + foo + ^^^ - name: end_keyword_loc type: location + comment: | + Represents the location of the `end` keyword. + + class Foo end + ^^^ - name: name type: constant + comment: | + The name of the class. + + class Foo end # name `:Foo` comment: | Represents a class declaration involving the `class` keyword.