Skip to content

Commit 5f24741

Browse files
harashoomatzbot
authored andcommitted
[ruby/prism] Document ClassNode fields - Adds documentation for the fields of the ClassNode. - Part of #2123
ruby/prism@99615b43ac
1 parent 34b407a commit 5f24741

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

prism/config.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1828,6 +1828,11 @@ nodes:
18281828
type: constant[]
18291829
- name: class_keyword_loc
18301830
type: location
1831+
comment: |
1832+
Represents the location of the `class` keyword.
1833+
1834+
class Foo end
1835+
^^^^^
18311836
- name: constant_path
18321837
type: node
18331838
kind:
@@ -1836,18 +1841,43 @@ nodes:
18361841
- on error: CallNode # class 0.X end
18371842
- name: inheritance_operator_loc
18381843
type: location?
1844+
comment: |
1845+
Represents the location of the `<` operator.
1846+
1847+
class Foo < Bar
1848+
^
18391849
- name: superclass
18401850
type: node?
18411851
kind: non-void expression
1852+
comment: |
1853+
Represents the superclass of the class.
1854+
1855+
class Foo < Bar
1856+
^^^
18421857
- name: body
18431858
type: node?
18441859
kind:
18451860
- StatementsNode
18461861
- BeginNode
1862+
comment: |
1863+
Represents the body of the class.
1864+
1865+
class Foo
1866+
foo
1867+
^^^
18471868
- name: end_keyword_loc
18481869
type: location
1870+
comment: |
1871+
Represents the location of the `end` keyword.
1872+
1873+
class Foo end
1874+
^^^
18491875
- name: name
18501876
type: constant
1877+
comment: |
1878+
The name of the class.
1879+
1880+
class Foo end # name `:Foo`
18511881
comment: |
18521882
Represents a class declaration involving the `class` keyword.
18531883

0 commit comments

Comments
 (0)