prism 1.9.0 → 2.0.0.rc2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +88 -0
  3. data/CODE_OF_CONDUCT.md +1 -1
  4. data/LICENSE.md +1 -1
  5. data/Makefile +41 -12
  6. data/README.md +35 -97
  7. data/config.yml +174 -161
  8. data/docs/build_system.md +2 -2
  9. data/docs/configuration.md +5 -4
  10. data/docs/encoding.md +2 -2
  11. data/docs/fuzzing.md +4 -11
  12. data/docs/javascript.md +19 -4
  13. data/docs/mapping.md +1 -1
  14. data/docs/releasing.md +77 -5
  15. data/docs/relocation.md +2 -4
  16. data/docs/serialization.md +22 -24
  17. data/docs/testing.md +46 -29
  18. data/ext/prism/api_node.c +1461 -1401
  19. data/ext/prism/extconf.rb +3 -4
  20. data/ext/prism/extension.c +796 -422
  21. data/ext/prism/extension.h +3 -3
  22. data/include/prism/arena.h +37 -0
  23. data/include/prism/ast.h +2727 -610
  24. data/include/prism/buffer.h +52 -0
  25. data/include/prism/comments.h +55 -0
  26. data/include/prism/compiler/accel.h +26 -0
  27. data/include/prism/compiler/align.h +36 -0
  28. data/include/prism/compiler/assume.h +25 -0
  29. data/include/prism/compiler/bswap.h +46 -0
  30. data/include/prism/compiler/endianness.h +34 -0
  31. data/include/prism/compiler/exported.h +24 -0
  32. data/include/prism/compiler/fallthrough.h +22 -0
  33. data/include/prism/compiler/filesystem.h +32 -0
  34. data/include/prism/compiler/flex_array.h +19 -0
  35. data/include/prism/compiler/force_inline.h +21 -0
  36. data/include/prism/compiler/format.h +25 -0
  37. data/include/prism/compiler/inline.h +17 -0
  38. data/include/prism/compiler/nodiscard.h +22 -0
  39. data/include/prism/compiler/nonnull.h +18 -0
  40. data/include/prism/compiler/unused.h +18 -0
  41. data/include/prism/constant_pool.h +81 -0
  42. data/include/prism/diagnostic.h +38 -403
  43. data/include/prism/errors_format.h +53 -0
  44. data/include/prism/excludes.h +29 -0
  45. data/include/prism/integer.h +41 -0
  46. data/include/prism/internal/allocator.h +68 -0
  47. data/include/prism/internal/allocator_debug.h +88 -0
  48. data/include/prism/internal/arena.h +108 -0
  49. data/include/prism/internal/bit.h +42 -0
  50. data/include/prism/internal/buffer.h +94 -0
  51. data/include/prism/internal/char.h +145 -0
  52. data/include/prism/internal/comments.h +53 -0
  53. data/include/prism/internal/constant_pool.h +152 -0
  54. data/include/prism/internal/diagnostic.h +389 -0
  55. data/include/prism/{encoding.h → internal/encoding.h} +27 -68
  56. data/include/prism/internal/integer.h +68 -0
  57. data/include/prism/internal/isinf.h +16 -0
  58. data/include/prism/internal/line_offset_list.h +34 -0
  59. data/include/prism/{util/pm_list.h → internal/list.h} +11 -52
  60. data/include/prism/internal/magic_comments.h +23 -0
  61. data/include/prism/internal/memchr.h +15 -0
  62. data/include/prism/internal/node.h +38 -0
  63. data/include/prism/internal/options.h +232 -0
  64. data/include/prism/internal/parser.h +1004 -0
  65. data/include/prism/internal/regexp.h +26 -0
  66. data/include/prism/internal/serialize.h +39 -0
  67. data/include/prism/internal/source.h +72 -0
  68. data/include/prism/{static_literals.h → internal/static_literals.h} +26 -47
  69. data/include/prism/internal/stringy.h +35 -0
  70. data/include/prism/{util/pm_strncasecmp.h → internal/strncasecmp.h} +3 -17
  71. data/include/prism/{util/pm_strpbrk.h → internal/strpbrk.h} +7 -20
  72. data/include/prism/internal/tokens.h +11 -0
  73. data/include/prism/internal/xxh3.h +16 -0
  74. data/include/prism/json.h +32 -0
  75. data/include/prism/line_offset_list.h +61 -0
  76. data/include/prism/magic_comments.h +35 -0
  77. data/include/prism/node.h +18 -53
  78. data/include/prism/options.h +146 -280
  79. data/include/prism/parser.h +356 -867
  80. data/include/prism/prettyprint.h +6 -9
  81. data/include/prism/serialize.h +115 -0
  82. data/include/prism/source.h +155 -0
  83. data/include/prism/stream.h +28 -0
  84. data/include/prism/string_query.h +74 -0
  85. data/include/prism/stringy.h +72 -0
  86. data/include/prism/version.h +12 -3
  87. data/include/prism.h +43 -320
  88. data/lib/prism/compiler.rb +319 -305
  89. data/lib/prism/desugar_compiler.rb +105 -34
  90. data/lib/prism/dispatcher.rb +646 -473
  91. data/lib/prism/dot_visitor.rb +592 -511
  92. data/lib/prism/dsl.rb +391 -25
  93. data/lib/prism/ffi.rb +258 -90
  94. data/lib/prism/inspect_visitor.rb +357 -325
  95. data/lib/prism/lex_compat.rb +254 -212
  96. data/lib/prism/mutation_compiler.rb +313 -305
  97. data/lib/prism/node.rb +20966 -6992
  98. data/lib/prism/node_ext.rb +180 -187
  99. data/lib/prism/node_find.rb +215 -0
  100. data/lib/prism/parse_result/errors.rb +7 -1
  101. data/lib/prism/parse_result/newlines.rb +276 -8
  102. data/lib/prism/parse_result.rb +468 -139
  103. data/lib/prism/pattern.rb +65 -20
  104. data/lib/prism/reflection.rb +23 -12
  105. data/lib/prism/relocation.rb +149 -87
  106. data/lib/prism/serialize.rb +3460 -539
  107. data/lib/prism/string_query.rb +24 -1
  108. data/lib/prism/translation/parser/builder.rb +10 -2
  109. data/lib/prism/translation/parser/compiler.rb +44 -52
  110. data/lib/prism/translation/parser/lexer.rb +41 -92
  111. data/lib/prism/translation/parser.rb +1 -1
  112. data/lib/prism/translation/parser_current.rb +1 -1
  113. data/lib/prism/translation/ripper/lexer.rb +8 -10
  114. data/lib/prism/translation/ripper/sexp.rb +2 -10
  115. data/lib/prism/translation/ripper/shim.rb +2 -0
  116. data/lib/prism/translation/ripper.rb +967 -209
  117. data/lib/prism/translation/ruby_parser.rb +73 -316
  118. data/lib/prism/translation.rb +2 -0
  119. data/lib/prism/visitor.rb +632 -5
  120. data/lib/prism.rb +79 -9
  121. data/prism.gemspec +128 -62
  122. data/rbi/generated/prism/compiler.rbi +489 -0
  123. data/rbi/generated/prism/desugar_compiler.rbi +306 -0
  124. data/rbi/generated/prism/dispatcher.rbi +1138 -0
  125. data/rbi/generated/prism/dot_visitor.rbi +618 -0
  126. data/rbi/generated/prism/dsl.rbi +751 -0
  127. data/rbi/generated/prism/inspect_visitor.rbi +503 -0
  128. data/rbi/generated/prism/lex_compat.rbi +162 -0
  129. data/rbi/generated/prism/mutation_compiler.rbi +464 -0
  130. data/rbi/generated/prism/node.rbi +14407 -0
  131. data/rbi/generated/prism/node_ext.rbi +259 -0
  132. data/rbi/generated/prism/node_find.rbi +79 -0
  133. data/rbi/generated/prism/parse_result/errors.rbi +21 -0
  134. data/rbi/generated/prism/parse_result/newlines.rbi +208 -0
  135. data/rbi/generated/prism/parse_result.rbi +776 -0
  136. data/rbi/generated/prism/pattern.rbi +134 -0
  137. data/rbi/generated/prism/reflection.rbi +89 -0
  138. data/rbi/generated/prism/relocation.rbi +329 -0
  139. data/rbi/generated/prism/serialize.rbi +184 -0
  140. data/rbi/generated/prism/string_query.rbi +43 -0
  141. data/rbi/generated/prism/translation.rbi +7 -0
  142. data/rbi/generated/prism/visitor.rbi +650 -0
  143. data/rbi/generated/prism.rbi +86 -0
  144. data/rbi/prism/translation/parser_versions.rbi +5 -0
  145. data/rbi/rubyvm/node_find.rbi +14 -0
  146. data/sig/generated/prism/compiler.rbs +492 -0
  147. data/sig/generated/prism/desugar_compiler.rbs +305 -0
  148. data/sig/generated/prism/dispatcher.rbs +1292 -0
  149. data/sig/generated/prism/dot_visitor.rbs +635 -0
  150. data/sig/generated/prism/dsl.rbs +928 -0
  151. data/sig/generated/prism/inspect_visitor.rbs +509 -0
  152. data/sig/generated/prism/lex_compat.rbs +166 -0
  153. data/sig/{prism → generated/prism}/mutation_compiler.rbs +309 -4
  154. data/sig/generated/prism/node.rbs +20896 -0
  155. data/sig/generated/prism/node_ext.rbs +290 -0
  156. data/sig/generated/prism/node_find.rbs +90 -0
  157. data/sig/generated/prism/parse_result/errors.rbs +22 -0
  158. data/sig/generated/prism/parse_result/newlines.rbs +223 -0
  159. data/sig/generated/prism/parse_result.rbs +871 -0
  160. data/sig/generated/prism/pattern.rbs +156 -0
  161. data/sig/generated/prism/reflection.rbs +101 -0
  162. data/sig/generated/prism/relocation.rbs +428 -0
  163. data/sig/generated/prism/serialize.rbs +198 -0
  164. data/sig/generated/prism/string_query.rbs +43 -0
  165. data/sig/generated/prism/translation.rbs +8 -0
  166. data/sig/generated/prism/visitor.rbs +1111 -0
  167. data/sig/generated/prism.rbs +84 -0
  168. data/sig/manifest.yaml +2 -0
  169. data/src/arena.c +117 -0
  170. data/src/{util/pm_buffer.c → buffer.c} +53 -21
  171. data/src/{util/pm_char.c → char.c} +28 -57
  172. data/src/comments.c +454 -0
  173. data/src/constant_pool.c +406 -0
  174. data/src/diagnostic.c +97 -65
  175. data/src/encoding.c +8 -3
  176. data/src/errors_format.c +519 -0
  177. data/src/{util/pm_integer.c → integer.c} +33 -22
  178. data/src/json.c +5733 -0
  179. data/src/line_offset_list.c +100 -0
  180. data/src/list.c +24 -0
  181. data/src/{util/pm_memchr.c → memchr.c} +8 -6
  182. data/src/node.c +3504 -7674
  183. data/src/options.c +162 -49
  184. data/src/parser.c +367 -0
  185. data/src/prettyprint.c +421 -354
  186. data/src/prism.c +8402 -7161
  187. data/src/regexp.c +961 -45
  188. data/src/serialize.c +460 -424
  189. data/src/source.c +518 -0
  190. data/src/static_literals.c +111 -43
  191. data/src/string_query.c +180 -0
  192. data/src/stringy.c +91 -0
  193. data/src/{util/pm_strncasecmp.c → strncasecmp.c} +5 -4
  194. data/src/strpbrk.c +447 -0
  195. data/src/{token_type.c → tokens.c} +39 -18
  196. data/src/xxh3.c +292 -0
  197. metadata +128 -63
  198. data/ext/prism/api_pack.c +0 -276
  199. data/include/prism/defines.h +0 -260
  200. data/include/prism/pack.h +0 -163
  201. data/include/prism/regexp.h +0 -43
  202. data/include/prism/util/pm_buffer.h +0 -236
  203. data/include/prism/util/pm_char.h +0 -204
  204. data/include/prism/util/pm_constant_pool.h +0 -218
  205. data/include/prism/util/pm_integer.h +0 -130
  206. data/include/prism/util/pm_memchr.h +0 -29
  207. data/include/prism/util/pm_newline_list.h +0 -113
  208. data/include/prism/util/pm_string.h +0 -200
  209. data/lib/prism/pack.rb +0 -230
  210. data/lib/prism/parse_result/comments.rb +0 -188
  211. data/rbi/prism/compiler.rbi +0 -12
  212. data/rbi/prism/dsl.rbi +0 -524
  213. data/rbi/prism/inspect_visitor.rbi +0 -12
  214. data/rbi/prism/node.rbi +0 -8750
  215. data/rbi/prism/node_ext.rbi +0 -107
  216. data/rbi/prism/parse_result.rbi +0 -404
  217. data/rbi/prism/reflection.rbi +0 -58
  218. data/rbi/prism/string_query.rbi +0 -12
  219. data/rbi/prism/visitor.rbi +0 -473
  220. data/rbi/prism.rbi +0 -63
  221. data/sig/prism/compiler.rbs +0 -9
  222. data/sig/prism/dispatcher.rbs +0 -19
  223. data/sig/prism/dot_visitor.rbs +0 -6
  224. data/sig/prism/dsl.rbs +0 -351
  225. data/sig/prism/inspect_visitor.rbs +0 -22
  226. data/sig/prism/lex_compat.rbs +0 -10
  227. data/sig/prism/node.rbs +0 -4042
  228. data/sig/prism/node_ext.rbs +0 -149
  229. data/sig/prism/pack.rbs +0 -43
  230. data/sig/prism/parse_result/comments.rbs +0 -38
  231. data/sig/prism/parse_result.rbs +0 -197
  232. data/sig/prism/pattern.rbs +0 -13
  233. data/sig/prism/reflection.rbs +0 -50
  234. data/sig/prism/relocation.rbs +0 -185
  235. data/sig/prism/serialize.rbs +0 -8
  236. data/sig/prism/string_query.rbs +0 -11
  237. data/sig/prism/visitor.rbs +0 -169
  238. data/sig/prism.rbs +0 -272
  239. data/src/pack.c +0 -509
  240. data/src/util/pm_constant_pool.c +0 -342
  241. data/src/util/pm_list.c +0 -49
  242. data/src/util/pm_newline_list.c +0 -125
  243. data/src/util/pm_string.c +0 -381
  244. data/src/util/pm_strpbrk.c +0 -206
@@ -9,6 +9,9 @@ if you are looking to modify the template
9
9
  ++
10
10
  =end
11
11
 
12
+ #--
13
+ # rbs_inline: enabled
14
+
12
15
  require "cgi/escape"
13
16
  require "cgi/util" unless defined?(CGI::EscapeExt)
14
17
 
@@ -17,14 +20,18 @@ module Prism
17
20
  # subtree into a graphviz dot graph.
18
21
  class DotVisitor < Visitor
19
22
  class Field # :nodoc:
20
- attr_reader :name, :value, :port
23
+ attr_reader :name #: String
24
+ attr_reader :value #: String?
25
+ attr_reader :port #: bool
21
26
 
27
+ #: (String name, String? value, bool port) -> void
22
28
  def initialize(name, value, port)
23
29
  @name = name
24
30
  @value = value
25
31
  @port = port
26
32
  end
27
33
 
34
+ #: () -> String
28
35
  def to_dot
29
36
  if port
30
37
  "<tr><td align=\"left\" colspan=\"2\" port=\"#{name}\">#{name}</td></tr>"
@@ -35,17 +42,21 @@ module Prism
35
42
  end
36
43
 
37
44
  class Table # :nodoc:
38
- attr_reader :name, :fields
45
+ attr_reader :name #: String
46
+ attr_reader :fields #: Array[Field]
39
47
 
48
+ #: (String name) -> void
40
49
  def initialize(name)
41
50
  @name = name
42
51
  @fields = []
43
52
  end
44
53
 
54
+ #: (String name, ?String? value, ?port: bool) -> void
45
55
  def field(name, value = nil, port: false)
46
56
  fields << Field.new(name, value, port)
47
57
  end
48
58
 
59
+ #: () -> String
49
60
  def to_dot
50
61
  dot = <<~DOT
51
62
  <table border="0" cellborder="1" cellspacing="0" cellpadding="4">
@@ -61,26 +72,31 @@ module Prism
61
72
  end
62
73
 
63
74
  class Digraph # :nodoc:
64
- attr_reader :nodes, :waypoints, :edges
75
+ attr_reader :nodes, :waypoints, :edges #: Array[String]
65
76
 
77
+ #: () -> void
66
78
  def initialize
67
79
  @nodes = []
68
80
  @waypoints = []
69
81
  @edges = []
70
82
  end
71
83
 
84
+ #: (String value) -> void
72
85
  def node(value)
73
86
  nodes << value
74
87
  end
75
88
 
89
+ #: (String value) -> void
76
90
  def waypoint(value)
77
91
  waypoints << value
78
92
  end
79
93
 
94
+ #: (String value) -> void
80
95
  def edge(value)
81
96
  edges << value
82
97
  end
83
98
 
99
+ #: () -> String
84
100
  def to_dot
85
101
  <<~DOT
86
102
  digraph "Prism" {
@@ -104,20 +120,24 @@ module Prism
104
120
  private_constant :Field, :Table, :Digraph
105
121
 
106
122
  # The digraph that is being built.
107
- attr_reader :digraph
123
+ attr_reader :digraph #: Digraph
108
124
 
109
125
  # Initialize a new dot visitor.
126
+ #
127
+ #: () -> void
110
128
  def initialize
111
129
  @digraph = Digraph.new
112
130
  end
113
131
 
114
132
  # Convert this visitor into a graphviz dot graph string.
133
+ #
134
+ #: () -> String
115
135
  def to_dot
116
136
  digraph.to_dot
117
137
  end
118
138
 
119
- # Visit a AliasGlobalVariableNode node.
120
- def visit_alias_global_variable_node(node)
139
+ #: (AliasGlobalVariableNode) -> void
140
+ def visit_alias_global_variable_node(node) # :nodoc:
121
141
  table = Table.new("AliasGlobalVariableNode")
122
142
  id = node_id(node)
123
143
 
@@ -132,7 +152,7 @@ module Prism
132
152
  # keyword_loc
133
153
  table.field("keyword_loc", location_inspect(node.keyword_loc))
134
154
 
135
- digraph.nodes << <<~DOT
155
+ digraph.node(<<~DOT)
136
156
  #{id} [
137
157
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
138
158
  ];
@@ -141,8 +161,8 @@ module Prism
141
161
  super
142
162
  end
143
163
 
144
- # Visit a AliasMethodNode node.
145
- def visit_alias_method_node(node)
164
+ #: (AliasMethodNode) -> void
165
+ def visit_alias_method_node(node) # :nodoc:
146
166
  table = Table.new("AliasMethodNode")
147
167
  id = node_id(node)
148
168
 
@@ -157,7 +177,7 @@ module Prism
157
177
  # keyword_loc
158
178
  table.field("keyword_loc", location_inspect(node.keyword_loc))
159
179
 
160
- digraph.nodes << <<~DOT
180
+ digraph.node(<<~DOT)
161
181
  #{id} [
162
182
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
163
183
  ];
@@ -166,8 +186,8 @@ module Prism
166
186
  super
167
187
  end
168
188
 
169
- # Visit a AlternationPatternNode node.
170
- def visit_alternation_pattern_node(node)
189
+ #: (AlternationPatternNode) -> void
190
+ def visit_alternation_pattern_node(node) # :nodoc:
171
191
  table = Table.new("AlternationPatternNode")
172
192
  id = node_id(node)
173
193
 
@@ -182,7 +202,7 @@ module Prism
182
202
  # operator_loc
183
203
  table.field("operator_loc", location_inspect(node.operator_loc))
184
204
 
185
- digraph.nodes << <<~DOT
205
+ digraph.node(<<~DOT)
186
206
  #{id} [
187
207
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
188
208
  ];
@@ -191,8 +211,8 @@ module Prism
191
211
  super
192
212
  end
193
213
 
194
- # Visit a AndNode node.
195
- def visit_and_node(node)
214
+ #: (AndNode) -> void
215
+ def visit_and_node(node) # :nodoc:
196
216
  table = Table.new("AndNode")
197
217
  id = node_id(node)
198
218
 
@@ -207,7 +227,7 @@ module Prism
207
227
  # operator_loc
208
228
  table.field("operator_loc", location_inspect(node.operator_loc))
209
229
 
210
- digraph.nodes << <<~DOT
230
+ digraph.node(<<~DOT)
211
231
  #{id} [
212
232
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
213
233
  ];
@@ -216,8 +236,8 @@ module Prism
216
236
  super
217
237
  end
218
238
 
219
- # Visit a ArgumentsNode node.
220
- def visit_arguments_node(node)
239
+ #: (ArgumentsNode) -> void
240
+ def visit_arguments_node(node) # :nodoc:
221
241
  table = Table.new("ArgumentsNode")
222
242
  id = node_id(node)
223
243
 
@@ -237,7 +257,7 @@ module Prism
237
257
  table.field("arguments", "[]")
238
258
  end
239
259
 
240
- digraph.nodes << <<~DOT
260
+ digraph.node(<<~DOT)
241
261
  #{id} [
242
262
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
243
263
  ];
@@ -246,8 +266,8 @@ module Prism
246
266
  super
247
267
  end
248
268
 
249
- # Visit a ArrayNode node.
250
- def visit_array_node(node)
269
+ #: (ArrayNode) -> void
270
+ def visit_array_node(node) # :nodoc:
251
271
  table = Table.new("ArrayNode")
252
272
  id = node_id(node)
253
273
 
@@ -277,7 +297,7 @@ module Prism
277
297
  table.field("closing_loc", location_inspect(closing_loc))
278
298
  end
279
299
 
280
- digraph.nodes << <<~DOT
300
+ digraph.node(<<~DOT)
281
301
  #{id} [
282
302
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
283
303
  ];
@@ -286,8 +306,8 @@ module Prism
286
306
  super
287
307
  end
288
308
 
289
- # Visit a ArrayPatternNode node.
290
- def visit_array_pattern_node(node)
309
+ #: (ArrayPatternNode) -> void
310
+ def visit_array_pattern_node(node) # :nodoc:
291
311
  table = Table.new("ArrayPatternNode")
292
312
  id = node_id(node)
293
313
 
@@ -339,7 +359,7 @@ module Prism
339
359
  table.field("closing_loc", location_inspect(closing_loc))
340
360
  end
341
361
 
342
- digraph.nodes << <<~DOT
362
+ digraph.node(<<~DOT)
343
363
  #{id} [
344
364
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
345
365
  ];
@@ -348,8 +368,8 @@ module Prism
348
368
  super
349
369
  end
350
370
 
351
- # Visit a AssocNode node.
352
- def visit_assoc_node(node)
371
+ #: (AssocNode) -> void
372
+ def visit_assoc_node(node) # :nodoc:
353
373
  table = Table.new("AssocNode")
354
374
  id = node_id(node)
355
375
 
@@ -366,7 +386,7 @@ module Prism
366
386
  table.field("operator_loc", location_inspect(operator_loc))
367
387
  end
368
388
 
369
- digraph.nodes << <<~DOT
389
+ digraph.node(<<~DOT)
370
390
  #{id} [
371
391
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
372
392
  ];
@@ -375,8 +395,8 @@ module Prism
375
395
  super
376
396
  end
377
397
 
378
- # Visit a AssocSplatNode node.
379
- def visit_assoc_splat_node(node)
398
+ #: (AssocSplatNode) -> void
399
+ def visit_assoc_splat_node(node) # :nodoc:
380
400
  table = Table.new("AssocSplatNode")
381
401
  id = node_id(node)
382
402
 
@@ -389,7 +409,7 @@ module Prism
389
409
  # operator_loc
390
410
  table.field("operator_loc", location_inspect(node.operator_loc))
391
411
 
392
- digraph.nodes << <<~DOT
412
+ digraph.node(<<~DOT)
393
413
  #{id} [
394
414
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
395
415
  ];
@@ -398,15 +418,15 @@ module Prism
398
418
  super
399
419
  end
400
420
 
401
- # Visit a BackReferenceReadNode node.
402
- def visit_back_reference_read_node(node)
421
+ #: (BackReferenceReadNode) -> void
422
+ def visit_back_reference_read_node(node) # :nodoc:
403
423
  table = Table.new("BackReferenceReadNode")
404
424
  id = node_id(node)
405
425
 
406
426
  # name
407
427
  table.field("name", node.name.inspect)
408
428
 
409
- digraph.nodes << <<~DOT
429
+ digraph.node(<<~DOT)
410
430
  #{id} [
411
431
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
412
432
  ];
@@ -415,8 +435,8 @@ module Prism
415
435
  super
416
436
  end
417
437
 
418
- # Visit a BeginNode node.
419
- def visit_begin_node(node)
438
+ #: (BeginNode) -> void
439
+ def visit_begin_node(node) # :nodoc:
420
440
  table = Table.new("BeginNode")
421
441
  id = node_id(node)
422
442
 
@@ -454,7 +474,7 @@ module Prism
454
474
  table.field("end_keyword_loc", location_inspect(end_keyword_loc))
455
475
  end
456
476
 
457
- digraph.nodes << <<~DOT
477
+ digraph.node(<<~DOT)
458
478
  #{id} [
459
479
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
460
480
  ];
@@ -463,8 +483,8 @@ module Prism
463
483
  super
464
484
  end
465
485
 
466
- # Visit a BlockArgumentNode node.
467
- def visit_block_argument_node(node)
486
+ #: (BlockArgumentNode) -> void
487
+ def visit_block_argument_node(node) # :nodoc:
468
488
  table = Table.new("BlockArgumentNode")
469
489
  id = node_id(node)
470
490
 
@@ -477,7 +497,7 @@ module Prism
477
497
  # operator_loc
478
498
  table.field("operator_loc", location_inspect(node.operator_loc))
479
499
 
480
- digraph.nodes << <<~DOT
500
+ digraph.node(<<~DOT)
481
501
  #{id} [
482
502
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
483
503
  ];
@@ -486,8 +506,8 @@ module Prism
486
506
  super
487
507
  end
488
508
 
489
- # Visit a BlockLocalVariableNode node.
490
- def visit_block_local_variable_node(node)
509
+ #: (BlockLocalVariableNode) -> void
510
+ def visit_block_local_variable_node(node) # :nodoc:
491
511
  table = Table.new("BlockLocalVariableNode")
492
512
  id = node_id(node)
493
513
 
@@ -497,7 +517,7 @@ module Prism
497
517
  # name
498
518
  table.field("name", node.name.inspect)
499
519
 
500
- digraph.nodes << <<~DOT
520
+ digraph.node(<<~DOT)
501
521
  #{id} [
502
522
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
503
523
  ];
@@ -506,8 +526,8 @@ module Prism
506
526
  super
507
527
  end
508
528
 
509
- # Visit a BlockNode node.
510
- def visit_block_node(node)
529
+ #: (BlockNode) -> void
530
+ def visit_block_node(node) # :nodoc:
511
531
  table = Table.new("BlockNode")
512
532
  id = node_id(node)
513
533
 
@@ -532,7 +552,7 @@ module Prism
532
552
  # closing_loc
533
553
  table.field("closing_loc", location_inspect(node.closing_loc))
534
554
 
535
- digraph.nodes << <<~DOT
555
+ digraph.node(<<~DOT)
536
556
  #{id} [
537
557
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
538
558
  ];
@@ -541,8 +561,8 @@ module Prism
541
561
  super
542
562
  end
543
563
 
544
- # Visit a BlockParameterNode node.
545
- def visit_block_parameter_node(node)
564
+ #: (BlockParameterNode) -> void
565
+ def visit_block_parameter_node(node) # :nodoc:
546
566
  table = Table.new("BlockParameterNode")
547
567
  id = node_id(node)
548
568
 
@@ -560,7 +580,7 @@ module Prism
560
580
  # operator_loc
561
581
  table.field("operator_loc", location_inspect(node.operator_loc))
562
582
 
563
- digraph.nodes << <<~DOT
583
+ digraph.node(<<~DOT)
564
584
  #{id} [
565
585
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
566
586
  ];
@@ -569,8 +589,8 @@ module Prism
569
589
  super
570
590
  end
571
591
 
572
- # Visit a BlockParametersNode node.
573
- def visit_block_parameters_node(node)
592
+ #: (BlockParametersNode) -> void
593
+ def visit_block_parameters_node(node) # :nodoc:
574
594
  table = Table.new("BlockParametersNode")
575
595
  id = node_id(node)
576
596
 
@@ -603,7 +623,7 @@ module Prism
603
623
  table.field("closing_loc", location_inspect(closing_loc))
604
624
  end
605
625
 
606
- digraph.nodes << <<~DOT
626
+ digraph.node(<<~DOT)
607
627
  #{id} [
608
628
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
609
629
  ];
@@ -612,8 +632,8 @@ module Prism
612
632
  super
613
633
  end
614
634
 
615
- # Visit a BreakNode node.
616
- def visit_break_node(node)
635
+ #: (BreakNode) -> void
636
+ def visit_break_node(node) # :nodoc:
617
637
  table = Table.new("BreakNode")
618
638
  id = node_id(node)
619
639
 
@@ -626,7 +646,7 @@ module Prism
626
646
  # keyword_loc
627
647
  table.field("keyword_loc", location_inspect(node.keyword_loc))
628
648
 
629
- digraph.nodes << <<~DOT
649
+ digraph.node(<<~DOT)
630
650
  #{id} [
631
651
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
632
652
  ];
@@ -635,8 +655,8 @@ module Prism
635
655
  super
636
656
  end
637
657
 
638
- # Visit a CallAndWriteNode node.
639
- def visit_call_and_write_node(node)
658
+ #: (CallAndWriteNode) -> void
659
+ def visit_call_and_write_node(node) # :nodoc:
640
660
  table = Table.new("CallAndWriteNode")
641
661
  id = node_id(node)
642
662
 
@@ -672,7 +692,7 @@ module Prism
672
692
  table.field("value", port: true)
673
693
  digraph.edge("#{id}:value -> #{node_id(node.value)};")
674
694
 
675
- digraph.nodes << <<~DOT
695
+ digraph.node(<<~DOT)
676
696
  #{id} [
677
697
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
678
698
  ];
@@ -681,8 +701,8 @@ module Prism
681
701
  super
682
702
  end
683
703
 
684
- # Visit a CallNode node.
685
- def visit_call_node(node)
704
+ #: (CallNode) -> void
705
+ def visit_call_node(node) # :nodoc:
686
706
  table = Table.new("CallNode")
687
707
  id = node_id(node)
688
708
 
@@ -735,7 +755,7 @@ module Prism
735
755
  digraph.edge("#{id}:block -> #{node_id(block)};")
736
756
  end
737
757
 
738
- digraph.nodes << <<~DOT
758
+ digraph.node(<<~DOT)
739
759
  #{id} [
740
760
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
741
761
  ];
@@ -744,8 +764,8 @@ module Prism
744
764
  super
745
765
  end
746
766
 
747
- # Visit a CallOperatorWriteNode node.
748
- def visit_call_operator_write_node(node)
767
+ #: (CallOperatorWriteNode) -> void
768
+ def visit_call_operator_write_node(node) # :nodoc:
749
769
  table = Table.new("CallOperatorWriteNode")
750
770
  id = node_id(node)
751
771
 
@@ -784,7 +804,7 @@ module Prism
784
804
  table.field("value", port: true)
785
805
  digraph.edge("#{id}:value -> #{node_id(node.value)};")
786
806
 
787
- digraph.nodes << <<~DOT
807
+ digraph.node(<<~DOT)
788
808
  #{id} [
789
809
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
790
810
  ];
@@ -793,8 +813,8 @@ module Prism
793
813
  super
794
814
  end
795
815
 
796
- # Visit a CallOrWriteNode node.
797
- def visit_call_or_write_node(node)
816
+ #: (CallOrWriteNode) -> void
817
+ def visit_call_or_write_node(node) # :nodoc:
798
818
  table = Table.new("CallOrWriteNode")
799
819
  id = node_id(node)
800
820
 
@@ -830,7 +850,7 @@ module Prism
830
850
  table.field("value", port: true)
831
851
  digraph.edge("#{id}:value -> #{node_id(node.value)};")
832
852
 
833
- digraph.nodes << <<~DOT
853
+ digraph.node(<<~DOT)
834
854
  #{id} [
835
855
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
836
856
  ];
@@ -839,8 +859,8 @@ module Prism
839
859
  super
840
860
  end
841
861
 
842
- # Visit a CallTargetNode node.
843
- def visit_call_target_node(node)
862
+ #: (CallTargetNode) -> void
863
+ def visit_call_target_node(node) # :nodoc:
844
864
  table = Table.new("CallTargetNode")
845
865
  id = node_id(node)
846
866
 
@@ -860,7 +880,7 @@ module Prism
860
880
  # message_loc
861
881
  table.field("message_loc", location_inspect(node.message_loc))
862
882
 
863
- digraph.nodes << <<~DOT
883
+ digraph.node(<<~DOT)
864
884
  #{id} [
865
885
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
866
886
  ];
@@ -869,8 +889,8 @@ module Prism
869
889
  super
870
890
  end
871
891
 
872
- # Visit a CapturePatternNode node.
873
- def visit_capture_pattern_node(node)
892
+ #: (CapturePatternNode) -> void
893
+ def visit_capture_pattern_node(node) # :nodoc:
874
894
  table = Table.new("CapturePatternNode")
875
895
  id = node_id(node)
876
896
 
@@ -885,7 +905,7 @@ module Prism
885
905
  # operator_loc
886
906
  table.field("operator_loc", location_inspect(node.operator_loc))
887
907
 
888
- digraph.nodes << <<~DOT
908
+ digraph.node(<<~DOT)
889
909
  #{id} [
890
910
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
891
911
  ];
@@ -894,8 +914,8 @@ module Prism
894
914
  super
895
915
  end
896
916
 
897
- # Visit a CaseMatchNode node.
898
- def visit_case_match_node(node)
917
+ #: (CaseMatchNode) -> void
918
+ def visit_case_match_node(node) # :nodoc:
899
919
  table = Table.new("CaseMatchNode")
900
920
  id = node_id(node)
901
921
 
@@ -930,7 +950,7 @@ module Prism
930
950
  # end_keyword_loc
931
951
  table.field("end_keyword_loc", location_inspect(node.end_keyword_loc))
932
952
 
933
- digraph.nodes << <<~DOT
953
+ digraph.node(<<~DOT)
934
954
  #{id} [
935
955
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
936
956
  ];
@@ -939,8 +959,8 @@ module Prism
939
959
  super
940
960
  end
941
961
 
942
- # Visit a CaseNode node.
943
- def visit_case_node(node)
962
+ #: (CaseNode) -> void
963
+ def visit_case_node(node) # :nodoc:
944
964
  table = Table.new("CaseNode")
945
965
  id = node_id(node)
946
966
 
@@ -975,7 +995,7 @@ module Prism
975
995
  # end_keyword_loc
976
996
  table.field("end_keyword_loc", location_inspect(node.end_keyword_loc))
977
997
 
978
- digraph.nodes << <<~DOT
998
+ digraph.node(<<~DOT)
979
999
  #{id} [
980
1000
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
981
1001
  ];
@@ -984,8 +1004,8 @@ module Prism
984
1004
  super
985
1005
  end
986
1006
 
987
- # Visit a ClassNode node.
988
- def visit_class_node(node)
1007
+ #: (ClassNode) -> void
1008
+ def visit_class_node(node) # :nodoc:
989
1009
  table = Table.new("ClassNode")
990
1010
  id = node_id(node)
991
1011
 
@@ -1022,7 +1042,7 @@ module Prism
1022
1042
  # name
1023
1043
  table.field("name", node.name.inspect)
1024
1044
 
1025
- digraph.nodes << <<~DOT
1045
+ digraph.node(<<~DOT)
1026
1046
  #{id} [
1027
1047
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1028
1048
  ];
@@ -1031,8 +1051,8 @@ module Prism
1031
1051
  super
1032
1052
  end
1033
1053
 
1034
- # Visit a ClassVariableAndWriteNode node.
1035
- def visit_class_variable_and_write_node(node)
1054
+ #: (ClassVariableAndWriteNode) -> void
1055
+ def visit_class_variable_and_write_node(node) # :nodoc:
1036
1056
  table = Table.new("ClassVariableAndWriteNode")
1037
1057
  id = node_id(node)
1038
1058
 
@@ -1049,7 +1069,7 @@ module Prism
1049
1069
  table.field("value", port: true)
1050
1070
  digraph.edge("#{id}:value -> #{node_id(node.value)};")
1051
1071
 
1052
- digraph.nodes << <<~DOT
1072
+ digraph.node(<<~DOT)
1053
1073
  #{id} [
1054
1074
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1055
1075
  ];
@@ -1058,8 +1078,8 @@ module Prism
1058
1078
  super
1059
1079
  end
1060
1080
 
1061
- # Visit a ClassVariableOperatorWriteNode node.
1062
- def visit_class_variable_operator_write_node(node)
1081
+ #: (ClassVariableOperatorWriteNode) -> void
1082
+ def visit_class_variable_operator_write_node(node) # :nodoc:
1063
1083
  table = Table.new("ClassVariableOperatorWriteNode")
1064
1084
  id = node_id(node)
1065
1085
 
@@ -1079,7 +1099,7 @@ module Prism
1079
1099
  # binary_operator
1080
1100
  table.field("binary_operator", node.binary_operator.inspect)
1081
1101
 
1082
- digraph.nodes << <<~DOT
1102
+ digraph.node(<<~DOT)
1083
1103
  #{id} [
1084
1104
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1085
1105
  ];
@@ -1088,8 +1108,8 @@ module Prism
1088
1108
  super
1089
1109
  end
1090
1110
 
1091
- # Visit a ClassVariableOrWriteNode node.
1092
- def visit_class_variable_or_write_node(node)
1111
+ #: (ClassVariableOrWriteNode) -> void
1112
+ def visit_class_variable_or_write_node(node) # :nodoc:
1093
1113
  table = Table.new("ClassVariableOrWriteNode")
1094
1114
  id = node_id(node)
1095
1115
 
@@ -1106,7 +1126,7 @@ module Prism
1106
1126
  table.field("value", port: true)
1107
1127
  digraph.edge("#{id}:value -> #{node_id(node.value)};")
1108
1128
 
1109
- digraph.nodes << <<~DOT
1129
+ digraph.node(<<~DOT)
1110
1130
  #{id} [
1111
1131
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1112
1132
  ];
@@ -1115,15 +1135,15 @@ module Prism
1115
1135
  super
1116
1136
  end
1117
1137
 
1118
- # Visit a ClassVariableReadNode node.
1119
- def visit_class_variable_read_node(node)
1138
+ #: (ClassVariableReadNode) -> void
1139
+ def visit_class_variable_read_node(node) # :nodoc:
1120
1140
  table = Table.new("ClassVariableReadNode")
1121
1141
  id = node_id(node)
1122
1142
 
1123
1143
  # name
1124
1144
  table.field("name", node.name.inspect)
1125
1145
 
1126
- digraph.nodes << <<~DOT
1146
+ digraph.node(<<~DOT)
1127
1147
  #{id} [
1128
1148
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1129
1149
  ];
@@ -1132,15 +1152,15 @@ module Prism
1132
1152
  super
1133
1153
  end
1134
1154
 
1135
- # Visit a ClassVariableTargetNode node.
1136
- def visit_class_variable_target_node(node)
1155
+ #: (ClassVariableTargetNode) -> void
1156
+ def visit_class_variable_target_node(node) # :nodoc:
1137
1157
  table = Table.new("ClassVariableTargetNode")
1138
1158
  id = node_id(node)
1139
1159
 
1140
1160
  # name
1141
1161
  table.field("name", node.name.inspect)
1142
1162
 
1143
- digraph.nodes << <<~DOT
1163
+ digraph.node(<<~DOT)
1144
1164
  #{id} [
1145
1165
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1146
1166
  ];
@@ -1149,8 +1169,8 @@ module Prism
1149
1169
  super
1150
1170
  end
1151
1171
 
1152
- # Visit a ClassVariableWriteNode node.
1153
- def visit_class_variable_write_node(node)
1172
+ #: (ClassVariableWriteNode) -> void
1173
+ def visit_class_variable_write_node(node) # :nodoc:
1154
1174
  table = Table.new("ClassVariableWriteNode")
1155
1175
  id = node_id(node)
1156
1176
 
@@ -1167,7 +1187,7 @@ module Prism
1167
1187
  # operator_loc
1168
1188
  table.field("operator_loc", location_inspect(node.operator_loc))
1169
1189
 
1170
- digraph.nodes << <<~DOT
1190
+ digraph.node(<<~DOT)
1171
1191
  #{id} [
1172
1192
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1173
1193
  ];
@@ -1176,8 +1196,8 @@ module Prism
1176
1196
  super
1177
1197
  end
1178
1198
 
1179
- # Visit a ConstantAndWriteNode node.
1180
- def visit_constant_and_write_node(node)
1199
+ #: (ConstantAndWriteNode) -> void
1200
+ def visit_constant_and_write_node(node) # :nodoc:
1181
1201
  table = Table.new("ConstantAndWriteNode")
1182
1202
  id = node_id(node)
1183
1203
 
@@ -1194,7 +1214,7 @@ module Prism
1194
1214
  table.field("value", port: true)
1195
1215
  digraph.edge("#{id}:value -> #{node_id(node.value)};")
1196
1216
 
1197
- digraph.nodes << <<~DOT
1217
+ digraph.node(<<~DOT)
1198
1218
  #{id} [
1199
1219
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1200
1220
  ];
@@ -1203,8 +1223,8 @@ module Prism
1203
1223
  super
1204
1224
  end
1205
1225
 
1206
- # Visit a ConstantOperatorWriteNode node.
1207
- def visit_constant_operator_write_node(node)
1226
+ #: (ConstantOperatorWriteNode) -> void
1227
+ def visit_constant_operator_write_node(node) # :nodoc:
1208
1228
  table = Table.new("ConstantOperatorWriteNode")
1209
1229
  id = node_id(node)
1210
1230
 
@@ -1224,7 +1244,7 @@ module Prism
1224
1244
  # binary_operator
1225
1245
  table.field("binary_operator", node.binary_operator.inspect)
1226
1246
 
1227
- digraph.nodes << <<~DOT
1247
+ digraph.node(<<~DOT)
1228
1248
  #{id} [
1229
1249
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1230
1250
  ];
@@ -1233,8 +1253,8 @@ module Prism
1233
1253
  super
1234
1254
  end
1235
1255
 
1236
- # Visit a ConstantOrWriteNode node.
1237
- def visit_constant_or_write_node(node)
1256
+ #: (ConstantOrWriteNode) -> void
1257
+ def visit_constant_or_write_node(node) # :nodoc:
1238
1258
  table = Table.new("ConstantOrWriteNode")
1239
1259
  id = node_id(node)
1240
1260
 
@@ -1251,7 +1271,7 @@ module Prism
1251
1271
  table.field("value", port: true)
1252
1272
  digraph.edge("#{id}:value -> #{node_id(node.value)};")
1253
1273
 
1254
- digraph.nodes << <<~DOT
1274
+ digraph.node(<<~DOT)
1255
1275
  #{id} [
1256
1276
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1257
1277
  ];
@@ -1260,8 +1280,8 @@ module Prism
1260
1280
  super
1261
1281
  end
1262
1282
 
1263
- # Visit a ConstantPathAndWriteNode node.
1264
- def visit_constant_path_and_write_node(node)
1283
+ #: (ConstantPathAndWriteNode) -> void
1284
+ def visit_constant_path_and_write_node(node) # :nodoc:
1265
1285
  table = Table.new("ConstantPathAndWriteNode")
1266
1286
  id = node_id(node)
1267
1287
 
@@ -1276,7 +1296,7 @@ module Prism
1276
1296
  table.field("value", port: true)
1277
1297
  digraph.edge("#{id}:value -> #{node_id(node.value)};")
1278
1298
 
1279
- digraph.nodes << <<~DOT
1299
+ digraph.node(<<~DOT)
1280
1300
  #{id} [
1281
1301
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1282
1302
  ];
@@ -1285,8 +1305,8 @@ module Prism
1285
1305
  super
1286
1306
  end
1287
1307
 
1288
- # Visit a ConstantPathNode node.
1289
- def visit_constant_path_node(node)
1308
+ #: (ConstantPathNode) -> void
1309
+ def visit_constant_path_node(node) # :nodoc:
1290
1310
  table = Table.new("ConstantPathNode")
1291
1311
  id = node_id(node)
1292
1312
 
@@ -1305,7 +1325,7 @@ module Prism
1305
1325
  # name_loc
1306
1326
  table.field("name_loc", location_inspect(node.name_loc))
1307
1327
 
1308
- digraph.nodes << <<~DOT
1328
+ digraph.node(<<~DOT)
1309
1329
  #{id} [
1310
1330
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1311
1331
  ];
@@ -1314,8 +1334,8 @@ module Prism
1314
1334
  super
1315
1335
  end
1316
1336
 
1317
- # Visit a ConstantPathOperatorWriteNode node.
1318
- def visit_constant_path_operator_write_node(node)
1337
+ #: (ConstantPathOperatorWriteNode) -> void
1338
+ def visit_constant_path_operator_write_node(node) # :nodoc:
1319
1339
  table = Table.new("ConstantPathOperatorWriteNode")
1320
1340
  id = node_id(node)
1321
1341
 
@@ -1333,7 +1353,7 @@ module Prism
1333
1353
  # binary_operator
1334
1354
  table.field("binary_operator", node.binary_operator.inspect)
1335
1355
 
1336
- digraph.nodes << <<~DOT
1356
+ digraph.node(<<~DOT)
1337
1357
  #{id} [
1338
1358
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1339
1359
  ];
@@ -1342,8 +1362,8 @@ module Prism
1342
1362
  super
1343
1363
  end
1344
1364
 
1345
- # Visit a ConstantPathOrWriteNode node.
1346
- def visit_constant_path_or_write_node(node)
1365
+ #: (ConstantPathOrWriteNode) -> void
1366
+ def visit_constant_path_or_write_node(node) # :nodoc:
1347
1367
  table = Table.new("ConstantPathOrWriteNode")
1348
1368
  id = node_id(node)
1349
1369
 
@@ -1358,7 +1378,7 @@ module Prism
1358
1378
  table.field("value", port: true)
1359
1379
  digraph.edge("#{id}:value -> #{node_id(node.value)};")
1360
1380
 
1361
- digraph.nodes << <<~DOT
1381
+ digraph.node(<<~DOT)
1362
1382
  #{id} [
1363
1383
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1364
1384
  ];
@@ -1367,8 +1387,8 @@ module Prism
1367
1387
  super
1368
1388
  end
1369
1389
 
1370
- # Visit a ConstantPathTargetNode node.
1371
- def visit_constant_path_target_node(node)
1390
+ #: (ConstantPathTargetNode) -> void
1391
+ def visit_constant_path_target_node(node) # :nodoc:
1372
1392
  table = Table.new("ConstantPathTargetNode")
1373
1393
  id = node_id(node)
1374
1394
 
@@ -1387,7 +1407,7 @@ module Prism
1387
1407
  # name_loc
1388
1408
  table.field("name_loc", location_inspect(node.name_loc))
1389
1409
 
1390
- digraph.nodes << <<~DOT
1410
+ digraph.node(<<~DOT)
1391
1411
  #{id} [
1392
1412
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1393
1413
  ];
@@ -1396,8 +1416,8 @@ module Prism
1396
1416
  super
1397
1417
  end
1398
1418
 
1399
- # Visit a ConstantPathWriteNode node.
1400
- def visit_constant_path_write_node(node)
1419
+ #: (ConstantPathWriteNode) -> void
1420
+ def visit_constant_path_write_node(node) # :nodoc:
1401
1421
  table = Table.new("ConstantPathWriteNode")
1402
1422
  id = node_id(node)
1403
1423
 
@@ -1412,7 +1432,7 @@ module Prism
1412
1432
  table.field("value", port: true)
1413
1433
  digraph.edge("#{id}:value -> #{node_id(node.value)};")
1414
1434
 
1415
- digraph.nodes << <<~DOT
1435
+ digraph.node(<<~DOT)
1416
1436
  #{id} [
1417
1437
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1418
1438
  ];
@@ -1421,15 +1441,15 @@ module Prism
1421
1441
  super
1422
1442
  end
1423
1443
 
1424
- # Visit a ConstantReadNode node.
1425
- def visit_constant_read_node(node)
1444
+ #: (ConstantReadNode) -> void
1445
+ def visit_constant_read_node(node) # :nodoc:
1426
1446
  table = Table.new("ConstantReadNode")
1427
1447
  id = node_id(node)
1428
1448
 
1429
1449
  # name
1430
1450
  table.field("name", node.name.inspect)
1431
1451
 
1432
- digraph.nodes << <<~DOT
1452
+ digraph.node(<<~DOT)
1433
1453
  #{id} [
1434
1454
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1435
1455
  ];
@@ -1438,15 +1458,15 @@ module Prism
1438
1458
  super
1439
1459
  end
1440
1460
 
1441
- # Visit a ConstantTargetNode node.
1442
- def visit_constant_target_node(node)
1461
+ #: (ConstantTargetNode) -> void
1462
+ def visit_constant_target_node(node) # :nodoc:
1443
1463
  table = Table.new("ConstantTargetNode")
1444
1464
  id = node_id(node)
1445
1465
 
1446
1466
  # name
1447
1467
  table.field("name", node.name.inspect)
1448
1468
 
1449
- digraph.nodes << <<~DOT
1469
+ digraph.node(<<~DOT)
1450
1470
  #{id} [
1451
1471
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1452
1472
  ];
@@ -1455,8 +1475,8 @@ module Prism
1455
1475
  super
1456
1476
  end
1457
1477
 
1458
- # Visit a ConstantWriteNode node.
1459
- def visit_constant_write_node(node)
1478
+ #: (ConstantWriteNode) -> void
1479
+ def visit_constant_write_node(node) # :nodoc:
1460
1480
  table = Table.new("ConstantWriteNode")
1461
1481
  id = node_id(node)
1462
1482
 
@@ -1473,7 +1493,7 @@ module Prism
1473
1493
  # operator_loc
1474
1494
  table.field("operator_loc", location_inspect(node.operator_loc))
1475
1495
 
1476
- digraph.nodes << <<~DOT
1496
+ digraph.node(<<~DOT)
1477
1497
  #{id} [
1478
1498
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1479
1499
  ];
@@ -1482,8 +1502,8 @@ module Prism
1482
1502
  super
1483
1503
  end
1484
1504
 
1485
- # Visit a DefNode node.
1486
- def visit_def_node(node)
1505
+ #: (DefNode) -> void
1506
+ def visit_def_node(node) # :nodoc:
1487
1507
  table = Table.new("DefNode")
1488
1508
  id = node_id(node)
1489
1509
 
@@ -1542,7 +1562,7 @@ module Prism
1542
1562
  table.field("end_keyword_loc", location_inspect(end_keyword_loc))
1543
1563
  end
1544
1564
 
1545
- digraph.nodes << <<~DOT
1565
+ digraph.node(<<~DOT)
1546
1566
  #{id} [
1547
1567
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1548
1568
  ];
@@ -1551,8 +1571,8 @@ module Prism
1551
1571
  super
1552
1572
  end
1553
1573
 
1554
- # Visit a DefinedNode node.
1555
- def visit_defined_node(node)
1574
+ #: (DefinedNode) -> void
1575
+ def visit_defined_node(node) # :nodoc:
1556
1576
  table = Table.new("DefinedNode")
1557
1577
  id = node_id(node)
1558
1578
 
@@ -1573,7 +1593,7 @@ module Prism
1573
1593
  # keyword_loc
1574
1594
  table.field("keyword_loc", location_inspect(node.keyword_loc))
1575
1595
 
1576
- digraph.nodes << <<~DOT
1596
+ digraph.node(<<~DOT)
1577
1597
  #{id} [
1578
1598
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1579
1599
  ];
@@ -1582,8 +1602,8 @@ module Prism
1582
1602
  super
1583
1603
  end
1584
1604
 
1585
- # Visit a ElseNode node.
1586
- def visit_else_node(node)
1605
+ #: (ElseNode) -> void
1606
+ def visit_else_node(node) # :nodoc:
1587
1607
  table = Table.new("ElseNode")
1588
1608
  id = node_id(node)
1589
1609
 
@@ -1601,7 +1621,7 @@ module Prism
1601
1621
  table.field("end_keyword_loc", location_inspect(end_keyword_loc))
1602
1622
  end
1603
1623
 
1604
- digraph.nodes << <<~DOT
1624
+ digraph.node(<<~DOT)
1605
1625
  #{id} [
1606
1626
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1607
1627
  ];
@@ -1610,8 +1630,8 @@ module Prism
1610
1630
  super
1611
1631
  end
1612
1632
 
1613
- # Visit a EmbeddedStatementsNode node.
1614
- def visit_embedded_statements_node(node)
1633
+ #: (EmbeddedStatementsNode) -> void
1634
+ def visit_embedded_statements_node(node) # :nodoc:
1615
1635
  table = Table.new("EmbeddedStatementsNode")
1616
1636
  id = node_id(node)
1617
1637
 
@@ -1627,7 +1647,7 @@ module Prism
1627
1647
  # closing_loc
1628
1648
  table.field("closing_loc", location_inspect(node.closing_loc))
1629
1649
 
1630
- digraph.nodes << <<~DOT
1650
+ digraph.node(<<~DOT)
1631
1651
  #{id} [
1632
1652
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1633
1653
  ];
@@ -1636,8 +1656,8 @@ module Prism
1636
1656
  super
1637
1657
  end
1638
1658
 
1639
- # Visit a EmbeddedVariableNode node.
1640
- def visit_embedded_variable_node(node)
1659
+ #: (EmbeddedVariableNode) -> void
1660
+ def visit_embedded_variable_node(node) # :nodoc:
1641
1661
  table = Table.new("EmbeddedVariableNode")
1642
1662
  id = node_id(node)
1643
1663
 
@@ -1648,7 +1668,7 @@ module Prism
1648
1668
  table.field("variable", port: true)
1649
1669
  digraph.edge("#{id}:variable -> #{node_id(node.variable)};")
1650
1670
 
1651
- digraph.nodes << <<~DOT
1671
+ digraph.node(<<~DOT)
1652
1672
  #{id} [
1653
1673
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1654
1674
  ];
@@ -1657,8 +1677,8 @@ module Prism
1657
1677
  super
1658
1678
  end
1659
1679
 
1660
- # Visit a EnsureNode node.
1661
- def visit_ensure_node(node)
1680
+ #: (EnsureNode) -> void
1681
+ def visit_ensure_node(node) # :nodoc:
1662
1682
  table = Table.new("EnsureNode")
1663
1683
  id = node_id(node)
1664
1684
 
@@ -1674,7 +1694,7 @@ module Prism
1674
1694
  # end_keyword_loc
1675
1695
  table.field("end_keyword_loc", location_inspect(node.end_keyword_loc))
1676
1696
 
1677
- digraph.nodes << <<~DOT
1697
+ digraph.node(<<~DOT)
1678
1698
  #{id} [
1679
1699
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1680
1700
  ];
@@ -1683,12 +1703,32 @@ module Prism
1683
1703
  super
1684
1704
  end
1685
1705
 
1686
- # Visit a FalseNode node.
1687
- def visit_false_node(node)
1706
+ #: (ErrorRecoveryNode) -> void
1707
+ def visit_error_recovery_node(node) # :nodoc:
1708
+ table = Table.new("ErrorRecoveryNode")
1709
+ id = node_id(node)
1710
+
1711
+ # unexpected
1712
+ unless (unexpected = node.unexpected).nil?
1713
+ table.field("unexpected", port: true)
1714
+ digraph.edge("#{id}:unexpected -> #{node_id(unexpected)};")
1715
+ end
1716
+
1717
+ digraph.node(<<~DOT)
1718
+ #{id} [
1719
+ label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1720
+ ];
1721
+ DOT
1722
+
1723
+ super
1724
+ end
1725
+
1726
+ #: (FalseNode) -> void
1727
+ def visit_false_node(node) # :nodoc:
1688
1728
  table = Table.new("FalseNode")
1689
1729
  id = node_id(node)
1690
1730
 
1691
- digraph.nodes << <<~DOT
1731
+ digraph.node(<<~DOT)
1692
1732
  #{id} [
1693
1733
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1694
1734
  ];
@@ -1697,8 +1737,8 @@ module Prism
1697
1737
  super
1698
1738
  end
1699
1739
 
1700
- # Visit a FindPatternNode node.
1701
- def visit_find_pattern_node(node)
1740
+ #: (FindPatternNode) -> void
1741
+ def visit_find_pattern_node(node) # :nodoc:
1702
1742
  table = Table.new("FindPatternNode")
1703
1743
  id = node_id(node)
1704
1744
 
@@ -1739,7 +1779,7 @@ module Prism
1739
1779
  table.field("closing_loc", location_inspect(closing_loc))
1740
1780
  end
1741
1781
 
1742
- digraph.nodes << <<~DOT
1782
+ digraph.node(<<~DOT)
1743
1783
  #{id} [
1744
1784
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1745
1785
  ];
@@ -1748,8 +1788,8 @@ module Prism
1748
1788
  super
1749
1789
  end
1750
1790
 
1751
- # Visit a FlipFlopNode node.
1752
- def visit_flip_flop_node(node)
1791
+ #: (FlipFlopNode) -> void
1792
+ def visit_flip_flop_node(node) # :nodoc:
1753
1793
  table = Table.new("FlipFlopNode")
1754
1794
  id = node_id(node)
1755
1795
 
@@ -1771,7 +1811,7 @@ module Prism
1771
1811
  # operator_loc
1772
1812
  table.field("operator_loc", location_inspect(node.operator_loc))
1773
1813
 
1774
- digraph.nodes << <<~DOT
1814
+ digraph.node(<<~DOT)
1775
1815
  #{id} [
1776
1816
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1777
1817
  ];
@@ -1780,15 +1820,15 @@ module Prism
1780
1820
  super
1781
1821
  end
1782
1822
 
1783
- # Visit a FloatNode node.
1784
- def visit_float_node(node)
1823
+ #: (FloatNode) -> void
1824
+ def visit_float_node(node) # :nodoc:
1785
1825
  table = Table.new("FloatNode")
1786
1826
  id = node_id(node)
1787
1827
 
1788
1828
  # value
1789
1829
  table.field("value", node.value.inspect)
1790
1830
 
1791
- digraph.nodes << <<~DOT
1831
+ digraph.node(<<~DOT)
1792
1832
  #{id} [
1793
1833
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1794
1834
  ];
@@ -1797,8 +1837,8 @@ module Prism
1797
1837
  super
1798
1838
  end
1799
1839
 
1800
- # Visit a ForNode node.
1801
- def visit_for_node(node)
1840
+ #: (ForNode) -> void
1841
+ def visit_for_node(node) # :nodoc:
1802
1842
  table = Table.new("ForNode")
1803
1843
  id = node_id(node)
1804
1844
 
@@ -1830,7 +1870,7 @@ module Prism
1830
1870
  # end_keyword_loc
1831
1871
  table.field("end_keyword_loc", location_inspect(node.end_keyword_loc))
1832
1872
 
1833
- digraph.nodes << <<~DOT
1873
+ digraph.node(<<~DOT)
1834
1874
  #{id} [
1835
1875
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1836
1876
  ];
@@ -1839,12 +1879,12 @@ module Prism
1839
1879
  super
1840
1880
  end
1841
1881
 
1842
- # Visit a ForwardingArgumentsNode node.
1843
- def visit_forwarding_arguments_node(node)
1882
+ #: (ForwardingArgumentsNode) -> void
1883
+ def visit_forwarding_arguments_node(node) # :nodoc:
1844
1884
  table = Table.new("ForwardingArgumentsNode")
1845
1885
  id = node_id(node)
1846
1886
 
1847
- digraph.nodes << <<~DOT
1887
+ digraph.node(<<~DOT)
1848
1888
  #{id} [
1849
1889
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1850
1890
  ];
@@ -1853,12 +1893,12 @@ module Prism
1853
1893
  super
1854
1894
  end
1855
1895
 
1856
- # Visit a ForwardingParameterNode node.
1857
- def visit_forwarding_parameter_node(node)
1896
+ #: (ForwardingParameterNode) -> void
1897
+ def visit_forwarding_parameter_node(node) # :nodoc:
1858
1898
  table = Table.new("ForwardingParameterNode")
1859
1899
  id = node_id(node)
1860
1900
 
1861
- digraph.nodes << <<~DOT
1901
+ digraph.node(<<~DOT)
1862
1902
  #{id} [
1863
1903
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1864
1904
  ];
@@ -1867,18 +1907,21 @@ module Prism
1867
1907
  super
1868
1908
  end
1869
1909
 
1870
- # Visit a ForwardingSuperNode node.
1871
- def visit_forwarding_super_node(node)
1910
+ #: (ForwardingSuperNode) -> void
1911
+ def visit_forwarding_super_node(node) # :nodoc:
1872
1912
  table = Table.new("ForwardingSuperNode")
1873
1913
  id = node_id(node)
1874
1914
 
1915
+ # keyword_loc
1916
+ table.field("keyword_loc", location_inspect(node.keyword_loc))
1917
+
1875
1918
  # block
1876
1919
  unless (block = node.block).nil?
1877
1920
  table.field("block", port: true)
1878
1921
  digraph.edge("#{id}:block -> #{node_id(block)};")
1879
1922
  end
1880
1923
 
1881
- digraph.nodes << <<~DOT
1924
+ digraph.node(<<~DOT)
1882
1925
  #{id} [
1883
1926
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1884
1927
  ];
@@ -1887,8 +1930,8 @@ module Prism
1887
1930
  super
1888
1931
  end
1889
1932
 
1890
- # Visit a GlobalVariableAndWriteNode node.
1891
- def visit_global_variable_and_write_node(node)
1933
+ #: (GlobalVariableAndWriteNode) -> void
1934
+ def visit_global_variable_and_write_node(node) # :nodoc:
1892
1935
  table = Table.new("GlobalVariableAndWriteNode")
1893
1936
  id = node_id(node)
1894
1937
 
@@ -1905,7 +1948,7 @@ module Prism
1905
1948
  table.field("value", port: true)
1906
1949
  digraph.edge("#{id}:value -> #{node_id(node.value)};")
1907
1950
 
1908
- digraph.nodes << <<~DOT
1951
+ digraph.node(<<~DOT)
1909
1952
  #{id} [
1910
1953
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1911
1954
  ];
@@ -1914,8 +1957,8 @@ module Prism
1914
1957
  super
1915
1958
  end
1916
1959
 
1917
- # Visit a GlobalVariableOperatorWriteNode node.
1918
- def visit_global_variable_operator_write_node(node)
1960
+ #: (GlobalVariableOperatorWriteNode) -> void
1961
+ def visit_global_variable_operator_write_node(node) # :nodoc:
1919
1962
  table = Table.new("GlobalVariableOperatorWriteNode")
1920
1963
  id = node_id(node)
1921
1964
 
@@ -1935,7 +1978,7 @@ module Prism
1935
1978
  # binary_operator
1936
1979
  table.field("binary_operator", node.binary_operator.inspect)
1937
1980
 
1938
- digraph.nodes << <<~DOT
1981
+ digraph.node(<<~DOT)
1939
1982
  #{id} [
1940
1983
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1941
1984
  ];
@@ -1944,8 +1987,8 @@ module Prism
1944
1987
  super
1945
1988
  end
1946
1989
 
1947
- # Visit a GlobalVariableOrWriteNode node.
1948
- def visit_global_variable_or_write_node(node)
1990
+ #: (GlobalVariableOrWriteNode) -> void
1991
+ def visit_global_variable_or_write_node(node) # :nodoc:
1949
1992
  table = Table.new("GlobalVariableOrWriteNode")
1950
1993
  id = node_id(node)
1951
1994
 
@@ -1962,7 +2005,7 @@ module Prism
1962
2005
  table.field("value", port: true)
1963
2006
  digraph.edge("#{id}:value -> #{node_id(node.value)};")
1964
2007
 
1965
- digraph.nodes << <<~DOT
2008
+ digraph.node(<<~DOT)
1966
2009
  #{id} [
1967
2010
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1968
2011
  ];
@@ -1971,15 +2014,15 @@ module Prism
1971
2014
  super
1972
2015
  end
1973
2016
 
1974
- # Visit a GlobalVariableReadNode node.
1975
- def visit_global_variable_read_node(node)
2017
+ #: (GlobalVariableReadNode) -> void
2018
+ def visit_global_variable_read_node(node) # :nodoc:
1976
2019
  table = Table.new("GlobalVariableReadNode")
1977
2020
  id = node_id(node)
1978
2021
 
1979
2022
  # name
1980
2023
  table.field("name", node.name.inspect)
1981
2024
 
1982
- digraph.nodes << <<~DOT
2025
+ digraph.node(<<~DOT)
1983
2026
  #{id} [
1984
2027
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
1985
2028
  ];
@@ -1988,15 +2031,15 @@ module Prism
1988
2031
  super
1989
2032
  end
1990
2033
 
1991
- # Visit a GlobalVariableTargetNode node.
1992
- def visit_global_variable_target_node(node)
2034
+ #: (GlobalVariableTargetNode) -> void
2035
+ def visit_global_variable_target_node(node) # :nodoc:
1993
2036
  table = Table.new("GlobalVariableTargetNode")
1994
2037
  id = node_id(node)
1995
2038
 
1996
2039
  # name
1997
2040
  table.field("name", node.name.inspect)
1998
2041
 
1999
- digraph.nodes << <<~DOT
2042
+ digraph.node(<<~DOT)
2000
2043
  #{id} [
2001
2044
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
2002
2045
  ];
@@ -2005,8 +2048,8 @@ module Prism
2005
2048
  super
2006
2049
  end
2007
2050
 
2008
- # Visit a GlobalVariableWriteNode node.
2009
- def visit_global_variable_write_node(node)
2051
+ #: (GlobalVariableWriteNode) -> void
2052
+ def visit_global_variable_write_node(node) # :nodoc:
2010
2053
  table = Table.new("GlobalVariableWriteNode")
2011
2054
  id = node_id(node)
2012
2055
 
@@ -2023,7 +2066,7 @@ module Prism
2023
2066
  # operator_loc
2024
2067
  table.field("operator_loc", location_inspect(node.operator_loc))
2025
2068
 
2026
- digraph.nodes << <<~DOT
2069
+ digraph.node(<<~DOT)
2027
2070
  #{id} [
2028
2071
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
2029
2072
  ];
@@ -2032,8 +2075,8 @@ module Prism
2032
2075
  super
2033
2076
  end
2034
2077
 
2035
- # Visit a HashNode node.
2036
- def visit_hash_node(node)
2078
+ #: (HashNode) -> void
2079
+ def visit_hash_node(node) # :nodoc:
2037
2080
  table = Table.new("HashNode")
2038
2081
  id = node_id(node)
2039
2082
 
@@ -2056,7 +2099,7 @@ module Prism
2056
2099
  # closing_loc
2057
2100
  table.field("closing_loc", location_inspect(node.closing_loc))
2058
2101
 
2059
- digraph.nodes << <<~DOT
2102
+ digraph.node(<<~DOT)
2060
2103
  #{id} [
2061
2104
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
2062
2105
  ];
@@ -2065,8 +2108,8 @@ module Prism
2065
2108
  super
2066
2109
  end
2067
2110
 
2068
- # Visit a HashPatternNode node.
2069
- def visit_hash_pattern_node(node)
2111
+ #: (HashPatternNode) -> void
2112
+ def visit_hash_pattern_node(node) # :nodoc:
2070
2113
  table = Table.new("HashPatternNode")
2071
2114
  id = node_id(node)
2072
2115
 
@@ -2105,7 +2148,7 @@ module Prism
2105
2148
  table.field("closing_loc", location_inspect(closing_loc))
2106
2149
  end
2107
2150
 
2108
- digraph.nodes << <<~DOT
2151
+ digraph.node(<<~DOT)
2109
2152
  #{id} [
2110
2153
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
2111
2154
  ];
@@ -2114,8 +2157,8 @@ module Prism
2114
2157
  super
2115
2158
  end
2116
2159
 
2117
- # Visit a IfNode node.
2118
- def visit_if_node(node)
2160
+ #: (IfNode) -> void
2161
+ def visit_if_node(node) # :nodoc:
2119
2162
  table = Table.new("IfNode")
2120
2163
  id = node_id(node)
2121
2164
 
@@ -2150,7 +2193,7 @@ module Prism
2150
2193
  table.field("end_keyword_loc", location_inspect(end_keyword_loc))
2151
2194
  end
2152
2195
 
2153
- digraph.nodes << <<~DOT
2196
+ digraph.node(<<~DOT)
2154
2197
  #{id} [
2155
2198
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
2156
2199
  ];
@@ -2159,8 +2202,8 @@ module Prism
2159
2202
  super
2160
2203
  end
2161
2204
 
2162
- # Visit a ImaginaryNode node.
2163
- def visit_imaginary_node(node)
2205
+ #: (ImaginaryNode) -> void
2206
+ def visit_imaginary_node(node) # :nodoc:
2164
2207
  table = Table.new("ImaginaryNode")
2165
2208
  id = node_id(node)
2166
2209
 
@@ -2168,7 +2211,7 @@ module Prism
2168
2211
  table.field("numeric", port: true)
2169
2212
  digraph.edge("#{id}:numeric -> #{node_id(node.numeric)};")
2170
2213
 
2171
- digraph.nodes << <<~DOT
2214
+ digraph.node(<<~DOT)
2172
2215
  #{id} [
2173
2216
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
2174
2217
  ];
@@ -2177,8 +2220,8 @@ module Prism
2177
2220
  super
2178
2221
  end
2179
2222
 
2180
- # Visit a ImplicitNode node.
2181
- def visit_implicit_node(node)
2223
+ #: (ImplicitNode) -> void
2224
+ def visit_implicit_node(node) # :nodoc:
2182
2225
  table = Table.new("ImplicitNode")
2183
2226
  id = node_id(node)
2184
2227
 
@@ -2186,7 +2229,7 @@ module Prism
2186
2229
  table.field("value", port: true)
2187
2230
  digraph.edge("#{id}:value -> #{node_id(node.value)};")
2188
2231
 
2189
- digraph.nodes << <<~DOT
2232
+ digraph.node(<<~DOT)
2190
2233
  #{id} [
2191
2234
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
2192
2235
  ];
@@ -2195,12 +2238,12 @@ module Prism
2195
2238
  super
2196
2239
  end
2197
2240
 
2198
- # Visit a ImplicitRestNode node.
2199
- def visit_implicit_rest_node(node)
2241
+ #: (ImplicitRestNode) -> void
2242
+ def visit_implicit_rest_node(node) # :nodoc:
2200
2243
  table = Table.new("ImplicitRestNode")
2201
2244
  id = node_id(node)
2202
2245
 
2203
- digraph.nodes << <<~DOT
2246
+ digraph.node(<<~DOT)
2204
2247
  #{id} [
2205
2248
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
2206
2249
  ];
@@ -2209,8 +2252,8 @@ module Prism
2209
2252
  super
2210
2253
  end
2211
2254
 
2212
- # Visit a InNode node.
2213
- def visit_in_node(node)
2255
+ #: (InNode) -> void
2256
+ def visit_in_node(node) # :nodoc:
2214
2257
  table = Table.new("InNode")
2215
2258
  id = node_id(node)
2216
2259
 
@@ -2224,15 +2267,15 @@ module Prism
2224
2267
  digraph.edge("#{id}:statements -> #{node_id(statements)};")
2225
2268
  end
2226
2269
 
2227
- # in_loc
2228
- table.field("in_loc", location_inspect(node.in_loc))
2270
+ # in_keyword_loc
2271
+ table.field("in_keyword_loc", location_inspect(node.in_keyword_loc))
2229
2272
 
2230
- # then_loc
2231
- unless (then_loc = node.then_loc).nil?
2232
- table.field("then_loc", location_inspect(then_loc))
2273
+ # then_keyword_loc
2274
+ unless (then_keyword_loc = node.then_keyword_loc).nil?
2275
+ table.field("then_keyword_loc", location_inspect(then_keyword_loc))
2233
2276
  end
2234
2277
 
2235
- digraph.nodes << <<~DOT
2278
+ digraph.node(<<~DOT)
2236
2279
  #{id} [
2237
2280
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
2238
2281
  ];
@@ -2241,8 +2284,8 @@ module Prism
2241
2284
  super
2242
2285
  end
2243
2286
 
2244
- # Visit a IndexAndWriteNode node.
2245
- def visit_index_and_write_node(node)
2287
+ #: (IndexAndWriteNode) -> void
2288
+ def visit_index_and_write_node(node) # :nodoc:
2246
2289
  table = Table.new("IndexAndWriteNode")
2247
2290
  id = node_id(node)
2248
2291
 
@@ -2285,7 +2328,7 @@ module Prism
2285
2328
  table.field("value", port: true)
2286
2329
  digraph.edge("#{id}:value -> #{node_id(node.value)};")
2287
2330
 
2288
- digraph.nodes << <<~DOT
2331
+ digraph.node(<<~DOT)
2289
2332
  #{id} [
2290
2333
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
2291
2334
  ];
@@ -2294,8 +2337,8 @@ module Prism
2294
2337
  super
2295
2338
  end
2296
2339
 
2297
- # Visit a IndexOperatorWriteNode node.
2298
- def visit_index_operator_write_node(node)
2340
+ #: (IndexOperatorWriteNode) -> void
2341
+ def visit_index_operator_write_node(node) # :nodoc:
2299
2342
  table = Table.new("IndexOperatorWriteNode")
2300
2343
  id = node_id(node)
2301
2344
 
@@ -2341,7 +2384,7 @@ module Prism
2341
2384
  table.field("value", port: true)
2342
2385
  digraph.edge("#{id}:value -> #{node_id(node.value)};")
2343
2386
 
2344
- digraph.nodes << <<~DOT
2387
+ digraph.node(<<~DOT)
2345
2388
  #{id} [
2346
2389
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
2347
2390
  ];
@@ -2350,8 +2393,8 @@ module Prism
2350
2393
  super
2351
2394
  end
2352
2395
 
2353
- # Visit a IndexOrWriteNode node.
2354
- def visit_index_or_write_node(node)
2396
+ #: (IndexOrWriteNode) -> void
2397
+ def visit_index_or_write_node(node) # :nodoc:
2355
2398
  table = Table.new("IndexOrWriteNode")
2356
2399
  id = node_id(node)
2357
2400
 
@@ -2394,7 +2437,7 @@ module Prism
2394
2437
  table.field("value", port: true)
2395
2438
  digraph.edge("#{id}:value -> #{node_id(node.value)};")
2396
2439
 
2397
- digraph.nodes << <<~DOT
2440
+ digraph.node(<<~DOT)
2398
2441
  #{id} [
2399
2442
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
2400
2443
  ];
@@ -2403,8 +2446,8 @@ module Prism
2403
2446
  super
2404
2447
  end
2405
2448
 
2406
- # Visit a IndexTargetNode node.
2407
- def visit_index_target_node(node)
2449
+ #: (IndexTargetNode) -> void
2450
+ def visit_index_target_node(node) # :nodoc:
2408
2451
  table = Table.new("IndexTargetNode")
2409
2452
  id = node_id(node)
2410
2453
 
@@ -2433,7 +2476,7 @@ module Prism
2433
2476
  digraph.edge("#{id}:block -> #{node_id(block)};")
2434
2477
  end
2435
2478
 
2436
- digraph.nodes << <<~DOT
2479
+ digraph.node(<<~DOT)
2437
2480
  #{id} [
2438
2481
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
2439
2482
  ];
@@ -2442,8 +2485,8 @@ module Prism
2442
2485
  super
2443
2486
  end
2444
2487
 
2445
- # Visit a InstanceVariableAndWriteNode node.
2446
- def visit_instance_variable_and_write_node(node)
2488
+ #: (InstanceVariableAndWriteNode) -> void
2489
+ def visit_instance_variable_and_write_node(node) # :nodoc:
2447
2490
  table = Table.new("InstanceVariableAndWriteNode")
2448
2491
  id = node_id(node)
2449
2492
 
@@ -2460,7 +2503,7 @@ module Prism
2460
2503
  table.field("value", port: true)
2461
2504
  digraph.edge("#{id}:value -> #{node_id(node.value)};")
2462
2505
 
2463
- digraph.nodes << <<~DOT
2506
+ digraph.node(<<~DOT)
2464
2507
  #{id} [
2465
2508
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
2466
2509
  ];
@@ -2469,8 +2512,8 @@ module Prism
2469
2512
  super
2470
2513
  end
2471
2514
 
2472
- # Visit a InstanceVariableOperatorWriteNode node.
2473
- def visit_instance_variable_operator_write_node(node)
2515
+ #: (InstanceVariableOperatorWriteNode) -> void
2516
+ def visit_instance_variable_operator_write_node(node) # :nodoc:
2474
2517
  table = Table.new("InstanceVariableOperatorWriteNode")
2475
2518
  id = node_id(node)
2476
2519
 
@@ -2490,7 +2533,7 @@ module Prism
2490
2533
  # binary_operator
2491
2534
  table.field("binary_operator", node.binary_operator.inspect)
2492
2535
 
2493
- digraph.nodes << <<~DOT
2536
+ digraph.node(<<~DOT)
2494
2537
  #{id} [
2495
2538
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
2496
2539
  ];
@@ -2499,8 +2542,8 @@ module Prism
2499
2542
  super
2500
2543
  end
2501
2544
 
2502
- # Visit a InstanceVariableOrWriteNode node.
2503
- def visit_instance_variable_or_write_node(node)
2545
+ #: (InstanceVariableOrWriteNode) -> void
2546
+ def visit_instance_variable_or_write_node(node) # :nodoc:
2504
2547
  table = Table.new("InstanceVariableOrWriteNode")
2505
2548
  id = node_id(node)
2506
2549
 
@@ -2517,7 +2560,7 @@ module Prism
2517
2560
  table.field("value", port: true)
2518
2561
  digraph.edge("#{id}:value -> #{node_id(node.value)};")
2519
2562
 
2520
- digraph.nodes << <<~DOT
2563
+ digraph.node(<<~DOT)
2521
2564
  #{id} [
2522
2565
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
2523
2566
  ];
@@ -2526,15 +2569,15 @@ module Prism
2526
2569
  super
2527
2570
  end
2528
2571
 
2529
- # Visit a InstanceVariableReadNode node.
2530
- def visit_instance_variable_read_node(node)
2572
+ #: (InstanceVariableReadNode) -> void
2573
+ def visit_instance_variable_read_node(node) # :nodoc:
2531
2574
  table = Table.new("InstanceVariableReadNode")
2532
2575
  id = node_id(node)
2533
2576
 
2534
2577
  # name
2535
2578
  table.field("name", node.name.inspect)
2536
2579
 
2537
- digraph.nodes << <<~DOT
2580
+ digraph.node(<<~DOT)
2538
2581
  #{id} [
2539
2582
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
2540
2583
  ];
@@ -2543,15 +2586,15 @@ module Prism
2543
2586
  super
2544
2587
  end
2545
2588
 
2546
- # Visit a InstanceVariableTargetNode node.
2547
- def visit_instance_variable_target_node(node)
2589
+ #: (InstanceVariableTargetNode) -> void
2590
+ def visit_instance_variable_target_node(node) # :nodoc:
2548
2591
  table = Table.new("InstanceVariableTargetNode")
2549
2592
  id = node_id(node)
2550
2593
 
2551
2594
  # name
2552
2595
  table.field("name", node.name.inspect)
2553
2596
 
2554
- digraph.nodes << <<~DOT
2597
+ digraph.node(<<~DOT)
2555
2598
  #{id} [
2556
2599
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
2557
2600
  ];
@@ -2560,8 +2603,8 @@ module Prism
2560
2603
  super
2561
2604
  end
2562
2605
 
2563
- # Visit a InstanceVariableWriteNode node.
2564
- def visit_instance_variable_write_node(node)
2606
+ #: (InstanceVariableWriteNode) -> void
2607
+ def visit_instance_variable_write_node(node) # :nodoc:
2565
2608
  table = Table.new("InstanceVariableWriteNode")
2566
2609
  id = node_id(node)
2567
2610
 
@@ -2578,7 +2621,7 @@ module Prism
2578
2621
  # operator_loc
2579
2622
  table.field("operator_loc", location_inspect(node.operator_loc))
2580
2623
 
2581
- digraph.nodes << <<~DOT
2624
+ digraph.node(<<~DOT)
2582
2625
  #{id} [
2583
2626
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
2584
2627
  ];
@@ -2587,8 +2630,8 @@ module Prism
2587
2630
  super
2588
2631
  end
2589
2632
 
2590
- # Visit a IntegerNode node.
2591
- def visit_integer_node(node)
2633
+ #: (IntegerNode) -> void
2634
+ def visit_integer_node(node) # :nodoc:
2592
2635
  table = Table.new("IntegerNode")
2593
2636
  id = node_id(node)
2594
2637
 
@@ -2598,7 +2641,7 @@ module Prism
2598
2641
  # value
2599
2642
  table.field("value", node.value.inspect)
2600
2643
 
2601
- digraph.nodes << <<~DOT
2644
+ digraph.node(<<~DOT)
2602
2645
  #{id} [
2603
2646
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
2604
2647
  ];
@@ -2607,8 +2650,8 @@ module Prism
2607
2650
  super
2608
2651
  end
2609
2652
 
2610
- # Visit a InterpolatedMatchLastLineNode node.
2611
- def visit_interpolated_match_last_line_node(node)
2653
+ #: (InterpolatedMatchLastLineNode) -> void
2654
+ def visit_interpolated_match_last_line_node(node) # :nodoc:
2612
2655
  table = Table.new("InterpolatedMatchLastLineNode")
2613
2656
  id = node_id(node)
2614
2657
 
@@ -2634,7 +2677,7 @@ module Prism
2634
2677
  # closing_loc
2635
2678
  table.field("closing_loc", location_inspect(node.closing_loc))
2636
2679
 
2637
- digraph.nodes << <<~DOT
2680
+ digraph.node(<<~DOT)
2638
2681
  #{id} [
2639
2682
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
2640
2683
  ];
@@ -2643,8 +2686,8 @@ module Prism
2643
2686
  super
2644
2687
  end
2645
2688
 
2646
- # Visit a InterpolatedRegularExpressionNode node.
2647
- def visit_interpolated_regular_expression_node(node)
2689
+ #: (InterpolatedRegularExpressionNode) -> void
2690
+ def visit_interpolated_regular_expression_node(node) # :nodoc:
2648
2691
  table = Table.new("InterpolatedRegularExpressionNode")
2649
2692
  id = node_id(node)
2650
2693
 
@@ -2670,7 +2713,7 @@ module Prism
2670
2713
  # closing_loc
2671
2714
  table.field("closing_loc", location_inspect(node.closing_loc))
2672
2715
 
2673
- digraph.nodes << <<~DOT
2716
+ digraph.node(<<~DOT)
2674
2717
  #{id} [
2675
2718
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
2676
2719
  ];
@@ -2679,8 +2722,8 @@ module Prism
2679
2722
  super
2680
2723
  end
2681
2724
 
2682
- # Visit a InterpolatedStringNode node.
2683
- def visit_interpolated_string_node(node)
2725
+ #: (InterpolatedStringNode) -> void
2726
+ def visit_interpolated_string_node(node) # :nodoc:
2684
2727
  table = Table.new("InterpolatedStringNode")
2685
2728
  id = node_id(node)
2686
2729
 
@@ -2710,7 +2753,7 @@ module Prism
2710
2753
  table.field("closing_loc", location_inspect(closing_loc))
2711
2754
  end
2712
2755
 
2713
- digraph.nodes << <<~DOT
2756
+ digraph.node(<<~DOT)
2714
2757
  #{id} [
2715
2758
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
2716
2759
  ];
@@ -2719,8 +2762,8 @@ module Prism
2719
2762
  super
2720
2763
  end
2721
2764
 
2722
- # Visit a InterpolatedSymbolNode node.
2723
- def visit_interpolated_symbol_node(node)
2765
+ #: (InterpolatedSymbolNode) -> void
2766
+ def visit_interpolated_symbol_node(node) # :nodoc:
2724
2767
  table = Table.new("InterpolatedSymbolNode")
2725
2768
  id = node_id(node)
2726
2769
 
@@ -2747,7 +2790,7 @@ module Prism
2747
2790
  table.field("closing_loc", location_inspect(closing_loc))
2748
2791
  end
2749
2792
 
2750
- digraph.nodes << <<~DOT
2793
+ digraph.node(<<~DOT)
2751
2794
  #{id} [
2752
2795
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
2753
2796
  ];
@@ -2756,8 +2799,8 @@ module Prism
2756
2799
  super
2757
2800
  end
2758
2801
 
2759
- # Visit a InterpolatedXStringNode node.
2760
- def visit_interpolated_x_string_node(node)
2802
+ #: (InterpolatedXStringNode) -> void
2803
+ def visit_interpolated_x_string_node(node) # :nodoc:
2761
2804
  table = Table.new("InterpolatedXStringNode")
2762
2805
  id = node_id(node)
2763
2806
 
@@ -2780,7 +2823,7 @@ module Prism
2780
2823
  # closing_loc
2781
2824
  table.field("closing_loc", location_inspect(node.closing_loc))
2782
2825
 
2783
- digraph.nodes << <<~DOT
2826
+ digraph.node(<<~DOT)
2784
2827
  #{id} [
2785
2828
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
2786
2829
  ];
@@ -2789,12 +2832,12 @@ module Prism
2789
2832
  super
2790
2833
  end
2791
2834
 
2792
- # Visit a ItLocalVariableReadNode node.
2793
- def visit_it_local_variable_read_node(node)
2835
+ #: (ItLocalVariableReadNode) -> void
2836
+ def visit_it_local_variable_read_node(node) # :nodoc:
2794
2837
  table = Table.new("ItLocalVariableReadNode")
2795
2838
  id = node_id(node)
2796
2839
 
2797
- digraph.nodes << <<~DOT
2840
+ digraph.node(<<~DOT)
2798
2841
  #{id} [
2799
2842
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
2800
2843
  ];
@@ -2803,12 +2846,12 @@ module Prism
2803
2846
  super
2804
2847
  end
2805
2848
 
2806
- # Visit a ItParametersNode node.
2807
- def visit_it_parameters_node(node)
2849
+ #: (ItParametersNode) -> void
2850
+ def visit_it_parameters_node(node) # :nodoc:
2808
2851
  table = Table.new("ItParametersNode")
2809
2852
  id = node_id(node)
2810
2853
 
2811
- digraph.nodes << <<~DOT
2854
+ digraph.node(<<~DOT)
2812
2855
  #{id} [
2813
2856
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
2814
2857
  ];
@@ -2817,8 +2860,8 @@ module Prism
2817
2860
  super
2818
2861
  end
2819
2862
 
2820
- # Visit a KeywordHashNode node.
2821
- def visit_keyword_hash_node(node)
2863
+ #: (KeywordHashNode) -> void
2864
+ def visit_keyword_hash_node(node) # :nodoc:
2822
2865
  table = Table.new("KeywordHashNode")
2823
2866
  id = node_id(node)
2824
2867
 
@@ -2838,7 +2881,7 @@ module Prism
2838
2881
  table.field("elements", "[]")
2839
2882
  end
2840
2883
 
2841
- digraph.nodes << <<~DOT
2884
+ digraph.node(<<~DOT)
2842
2885
  #{id} [
2843
2886
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
2844
2887
  ];
@@ -2847,8 +2890,8 @@ module Prism
2847
2890
  super
2848
2891
  end
2849
2892
 
2850
- # Visit a KeywordRestParameterNode node.
2851
- def visit_keyword_rest_parameter_node(node)
2893
+ #: (KeywordRestParameterNode) -> void
2894
+ def visit_keyword_rest_parameter_node(node) # :nodoc:
2852
2895
  table = Table.new("KeywordRestParameterNode")
2853
2896
  id = node_id(node)
2854
2897
 
@@ -2866,7 +2909,7 @@ module Prism
2866
2909
  # operator_loc
2867
2910
  table.field("operator_loc", location_inspect(node.operator_loc))
2868
2911
 
2869
- digraph.nodes << <<~DOT
2912
+ digraph.node(<<~DOT)
2870
2913
  #{id} [
2871
2914
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
2872
2915
  ];
@@ -2875,8 +2918,8 @@ module Prism
2875
2918
  super
2876
2919
  end
2877
2920
 
2878
- # Visit a LambdaNode node.
2879
- def visit_lambda_node(node)
2921
+ #: (LambdaNode) -> void
2922
+ def visit_lambda_node(node) # :nodoc:
2880
2923
  table = Table.new("LambdaNode")
2881
2924
  id = node_id(node)
2882
2925
 
@@ -2904,7 +2947,7 @@ module Prism
2904
2947
  digraph.edge("#{id}:body -> #{node_id(body)};")
2905
2948
  end
2906
2949
 
2907
- digraph.nodes << <<~DOT
2950
+ digraph.node(<<~DOT)
2908
2951
  #{id} [
2909
2952
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
2910
2953
  ];
@@ -2913,8 +2956,8 @@ module Prism
2913
2956
  super
2914
2957
  end
2915
2958
 
2916
- # Visit a LocalVariableAndWriteNode node.
2917
- def visit_local_variable_and_write_node(node)
2959
+ #: (LocalVariableAndWriteNode) -> void
2960
+ def visit_local_variable_and_write_node(node) # :nodoc:
2918
2961
  table = Table.new("LocalVariableAndWriteNode")
2919
2962
  id = node_id(node)
2920
2963
 
@@ -2934,7 +2977,7 @@ module Prism
2934
2977
  # depth
2935
2978
  table.field("depth", node.depth.inspect)
2936
2979
 
2937
- digraph.nodes << <<~DOT
2980
+ digraph.node(<<~DOT)
2938
2981
  #{id} [
2939
2982
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
2940
2983
  ];
@@ -2943,8 +2986,8 @@ module Prism
2943
2986
  super
2944
2987
  end
2945
2988
 
2946
- # Visit a LocalVariableOperatorWriteNode node.
2947
- def visit_local_variable_operator_write_node(node)
2989
+ #: (LocalVariableOperatorWriteNode) -> void
2990
+ def visit_local_variable_operator_write_node(node) # :nodoc:
2948
2991
  table = Table.new("LocalVariableOperatorWriteNode")
2949
2992
  id = node_id(node)
2950
2993
 
@@ -2967,7 +3010,7 @@ module Prism
2967
3010
  # depth
2968
3011
  table.field("depth", node.depth.inspect)
2969
3012
 
2970
- digraph.nodes << <<~DOT
3013
+ digraph.node(<<~DOT)
2971
3014
  #{id} [
2972
3015
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
2973
3016
  ];
@@ -2976,8 +3019,8 @@ module Prism
2976
3019
  super
2977
3020
  end
2978
3021
 
2979
- # Visit a LocalVariableOrWriteNode node.
2980
- def visit_local_variable_or_write_node(node)
3022
+ #: (LocalVariableOrWriteNode) -> void
3023
+ def visit_local_variable_or_write_node(node) # :nodoc:
2981
3024
  table = Table.new("LocalVariableOrWriteNode")
2982
3025
  id = node_id(node)
2983
3026
 
@@ -2997,7 +3040,7 @@ module Prism
2997
3040
  # depth
2998
3041
  table.field("depth", node.depth.inspect)
2999
3042
 
3000
- digraph.nodes << <<~DOT
3043
+ digraph.node(<<~DOT)
3001
3044
  #{id} [
3002
3045
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3003
3046
  ];
@@ -3006,8 +3049,8 @@ module Prism
3006
3049
  super
3007
3050
  end
3008
3051
 
3009
- # Visit a LocalVariableReadNode node.
3010
- def visit_local_variable_read_node(node)
3052
+ #: (LocalVariableReadNode) -> void
3053
+ def visit_local_variable_read_node(node) # :nodoc:
3011
3054
  table = Table.new("LocalVariableReadNode")
3012
3055
  id = node_id(node)
3013
3056
 
@@ -3017,7 +3060,7 @@ module Prism
3017
3060
  # depth
3018
3061
  table.field("depth", node.depth.inspect)
3019
3062
 
3020
- digraph.nodes << <<~DOT
3063
+ digraph.node(<<~DOT)
3021
3064
  #{id} [
3022
3065
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3023
3066
  ];
@@ -3026,8 +3069,8 @@ module Prism
3026
3069
  super
3027
3070
  end
3028
3071
 
3029
- # Visit a LocalVariableTargetNode node.
3030
- def visit_local_variable_target_node(node)
3072
+ #: (LocalVariableTargetNode) -> void
3073
+ def visit_local_variable_target_node(node) # :nodoc:
3031
3074
  table = Table.new("LocalVariableTargetNode")
3032
3075
  id = node_id(node)
3033
3076
 
@@ -3037,7 +3080,7 @@ module Prism
3037
3080
  # depth
3038
3081
  table.field("depth", node.depth.inspect)
3039
3082
 
3040
- digraph.nodes << <<~DOT
3083
+ digraph.node(<<~DOT)
3041
3084
  #{id} [
3042
3085
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3043
3086
  ];
@@ -3046,8 +3089,8 @@ module Prism
3046
3089
  super
3047
3090
  end
3048
3091
 
3049
- # Visit a LocalVariableWriteNode node.
3050
- def visit_local_variable_write_node(node)
3092
+ #: (LocalVariableWriteNode) -> void
3093
+ def visit_local_variable_write_node(node) # :nodoc:
3051
3094
  table = Table.new("LocalVariableWriteNode")
3052
3095
  id = node_id(node)
3053
3096
 
@@ -3067,7 +3110,7 @@ module Prism
3067
3110
  # operator_loc
3068
3111
  table.field("operator_loc", location_inspect(node.operator_loc))
3069
3112
 
3070
- digraph.nodes << <<~DOT
3113
+ digraph.node(<<~DOT)
3071
3114
  #{id} [
3072
3115
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3073
3116
  ];
@@ -3076,8 +3119,8 @@ module Prism
3076
3119
  super
3077
3120
  end
3078
3121
 
3079
- # Visit a MatchLastLineNode node.
3080
- def visit_match_last_line_node(node)
3122
+ #: (MatchLastLineNode) -> void
3123
+ def visit_match_last_line_node(node) # :nodoc:
3081
3124
  table = Table.new("MatchLastLineNode")
3082
3125
  id = node_id(node)
3083
3126
 
@@ -3096,7 +3139,7 @@ module Prism
3096
3139
  # unescaped
3097
3140
  table.field("unescaped", node.unescaped.inspect)
3098
3141
 
3099
- digraph.nodes << <<~DOT
3142
+ digraph.node(<<~DOT)
3100
3143
  #{id} [
3101
3144
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3102
3145
  ];
@@ -3105,8 +3148,8 @@ module Prism
3105
3148
  super
3106
3149
  end
3107
3150
 
3108
- # Visit a MatchPredicateNode node.
3109
- def visit_match_predicate_node(node)
3151
+ #: (MatchPredicateNode) -> void
3152
+ def visit_match_predicate_node(node) # :nodoc:
3110
3153
  table = Table.new("MatchPredicateNode")
3111
3154
  id = node_id(node)
3112
3155
 
@@ -3118,10 +3161,10 @@ module Prism
3118
3161
  table.field("pattern", port: true)
3119
3162
  digraph.edge("#{id}:pattern -> #{node_id(node.pattern)};")
3120
3163
 
3121
- # operator_loc
3122
- table.field("operator_loc", location_inspect(node.operator_loc))
3164
+ # keyword_loc
3165
+ table.field("keyword_loc", location_inspect(node.keyword_loc))
3123
3166
 
3124
- digraph.nodes << <<~DOT
3167
+ digraph.node(<<~DOT)
3125
3168
  #{id} [
3126
3169
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3127
3170
  ];
@@ -3130,8 +3173,8 @@ module Prism
3130
3173
  super
3131
3174
  end
3132
3175
 
3133
- # Visit a MatchRequiredNode node.
3134
- def visit_match_required_node(node)
3176
+ #: (MatchRequiredNode) -> void
3177
+ def visit_match_required_node(node) # :nodoc:
3135
3178
  table = Table.new("MatchRequiredNode")
3136
3179
  id = node_id(node)
3137
3180
 
@@ -3146,7 +3189,7 @@ module Prism
3146
3189
  # operator_loc
3147
3190
  table.field("operator_loc", location_inspect(node.operator_loc))
3148
3191
 
3149
- digraph.nodes << <<~DOT
3192
+ digraph.node(<<~DOT)
3150
3193
  #{id} [
3151
3194
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3152
3195
  ];
@@ -3155,8 +3198,8 @@ module Prism
3155
3198
  super
3156
3199
  end
3157
3200
 
3158
- # Visit a MatchWriteNode node.
3159
- def visit_match_write_node(node)
3201
+ #: (MatchWriteNode) -> void
3202
+ def visit_match_write_node(node) # :nodoc:
3160
3203
  table = Table.new("MatchWriteNode")
3161
3204
  id = node_id(node)
3162
3205
 
@@ -3177,21 +3220,7 @@ module Prism
3177
3220
  table.field("targets", "[]")
3178
3221
  end
3179
3222
 
3180
- digraph.nodes << <<~DOT
3181
- #{id} [
3182
- label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3183
- ];
3184
- DOT
3185
-
3186
- super
3187
- end
3188
-
3189
- # Visit a MissingNode node.
3190
- def visit_missing_node(node)
3191
- table = Table.new("MissingNode")
3192
- id = node_id(node)
3193
-
3194
- digraph.nodes << <<~DOT
3223
+ digraph.node(<<~DOT)
3195
3224
  #{id} [
3196
3225
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3197
3226
  ];
@@ -3200,8 +3229,8 @@ module Prism
3200
3229
  super
3201
3230
  end
3202
3231
 
3203
- # Visit a ModuleNode node.
3204
- def visit_module_node(node)
3232
+ #: (ModuleNode) -> void
3233
+ def visit_module_node(node) # :nodoc:
3205
3234
  table = Table.new("ModuleNode")
3206
3235
  id = node_id(node)
3207
3236
 
@@ -3227,7 +3256,7 @@ module Prism
3227
3256
  # name
3228
3257
  table.field("name", node.name.inspect)
3229
3258
 
3230
- digraph.nodes << <<~DOT
3259
+ digraph.node(<<~DOT)
3231
3260
  #{id} [
3232
3261
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3233
3262
  ];
@@ -3236,8 +3265,8 @@ module Prism
3236
3265
  super
3237
3266
  end
3238
3267
 
3239
- # Visit a MultiTargetNode node.
3240
- def visit_multi_target_node(node)
3268
+ #: (MultiTargetNode) -> void
3269
+ def visit_multi_target_node(node) # :nodoc:
3241
3270
  table = Table.new("MultiTargetNode")
3242
3271
  id = node_id(node)
3243
3272
 
@@ -3283,7 +3312,7 @@ module Prism
3283
3312
  table.field("rparen_loc", location_inspect(rparen_loc))
3284
3313
  end
3285
3314
 
3286
- digraph.nodes << <<~DOT
3315
+ digraph.node(<<~DOT)
3287
3316
  #{id} [
3288
3317
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3289
3318
  ];
@@ -3292,8 +3321,8 @@ module Prism
3292
3321
  super
3293
3322
  end
3294
3323
 
3295
- # Visit a MultiWriteNode node.
3296
- def visit_multi_write_node(node)
3324
+ #: (MultiWriteNode) -> void
3325
+ def visit_multi_write_node(node) # :nodoc:
3297
3326
  table = Table.new("MultiWriteNode")
3298
3327
  id = node_id(node)
3299
3328
 
@@ -3346,7 +3375,7 @@ module Prism
3346
3375
  table.field("value", port: true)
3347
3376
  digraph.edge("#{id}:value -> #{node_id(node.value)};")
3348
3377
 
3349
- digraph.nodes << <<~DOT
3378
+ digraph.node(<<~DOT)
3350
3379
  #{id} [
3351
3380
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3352
3381
  ];
@@ -3355,8 +3384,8 @@ module Prism
3355
3384
  super
3356
3385
  end
3357
3386
 
3358
- # Visit a NextNode node.
3359
- def visit_next_node(node)
3387
+ #: (NextNode) -> void
3388
+ def visit_next_node(node) # :nodoc:
3360
3389
  table = Table.new("NextNode")
3361
3390
  id = node_id(node)
3362
3391
 
@@ -3369,7 +3398,7 @@ module Prism
3369
3398
  # keyword_loc
3370
3399
  table.field("keyword_loc", location_inspect(node.keyword_loc))
3371
3400
 
3372
- digraph.nodes << <<~DOT
3401
+ digraph.node(<<~DOT)
3373
3402
  #{id} [
3374
3403
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3375
3404
  ];
@@ -3378,12 +3407,32 @@ module Prism
3378
3407
  super
3379
3408
  end
3380
3409
 
3381
- # Visit a NilNode node.
3382
- def visit_nil_node(node)
3410
+ #: (NilNode) -> void
3411
+ def visit_nil_node(node) # :nodoc:
3383
3412
  table = Table.new("NilNode")
3384
3413
  id = node_id(node)
3385
3414
 
3386
- digraph.nodes << <<~DOT
3415
+ digraph.node(<<~DOT)
3416
+ #{id} [
3417
+ label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3418
+ ];
3419
+ DOT
3420
+
3421
+ super
3422
+ end
3423
+
3424
+ #: (NoBlockParameterNode) -> void
3425
+ def visit_no_block_parameter_node(node) # :nodoc:
3426
+ table = Table.new("NoBlockParameterNode")
3427
+ id = node_id(node)
3428
+
3429
+ # operator_loc
3430
+ table.field("operator_loc", location_inspect(node.operator_loc))
3431
+
3432
+ # keyword_loc
3433
+ table.field("keyword_loc", location_inspect(node.keyword_loc))
3434
+
3435
+ digraph.node(<<~DOT)
3387
3436
  #{id} [
3388
3437
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3389
3438
  ];
@@ -3392,8 +3441,8 @@ module Prism
3392
3441
  super
3393
3442
  end
3394
3443
 
3395
- # Visit a NoKeywordsParameterNode node.
3396
- def visit_no_keywords_parameter_node(node)
3444
+ #: (NoKeywordsParameterNode) -> void
3445
+ def visit_no_keywords_parameter_node(node) # :nodoc:
3397
3446
  table = Table.new("NoKeywordsParameterNode")
3398
3447
  id = node_id(node)
3399
3448
 
@@ -3403,7 +3452,7 @@ module Prism
3403
3452
  # keyword_loc
3404
3453
  table.field("keyword_loc", location_inspect(node.keyword_loc))
3405
3454
 
3406
- digraph.nodes << <<~DOT
3455
+ digraph.node(<<~DOT)
3407
3456
  #{id} [
3408
3457
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3409
3458
  ];
@@ -3412,15 +3461,15 @@ module Prism
3412
3461
  super
3413
3462
  end
3414
3463
 
3415
- # Visit a NumberedParametersNode node.
3416
- def visit_numbered_parameters_node(node)
3464
+ #: (NumberedParametersNode) -> void
3465
+ def visit_numbered_parameters_node(node) # :nodoc:
3417
3466
  table = Table.new("NumberedParametersNode")
3418
3467
  id = node_id(node)
3419
3468
 
3420
3469
  # maximum
3421
3470
  table.field("maximum", node.maximum.inspect)
3422
3471
 
3423
- digraph.nodes << <<~DOT
3472
+ digraph.node(<<~DOT)
3424
3473
  #{id} [
3425
3474
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3426
3475
  ];
@@ -3429,15 +3478,15 @@ module Prism
3429
3478
  super
3430
3479
  end
3431
3480
 
3432
- # Visit a NumberedReferenceReadNode node.
3433
- def visit_numbered_reference_read_node(node)
3481
+ #: (NumberedReferenceReadNode) -> void
3482
+ def visit_numbered_reference_read_node(node) # :nodoc:
3434
3483
  table = Table.new("NumberedReferenceReadNode")
3435
3484
  id = node_id(node)
3436
3485
 
3437
3486
  # number
3438
3487
  table.field("number", node.number.inspect)
3439
3488
 
3440
- digraph.nodes << <<~DOT
3489
+ digraph.node(<<~DOT)
3441
3490
  #{id} [
3442
3491
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3443
3492
  ];
@@ -3446,8 +3495,8 @@ module Prism
3446
3495
  super
3447
3496
  end
3448
3497
 
3449
- # Visit a OptionalKeywordParameterNode node.
3450
- def visit_optional_keyword_parameter_node(node)
3498
+ #: (OptionalKeywordParameterNode) -> void
3499
+ def visit_optional_keyword_parameter_node(node) # :nodoc:
3451
3500
  table = Table.new("OptionalKeywordParameterNode")
3452
3501
  id = node_id(node)
3453
3502
 
@@ -3464,7 +3513,7 @@ module Prism
3464
3513
  table.field("value", port: true)
3465
3514
  digraph.edge("#{id}:value -> #{node_id(node.value)};")
3466
3515
 
3467
- digraph.nodes << <<~DOT
3516
+ digraph.node(<<~DOT)
3468
3517
  #{id} [
3469
3518
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3470
3519
  ];
@@ -3473,8 +3522,8 @@ module Prism
3473
3522
  super
3474
3523
  end
3475
3524
 
3476
- # Visit a OptionalParameterNode node.
3477
- def visit_optional_parameter_node(node)
3525
+ #: (OptionalParameterNode) -> void
3526
+ def visit_optional_parameter_node(node) # :nodoc:
3478
3527
  table = Table.new("OptionalParameterNode")
3479
3528
  id = node_id(node)
3480
3529
 
@@ -3494,7 +3543,7 @@ module Prism
3494
3543
  table.field("value", port: true)
3495
3544
  digraph.edge("#{id}:value -> #{node_id(node.value)};")
3496
3545
 
3497
- digraph.nodes << <<~DOT
3546
+ digraph.node(<<~DOT)
3498
3547
  #{id} [
3499
3548
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3500
3549
  ];
@@ -3503,8 +3552,8 @@ module Prism
3503
3552
  super
3504
3553
  end
3505
3554
 
3506
- # Visit a OrNode node.
3507
- def visit_or_node(node)
3555
+ #: (OrNode) -> void
3556
+ def visit_or_node(node) # :nodoc:
3508
3557
  table = Table.new("OrNode")
3509
3558
  id = node_id(node)
3510
3559
 
@@ -3519,7 +3568,7 @@ module Prism
3519
3568
  # operator_loc
3520
3569
  table.field("operator_loc", location_inspect(node.operator_loc))
3521
3570
 
3522
- digraph.nodes << <<~DOT
3571
+ digraph.node(<<~DOT)
3523
3572
  #{id} [
3524
3573
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3525
3574
  ];
@@ -3528,8 +3577,8 @@ module Prism
3528
3577
  super
3529
3578
  end
3530
3579
 
3531
- # Visit a ParametersNode node.
3532
- def visit_parameters_node(node)
3580
+ #: (ParametersNode) -> void
3581
+ def visit_parameters_node(node) # :nodoc:
3533
3582
  table = Table.new("ParametersNode")
3534
3583
  id = node_id(node)
3535
3584
 
@@ -3603,7 +3652,7 @@ module Prism
3603
3652
  digraph.edge("#{id}:block -> #{node_id(block)};")
3604
3653
  end
3605
3654
 
3606
- digraph.nodes << <<~DOT
3655
+ digraph.node(<<~DOT)
3607
3656
  #{id} [
3608
3657
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3609
3658
  ];
@@ -3612,8 +3661,8 @@ module Prism
3612
3661
  super
3613
3662
  end
3614
3663
 
3615
- # Visit a ParenthesesNode node.
3616
- def visit_parentheses_node(node)
3664
+ #: (ParenthesesNode) -> void
3665
+ def visit_parentheses_node(node) # :nodoc:
3617
3666
  table = Table.new("ParenthesesNode")
3618
3667
  id = node_id(node)
3619
3668
 
@@ -3632,7 +3681,7 @@ module Prism
3632
3681
  # closing_loc
3633
3682
  table.field("closing_loc", location_inspect(node.closing_loc))
3634
3683
 
3635
- digraph.nodes << <<~DOT
3684
+ digraph.node(<<~DOT)
3636
3685
  #{id} [
3637
3686
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3638
3687
  ];
@@ -3641,8 +3690,8 @@ module Prism
3641
3690
  super
3642
3691
  end
3643
3692
 
3644
- # Visit a PinnedExpressionNode node.
3645
- def visit_pinned_expression_node(node)
3693
+ #: (PinnedExpressionNode) -> void
3694
+ def visit_pinned_expression_node(node) # :nodoc:
3646
3695
  table = Table.new("PinnedExpressionNode")
3647
3696
  id = node_id(node)
3648
3697
 
@@ -3659,7 +3708,7 @@ module Prism
3659
3708
  # rparen_loc
3660
3709
  table.field("rparen_loc", location_inspect(node.rparen_loc))
3661
3710
 
3662
- digraph.nodes << <<~DOT
3711
+ digraph.node(<<~DOT)
3663
3712
  #{id} [
3664
3713
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3665
3714
  ];
@@ -3668,8 +3717,8 @@ module Prism
3668
3717
  super
3669
3718
  end
3670
3719
 
3671
- # Visit a PinnedVariableNode node.
3672
- def visit_pinned_variable_node(node)
3720
+ #: (PinnedVariableNode) -> void
3721
+ def visit_pinned_variable_node(node) # :nodoc:
3673
3722
  table = Table.new("PinnedVariableNode")
3674
3723
  id = node_id(node)
3675
3724
 
@@ -3680,7 +3729,7 @@ module Prism
3680
3729
  # operator_loc
3681
3730
  table.field("operator_loc", location_inspect(node.operator_loc))
3682
3731
 
3683
- digraph.nodes << <<~DOT
3732
+ digraph.node(<<~DOT)
3684
3733
  #{id} [
3685
3734
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3686
3735
  ];
@@ -3689,8 +3738,8 @@ module Prism
3689
3738
  super
3690
3739
  end
3691
3740
 
3692
- # Visit a PostExecutionNode node.
3693
- def visit_post_execution_node(node)
3741
+ #: (PostExecutionNode) -> void
3742
+ def visit_post_execution_node(node) # :nodoc:
3694
3743
  table = Table.new("PostExecutionNode")
3695
3744
  id = node_id(node)
3696
3745
 
@@ -3709,7 +3758,7 @@ module Prism
3709
3758
  # closing_loc
3710
3759
  table.field("closing_loc", location_inspect(node.closing_loc))
3711
3760
 
3712
- digraph.nodes << <<~DOT
3761
+ digraph.node(<<~DOT)
3713
3762
  #{id} [
3714
3763
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3715
3764
  ];
@@ -3718,8 +3767,8 @@ module Prism
3718
3767
  super
3719
3768
  end
3720
3769
 
3721
- # Visit a PreExecutionNode node.
3722
- def visit_pre_execution_node(node)
3770
+ #: (PreExecutionNode) -> void
3771
+ def visit_pre_execution_node(node) # :nodoc:
3723
3772
  table = Table.new("PreExecutionNode")
3724
3773
  id = node_id(node)
3725
3774
 
@@ -3738,7 +3787,7 @@ module Prism
3738
3787
  # closing_loc
3739
3788
  table.field("closing_loc", location_inspect(node.closing_loc))
3740
3789
 
3741
- digraph.nodes << <<~DOT
3790
+ digraph.node(<<~DOT)
3742
3791
  #{id} [
3743
3792
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3744
3793
  ];
@@ -3747,8 +3796,8 @@ module Prism
3747
3796
  super
3748
3797
  end
3749
3798
 
3750
- # Visit a ProgramNode node.
3751
- def visit_program_node(node)
3799
+ #: (ProgramNode) -> void
3800
+ def visit_program_node(node) # :nodoc:
3752
3801
  table = Table.new("ProgramNode")
3753
3802
  id = node_id(node)
3754
3803
 
@@ -3759,7 +3808,7 @@ module Prism
3759
3808
  table.field("statements", port: true)
3760
3809
  digraph.edge("#{id}:statements -> #{node_id(node.statements)};")
3761
3810
 
3762
- digraph.nodes << <<~DOT
3811
+ digraph.node(<<~DOT)
3763
3812
  #{id} [
3764
3813
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3765
3814
  ];
@@ -3768,8 +3817,8 @@ module Prism
3768
3817
  super
3769
3818
  end
3770
3819
 
3771
- # Visit a RangeNode node.
3772
- def visit_range_node(node)
3820
+ #: (RangeNode) -> void
3821
+ def visit_range_node(node) # :nodoc:
3773
3822
  table = Table.new("RangeNode")
3774
3823
  id = node_id(node)
3775
3824
 
@@ -3791,7 +3840,7 @@ module Prism
3791
3840
  # operator_loc
3792
3841
  table.field("operator_loc", location_inspect(node.operator_loc))
3793
3842
 
3794
- digraph.nodes << <<~DOT
3843
+ digraph.node(<<~DOT)
3795
3844
  #{id} [
3796
3845
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3797
3846
  ];
@@ -3800,8 +3849,8 @@ module Prism
3800
3849
  super
3801
3850
  end
3802
3851
 
3803
- # Visit a RationalNode node.
3804
- def visit_rational_node(node)
3852
+ #: (RationalNode) -> void
3853
+ def visit_rational_node(node) # :nodoc:
3805
3854
  table = Table.new("RationalNode")
3806
3855
  id = node_id(node)
3807
3856
 
@@ -3814,7 +3863,7 @@ module Prism
3814
3863
  # denominator
3815
3864
  table.field("denominator", node.denominator.inspect)
3816
3865
 
3817
- digraph.nodes << <<~DOT
3866
+ digraph.node(<<~DOT)
3818
3867
  #{id} [
3819
3868
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3820
3869
  ];
@@ -3823,12 +3872,12 @@ module Prism
3823
3872
  super
3824
3873
  end
3825
3874
 
3826
- # Visit a RedoNode node.
3827
- def visit_redo_node(node)
3875
+ #: (RedoNode) -> void
3876
+ def visit_redo_node(node) # :nodoc:
3828
3877
  table = Table.new("RedoNode")
3829
3878
  id = node_id(node)
3830
3879
 
3831
- digraph.nodes << <<~DOT
3880
+ digraph.node(<<~DOT)
3832
3881
  #{id} [
3833
3882
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3834
3883
  ];
@@ -3837,8 +3886,8 @@ module Prism
3837
3886
  super
3838
3887
  end
3839
3888
 
3840
- # Visit a RegularExpressionNode node.
3841
- def visit_regular_expression_node(node)
3889
+ #: (RegularExpressionNode) -> void
3890
+ def visit_regular_expression_node(node) # :nodoc:
3842
3891
  table = Table.new("RegularExpressionNode")
3843
3892
  id = node_id(node)
3844
3893
 
@@ -3857,7 +3906,7 @@ module Prism
3857
3906
  # unescaped
3858
3907
  table.field("unescaped", node.unescaped.inspect)
3859
3908
 
3860
- digraph.nodes << <<~DOT
3909
+ digraph.node(<<~DOT)
3861
3910
  #{id} [
3862
3911
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3863
3912
  ];
@@ -3866,8 +3915,8 @@ module Prism
3866
3915
  super
3867
3916
  end
3868
3917
 
3869
- # Visit a RequiredKeywordParameterNode node.
3870
- def visit_required_keyword_parameter_node(node)
3918
+ #: (RequiredKeywordParameterNode) -> void
3919
+ def visit_required_keyword_parameter_node(node) # :nodoc:
3871
3920
  table = Table.new("RequiredKeywordParameterNode")
3872
3921
  id = node_id(node)
3873
3922
 
@@ -3880,7 +3929,7 @@ module Prism
3880
3929
  # name_loc
3881
3930
  table.field("name_loc", location_inspect(node.name_loc))
3882
3931
 
3883
- digraph.nodes << <<~DOT
3932
+ digraph.node(<<~DOT)
3884
3933
  #{id} [
3885
3934
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3886
3935
  ];
@@ -3889,8 +3938,8 @@ module Prism
3889
3938
  super
3890
3939
  end
3891
3940
 
3892
- # Visit a RequiredParameterNode node.
3893
- def visit_required_parameter_node(node)
3941
+ #: (RequiredParameterNode) -> void
3942
+ def visit_required_parameter_node(node) # :nodoc:
3894
3943
  table = Table.new("RequiredParameterNode")
3895
3944
  id = node_id(node)
3896
3945
 
@@ -3900,7 +3949,7 @@ module Prism
3900
3949
  # name
3901
3950
  table.field("name", node.name.inspect)
3902
3951
 
3903
- digraph.nodes << <<~DOT
3952
+ digraph.node(<<~DOT)
3904
3953
  #{id} [
3905
3954
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3906
3955
  ];
@@ -3909,8 +3958,8 @@ module Prism
3909
3958
  super
3910
3959
  end
3911
3960
 
3912
- # Visit a RescueModifierNode node.
3913
- def visit_rescue_modifier_node(node)
3961
+ #: (RescueModifierNode) -> void
3962
+ def visit_rescue_modifier_node(node) # :nodoc:
3914
3963
  table = Table.new("RescueModifierNode")
3915
3964
  id = node_id(node)
3916
3965
 
@@ -3925,7 +3974,7 @@ module Prism
3925
3974
  table.field("rescue_expression", port: true)
3926
3975
  digraph.edge("#{id}:rescue_expression -> #{node_id(node.rescue_expression)};")
3927
3976
 
3928
- digraph.nodes << <<~DOT
3977
+ digraph.node(<<~DOT)
3929
3978
  #{id} [
3930
3979
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3931
3980
  ];
@@ -3934,8 +3983,8 @@ module Prism
3934
3983
  super
3935
3984
  end
3936
3985
 
3937
- # Visit a RescueNode node.
3938
- def visit_rescue_node(node)
3986
+ #: (RescueNode) -> void
3987
+ def visit_rescue_node(node) # :nodoc:
3939
3988
  table = Table.new("RescueNode")
3940
3989
  id = node_id(node)
3941
3990
 
@@ -3983,7 +4032,7 @@ module Prism
3983
4032
  digraph.edge("#{id}:subsequent -> #{node_id(subsequent)};")
3984
4033
  end
3985
4034
 
3986
- digraph.nodes << <<~DOT
4035
+ digraph.node(<<~DOT)
3987
4036
  #{id} [
3988
4037
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
3989
4038
  ];
@@ -3992,8 +4041,8 @@ module Prism
3992
4041
  super
3993
4042
  end
3994
4043
 
3995
- # Visit a RestParameterNode node.
3996
- def visit_rest_parameter_node(node)
4044
+ #: (RestParameterNode) -> void
4045
+ def visit_rest_parameter_node(node) # :nodoc:
3997
4046
  table = Table.new("RestParameterNode")
3998
4047
  id = node_id(node)
3999
4048
 
@@ -4011,7 +4060,7 @@ module Prism
4011
4060
  # operator_loc
4012
4061
  table.field("operator_loc", location_inspect(node.operator_loc))
4013
4062
 
4014
- digraph.nodes << <<~DOT
4063
+ digraph.node(<<~DOT)
4015
4064
  #{id} [
4016
4065
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
4017
4066
  ];
@@ -4020,12 +4069,12 @@ module Prism
4020
4069
  super
4021
4070
  end
4022
4071
 
4023
- # Visit a RetryNode node.
4024
- def visit_retry_node(node)
4072
+ #: (RetryNode) -> void
4073
+ def visit_retry_node(node) # :nodoc:
4025
4074
  table = Table.new("RetryNode")
4026
4075
  id = node_id(node)
4027
4076
 
4028
- digraph.nodes << <<~DOT
4077
+ digraph.node(<<~DOT)
4029
4078
  #{id} [
4030
4079
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
4031
4080
  ];
@@ -4034,8 +4083,8 @@ module Prism
4034
4083
  super
4035
4084
  end
4036
4085
 
4037
- # Visit a ReturnNode node.
4038
- def visit_return_node(node)
4086
+ #: (ReturnNode) -> void
4087
+ def visit_return_node(node) # :nodoc:
4039
4088
  table = Table.new("ReturnNode")
4040
4089
  id = node_id(node)
4041
4090
 
@@ -4048,7 +4097,7 @@ module Prism
4048
4097
  digraph.edge("#{id}:arguments -> #{node_id(arguments)};")
4049
4098
  end
4050
4099
 
4051
- digraph.nodes << <<~DOT
4100
+ digraph.node(<<~DOT)
4052
4101
  #{id} [
4053
4102
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
4054
4103
  ];
@@ -4057,12 +4106,12 @@ module Prism
4057
4106
  super
4058
4107
  end
4059
4108
 
4060
- # Visit a SelfNode node.
4061
- def visit_self_node(node)
4109
+ #: (SelfNode) -> void
4110
+ def visit_self_node(node) # :nodoc:
4062
4111
  table = Table.new("SelfNode")
4063
4112
  id = node_id(node)
4064
4113
 
4065
- digraph.nodes << <<~DOT
4114
+ digraph.node(<<~DOT)
4066
4115
  #{id} [
4067
4116
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
4068
4117
  ];
@@ -4071,8 +4120,8 @@ module Prism
4071
4120
  super
4072
4121
  end
4073
4122
 
4074
- # Visit a ShareableConstantNode node.
4075
- def visit_shareable_constant_node(node)
4123
+ #: (ShareableConstantNode) -> void
4124
+ def visit_shareable_constant_node(node) # :nodoc:
4076
4125
  table = Table.new("ShareableConstantNode")
4077
4126
  id = node_id(node)
4078
4127
 
@@ -4083,7 +4132,7 @@ module Prism
4083
4132
  table.field("write", port: true)
4084
4133
  digraph.edge("#{id}:write -> #{node_id(node.write)};")
4085
4134
 
4086
- digraph.nodes << <<~DOT
4135
+ digraph.node(<<~DOT)
4087
4136
  #{id} [
4088
4137
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
4089
4138
  ];
@@ -4092,8 +4141,8 @@ module Prism
4092
4141
  super
4093
4142
  end
4094
4143
 
4095
- # Visit a SingletonClassNode node.
4096
- def visit_singleton_class_node(node)
4144
+ #: (SingletonClassNode) -> void
4145
+ def visit_singleton_class_node(node) # :nodoc:
4097
4146
  table = Table.new("SingletonClassNode")
4098
4147
  id = node_id(node)
4099
4148
 
@@ -4119,7 +4168,7 @@ module Prism
4119
4168
  # end_keyword_loc
4120
4169
  table.field("end_keyword_loc", location_inspect(node.end_keyword_loc))
4121
4170
 
4122
- digraph.nodes << <<~DOT
4171
+ digraph.node(<<~DOT)
4123
4172
  #{id} [
4124
4173
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
4125
4174
  ];
@@ -4128,12 +4177,12 @@ module Prism
4128
4177
  super
4129
4178
  end
4130
4179
 
4131
- # Visit a SourceEncodingNode node.
4132
- def visit_source_encoding_node(node)
4180
+ #: (SourceEncodingNode) -> void
4181
+ def visit_source_encoding_node(node) # :nodoc:
4133
4182
  table = Table.new("SourceEncodingNode")
4134
4183
  id = node_id(node)
4135
4184
 
4136
- digraph.nodes << <<~DOT
4185
+ digraph.node(<<~DOT)
4137
4186
  #{id} [
4138
4187
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
4139
4188
  ];
@@ -4142,8 +4191,8 @@ module Prism
4142
4191
  super
4143
4192
  end
4144
4193
 
4145
- # Visit a SourceFileNode node.
4146
- def visit_source_file_node(node)
4194
+ #: (SourceFileNode) -> void
4195
+ def visit_source_file_node(node) # :nodoc:
4147
4196
  table = Table.new("SourceFileNode")
4148
4197
  id = node_id(node)
4149
4198
 
@@ -4153,7 +4202,7 @@ module Prism
4153
4202
  # filepath
4154
4203
  table.field("filepath", node.filepath.inspect)
4155
4204
 
4156
- digraph.nodes << <<~DOT
4205
+ digraph.node(<<~DOT)
4157
4206
  #{id} [
4158
4207
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
4159
4208
  ];
@@ -4162,12 +4211,12 @@ module Prism
4162
4211
  super
4163
4212
  end
4164
4213
 
4165
- # Visit a SourceLineNode node.
4166
- def visit_source_line_node(node)
4214
+ #: (SourceLineNode) -> void
4215
+ def visit_source_line_node(node) # :nodoc:
4167
4216
  table = Table.new("SourceLineNode")
4168
4217
  id = node_id(node)
4169
4218
 
4170
- digraph.nodes << <<~DOT
4219
+ digraph.node(<<~DOT)
4171
4220
  #{id} [
4172
4221
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
4173
4222
  ];
@@ -4176,8 +4225,8 @@ module Prism
4176
4225
  super
4177
4226
  end
4178
4227
 
4179
- # Visit a SplatNode node.
4180
- def visit_splat_node(node)
4228
+ #: (SplatNode) -> void
4229
+ def visit_splat_node(node) # :nodoc:
4181
4230
  table = Table.new("SplatNode")
4182
4231
  id = node_id(node)
4183
4232
 
@@ -4190,7 +4239,7 @@ module Prism
4190
4239
  digraph.edge("#{id}:expression -> #{node_id(expression)};")
4191
4240
  end
4192
4241
 
4193
- digraph.nodes << <<~DOT
4242
+ digraph.node(<<~DOT)
4194
4243
  #{id} [
4195
4244
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
4196
4245
  ];
@@ -4199,8 +4248,8 @@ module Prism
4199
4248
  super
4200
4249
  end
4201
4250
 
4202
- # Visit a StatementsNode node.
4203
- def visit_statements_node(node)
4251
+ #: (StatementsNode) -> void
4252
+ def visit_statements_node(node) # :nodoc:
4204
4253
  table = Table.new("StatementsNode")
4205
4254
  id = node_id(node)
4206
4255
 
@@ -4217,7 +4266,7 @@ module Prism
4217
4266
  table.field("body", "[]")
4218
4267
  end
4219
4268
 
4220
- digraph.nodes << <<~DOT
4269
+ digraph.node(<<~DOT)
4221
4270
  #{id} [
4222
4271
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
4223
4272
  ];
@@ -4226,8 +4275,8 @@ module Prism
4226
4275
  super
4227
4276
  end
4228
4277
 
4229
- # Visit a StringNode node.
4230
- def visit_string_node(node)
4278
+ #: (StringNode) -> void
4279
+ def visit_string_node(node) # :nodoc:
4231
4280
  table = Table.new("StringNode")
4232
4281
  id = node_id(node)
4233
4282
 
@@ -4250,7 +4299,7 @@ module Prism
4250
4299
  # unescaped
4251
4300
  table.field("unescaped", node.unescaped.inspect)
4252
4301
 
4253
- digraph.nodes << <<~DOT
4302
+ digraph.node(<<~DOT)
4254
4303
  #{id} [
4255
4304
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
4256
4305
  ];
@@ -4259,8 +4308,8 @@ module Prism
4259
4308
  super
4260
4309
  end
4261
4310
 
4262
- # Visit a SuperNode node.
4263
- def visit_super_node(node)
4311
+ #: (SuperNode) -> void
4312
+ def visit_super_node(node) # :nodoc:
4264
4313
  table = Table.new("SuperNode")
4265
4314
  id = node_id(node)
4266
4315
 
@@ -4289,7 +4338,7 @@ module Prism
4289
4338
  digraph.edge("#{id}:block -> #{node_id(block)};")
4290
4339
  end
4291
4340
 
4292
- digraph.nodes << <<~DOT
4341
+ digraph.node(<<~DOT)
4293
4342
  #{id} [
4294
4343
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
4295
4344
  ];
@@ -4298,8 +4347,8 @@ module Prism
4298
4347
  super
4299
4348
  end
4300
4349
 
4301
- # Visit a SymbolNode node.
4302
- def visit_symbol_node(node)
4350
+ #: (SymbolNode) -> void
4351
+ def visit_symbol_node(node) # :nodoc:
4303
4352
  table = Table.new("SymbolNode")
4304
4353
  id = node_id(node)
4305
4354
 
@@ -4311,10 +4360,8 @@ module Prism
4311
4360
  table.field("opening_loc", location_inspect(opening_loc))
4312
4361
  end
4313
4362
 
4314
- # value_loc
4315
- unless (value_loc = node.value_loc).nil?
4316
- table.field("value_loc", location_inspect(value_loc))
4317
- end
4363
+ # content_loc
4364
+ table.field("content_loc", location_inspect(node.content_loc))
4318
4365
 
4319
4366
  # closing_loc
4320
4367
  unless (closing_loc = node.closing_loc).nil?
@@ -4324,7 +4371,7 @@ module Prism
4324
4371
  # unescaped
4325
4372
  table.field("unescaped", node.unescaped.inspect)
4326
4373
 
4327
- digraph.nodes << <<~DOT
4374
+ digraph.node(<<~DOT)
4328
4375
  #{id} [
4329
4376
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
4330
4377
  ];
@@ -4333,12 +4380,12 @@ module Prism
4333
4380
  super
4334
4381
  end
4335
4382
 
4336
- # Visit a TrueNode node.
4337
- def visit_true_node(node)
4383
+ #: (TrueNode) -> void
4384
+ def visit_true_node(node) # :nodoc:
4338
4385
  table = Table.new("TrueNode")
4339
4386
  id = node_id(node)
4340
4387
 
4341
- digraph.nodes << <<~DOT
4388
+ digraph.node(<<~DOT)
4342
4389
  #{id} [
4343
4390
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
4344
4391
  ];
@@ -4347,8 +4394,8 @@ module Prism
4347
4394
  super
4348
4395
  end
4349
4396
 
4350
- # Visit a UndefNode node.
4351
- def visit_undef_node(node)
4397
+ #: (UndefNode) -> void
4398
+ def visit_undef_node(node) # :nodoc:
4352
4399
  table = Table.new("UndefNode")
4353
4400
  id = node_id(node)
4354
4401
 
@@ -4368,7 +4415,7 @@ module Prism
4368
4415
  # keyword_loc
4369
4416
  table.field("keyword_loc", location_inspect(node.keyword_loc))
4370
4417
 
4371
- digraph.nodes << <<~DOT
4418
+ digraph.node(<<~DOT)
4372
4419
  #{id} [
4373
4420
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
4374
4421
  ];
@@ -4377,13 +4424,13 @@ module Prism
4377
4424
  super
4378
4425
  end
4379
4426
 
4380
- # Visit a UnlessNode node.
4381
- def visit_unless_node(node)
4427
+ #: (UnlessNode) -> void
4428
+ def visit_unless_node(node) # :nodoc:
4382
4429
  table = Table.new("UnlessNode")
4383
4430
  id = node_id(node)
4384
4431
 
4385
- # keyword_loc
4386
- table.field("keyword_loc", location_inspect(node.keyword_loc))
4432
+ # unless_keyword_loc
4433
+ table.field("unless_keyword_loc", location_inspect(node.unless_keyword_loc))
4387
4434
 
4388
4435
  # predicate
4389
4436
  table.field("predicate", port: true)
@@ -4411,7 +4458,7 @@ module Prism
4411
4458
  table.field("end_keyword_loc", location_inspect(end_keyword_loc))
4412
4459
  end
4413
4460
 
4414
- digraph.nodes << <<~DOT
4461
+ digraph.node(<<~DOT)
4415
4462
  #{id} [
4416
4463
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
4417
4464
  ];
@@ -4420,25 +4467,25 @@ module Prism
4420
4467
  super
4421
4468
  end
4422
4469
 
4423
- # Visit a UntilNode node.
4424
- def visit_until_node(node)
4470
+ #: (UntilNode) -> void
4471
+ def visit_until_node(node) # :nodoc:
4425
4472
  table = Table.new("UntilNode")
4426
4473
  id = node_id(node)
4427
4474
 
4428
4475
  # flags
4429
4476
  table.field("flags", loop_flags_inspect(node))
4430
4477
 
4431
- # keyword_loc
4432
- table.field("keyword_loc", location_inspect(node.keyword_loc))
4478
+ # until_keyword_loc
4479
+ table.field("until_keyword_loc", location_inspect(node.until_keyword_loc))
4433
4480
 
4434
4481
  # do_keyword_loc
4435
4482
  unless (do_keyword_loc = node.do_keyword_loc).nil?
4436
4483
  table.field("do_keyword_loc", location_inspect(do_keyword_loc))
4437
4484
  end
4438
4485
 
4439
- # closing_loc
4440
- unless (closing_loc = node.closing_loc).nil?
4441
- table.field("closing_loc", location_inspect(closing_loc))
4486
+ # end_keyword_loc
4487
+ unless (end_keyword_loc = node.end_keyword_loc).nil?
4488
+ table.field("end_keyword_loc", location_inspect(end_keyword_loc))
4442
4489
  end
4443
4490
 
4444
4491
  # predicate
@@ -4451,7 +4498,7 @@ module Prism
4451
4498
  digraph.edge("#{id}:statements -> #{node_id(statements)};")
4452
4499
  end
4453
4500
 
4454
- digraph.nodes << <<~DOT
4501
+ digraph.node(<<~DOT)
4455
4502
  #{id} [
4456
4503
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
4457
4504
  ];
@@ -4460,13 +4507,13 @@ module Prism
4460
4507
  super
4461
4508
  end
4462
4509
 
4463
- # Visit a WhenNode node.
4464
- def visit_when_node(node)
4510
+ #: (WhenNode) -> void
4511
+ def visit_when_node(node) # :nodoc:
4465
4512
  table = Table.new("WhenNode")
4466
4513
  id = node_id(node)
4467
4514
 
4468
- # keyword_loc
4469
- table.field("keyword_loc", location_inspect(node.keyword_loc))
4515
+ # when_keyword_loc
4516
+ table.field("when_keyword_loc", location_inspect(node.when_keyword_loc))
4470
4517
 
4471
4518
  # conditions
4472
4519
  if node.conditions.any?
@@ -4492,7 +4539,7 @@ module Prism
4492
4539
  digraph.edge("#{id}:statements -> #{node_id(statements)};")
4493
4540
  end
4494
4541
 
4495
- digraph.nodes << <<~DOT
4542
+ digraph.node(<<~DOT)
4496
4543
  #{id} [
4497
4544
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
4498
4545
  ];
@@ -4501,25 +4548,25 @@ module Prism
4501
4548
  super
4502
4549
  end
4503
4550
 
4504
- # Visit a WhileNode node.
4505
- def visit_while_node(node)
4551
+ #: (WhileNode) -> void
4552
+ def visit_while_node(node) # :nodoc:
4506
4553
  table = Table.new("WhileNode")
4507
4554
  id = node_id(node)
4508
4555
 
4509
4556
  # flags
4510
4557
  table.field("flags", loop_flags_inspect(node))
4511
4558
 
4512
- # keyword_loc
4513
- table.field("keyword_loc", location_inspect(node.keyword_loc))
4559
+ # while_keyword_loc
4560
+ table.field("while_keyword_loc", location_inspect(node.while_keyword_loc))
4514
4561
 
4515
4562
  # do_keyword_loc
4516
4563
  unless (do_keyword_loc = node.do_keyword_loc).nil?
4517
4564
  table.field("do_keyword_loc", location_inspect(do_keyword_loc))
4518
4565
  end
4519
4566
 
4520
- # closing_loc
4521
- unless (closing_loc = node.closing_loc).nil?
4522
- table.field("closing_loc", location_inspect(closing_loc))
4567
+ # end_keyword_loc
4568
+ unless (end_keyword_loc = node.end_keyword_loc).nil?
4569
+ table.field("end_keyword_loc", location_inspect(end_keyword_loc))
4523
4570
  end
4524
4571
 
4525
4572
  # predicate
@@ -4532,7 +4579,7 @@ module Prism
4532
4579
  digraph.edge("#{id}:statements -> #{node_id(statements)};")
4533
4580
  end
4534
4581
 
4535
- digraph.nodes << <<~DOT
4582
+ digraph.node(<<~DOT)
4536
4583
  #{id} [
4537
4584
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
4538
4585
  ];
@@ -4541,8 +4588,8 @@ module Prism
4541
4588
  super
4542
4589
  end
4543
4590
 
4544
- # Visit a XStringNode node.
4545
- def visit_x_string_node(node)
4591
+ #: (XStringNode) -> void
4592
+ def visit_x_string_node(node) # :nodoc:
4546
4593
  table = Table.new("XStringNode")
4547
4594
  id = node_id(node)
4548
4595
 
@@ -4561,7 +4608,7 @@ module Prism
4561
4608
  # unescaped
4562
4609
  table.field("unescaped", node.unescaped.inspect)
4563
4610
 
4564
- digraph.nodes << <<~DOT
4611
+ digraph.node(<<~DOT)
4565
4612
  #{id} [
4566
4613
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
4567
4614
  ];
@@ -4570,8 +4617,8 @@ module Prism
4570
4617
  super
4571
4618
  end
4572
4619
 
4573
- # Visit a YieldNode node.
4574
- def visit_yield_node(node)
4620
+ #: (YieldNode) -> void
4621
+ def visit_yield_node(node) # :nodoc:
4575
4622
  table = Table.new("YieldNode")
4576
4623
  id = node_id(node)
4577
4624
 
@@ -4594,7 +4641,7 @@ module Prism
4594
4641
  table.field("rparen_loc", location_inspect(rparen_loc))
4595
4642
  end
4596
4643
 
4597
- digraph.nodes << <<~DOT
4644
+ digraph.node(<<~DOT)
4598
4645
  #{id} [
4599
4646
  label=<#{table.to_dot.gsub(/\n/, "\n ")}>
4600
4647
  ];
@@ -4606,18 +4653,24 @@ module Prism
4606
4653
  private
4607
4654
 
4608
4655
  # Generate a unique node ID for a node throughout the digraph.
4609
- def node_id(node)
4656
+ #
4657
+ #: (node) -> String
4658
+ def node_id(node) # :nodoc:
4610
4659
  "Node_#{node.object_id}"
4611
4660
  end
4612
4661
 
4613
- # Inspect a location to display the start and end line and column numbers.
4614
- def location_inspect(location)
4662
+ # Inspect a location to display the start and end line and columns in bytes.
4663
+ #
4664
+ #: (Location) -> String
4665
+ def location_inspect(location) # :nodoc:
4615
4666
  "(#{location.start_line},#{location.start_column})-(#{location.end_line},#{location.end_column})"
4616
4667
  end
4617
4668
 
4618
4669
  # Inspect a node that has arguments_node_flags flags to display the flags as a
4619
4670
  # comma-separated list.
4620
- def arguments_node_flags_inspect(node)
4671
+ #
4672
+ #: (ArgumentsNode node) -> String
4673
+ def arguments_node_flags_inspect(node) # :nodoc:
4621
4674
  flags = [] #: Array[String]
4622
4675
  flags << "contains_forwarding" if node.contains_forwarding?
4623
4676
  flags << "contains_keywords" if node.contains_keywords?
@@ -4629,7 +4682,9 @@ module Prism
4629
4682
 
4630
4683
  # Inspect a node that has array_node_flags flags to display the flags as a
4631
4684
  # comma-separated list.
4632
- def array_node_flags_inspect(node)
4685
+ #
4686
+ #: (ArrayNode node) -> String
4687
+ def array_node_flags_inspect(node) # :nodoc:
4633
4688
  flags = [] #: Array[String]
4634
4689
  flags << "contains_splat" if node.contains_splat?
4635
4690
  flags.join(", ")
@@ -4637,7 +4692,9 @@ module Prism
4637
4692
 
4638
4693
  # Inspect a node that has call_node_flags flags to display the flags as a
4639
4694
  # comma-separated list.
4640
- def call_node_flags_inspect(node)
4695
+ #
4696
+ #: (CallAndWriteNode | CallNode | CallOperatorWriteNode | CallOrWriteNode | CallTargetNode | IndexAndWriteNode | IndexOperatorWriteNode | IndexOrWriteNode | IndexTargetNode node) -> String
4697
+ def call_node_flags_inspect(node) # :nodoc:
4641
4698
  flags = [] #: Array[String]
4642
4699
  flags << "safe_navigation" if node.safe_navigation?
4643
4700
  flags << "variable_call" if node.variable_call?
@@ -4648,7 +4705,9 @@ module Prism
4648
4705
 
4649
4706
  # Inspect a node that has encoding_flags flags to display the flags as a
4650
4707
  # comma-separated list.
4651
- def encoding_flags_inspect(node)
4708
+ #
4709
+ #: (XStringNode node) -> String
4710
+ def encoding_flags_inspect(node) # :nodoc:
4652
4711
  flags = [] #: Array[String]
4653
4712
  flags << "forced_utf8_encoding" if node.forced_utf8_encoding?
4654
4713
  flags << "forced_binary_encoding" if node.forced_binary_encoding?
@@ -4657,7 +4716,9 @@ module Prism
4657
4716
 
4658
4717
  # Inspect a node that has integer_base_flags flags to display the flags as a
4659
4718
  # comma-separated list.
4660
- def integer_base_flags_inspect(node)
4719
+ #
4720
+ #: (IntegerNode | RationalNode node) -> String
4721
+ def integer_base_flags_inspect(node) # :nodoc:
4661
4722
  flags = [] #: Array[String]
4662
4723
  flags << "binary" if node.binary?
4663
4724
  flags << "decimal" if node.decimal?
@@ -4668,7 +4729,9 @@ module Prism
4668
4729
 
4669
4730
  # Inspect a node that has interpolated_string_node_flags flags to display the flags as a
4670
4731
  # comma-separated list.
4671
- def interpolated_string_node_flags_inspect(node)
4732
+ #
4733
+ #: (InterpolatedStringNode node) -> String
4734
+ def interpolated_string_node_flags_inspect(node) # :nodoc:
4672
4735
  flags = [] #: Array[String]
4673
4736
  flags << "frozen" if node.frozen?
4674
4737
  flags << "mutable" if node.mutable?
@@ -4677,7 +4740,9 @@ module Prism
4677
4740
 
4678
4741
  # Inspect a node that has keyword_hash_node_flags flags to display the flags as a
4679
4742
  # comma-separated list.
4680
- def keyword_hash_node_flags_inspect(node)
4743
+ #
4744
+ #: (KeywordHashNode node) -> String
4745
+ def keyword_hash_node_flags_inspect(node) # :nodoc:
4681
4746
  flags = [] #: Array[String]
4682
4747
  flags << "symbol_keys" if node.symbol_keys?
4683
4748
  flags.join(", ")
@@ -4685,7 +4750,9 @@ module Prism
4685
4750
 
4686
4751
  # Inspect a node that has loop_flags flags to display the flags as a
4687
4752
  # comma-separated list.
4688
- def loop_flags_inspect(node)
4753
+ #
4754
+ #: (UntilNode | WhileNode node) -> String
4755
+ def loop_flags_inspect(node) # :nodoc:
4689
4756
  flags = [] #: Array[String]
4690
4757
  flags << "begin_modifier" if node.begin_modifier?
4691
4758
  flags.join(", ")
@@ -4693,7 +4760,9 @@ module Prism
4693
4760
 
4694
4761
  # Inspect a node that has parameter_flags flags to display the flags as a
4695
4762
  # comma-separated list.
4696
- def parameter_flags_inspect(node)
4763
+ #
4764
+ #: (BlockLocalVariableNode | BlockParameterNode | KeywordRestParameterNode | OptionalKeywordParameterNode | OptionalParameterNode | RequiredKeywordParameterNode | RequiredParameterNode | RestParameterNode node) -> String
4765
+ def parameter_flags_inspect(node) # :nodoc:
4697
4766
  flags = [] #: Array[String]
4698
4767
  flags << "repeated_parameter" if node.repeated_parameter?
4699
4768
  flags.join(", ")
@@ -4701,7 +4770,9 @@ module Prism
4701
4770
 
4702
4771
  # Inspect a node that has parentheses_node_flags flags to display the flags as a
4703
4772
  # comma-separated list.
4704
- def parentheses_node_flags_inspect(node)
4773
+ #
4774
+ #: (ParenthesesNode node) -> String
4775
+ def parentheses_node_flags_inspect(node) # :nodoc:
4705
4776
  flags = [] #: Array[String]
4706
4777
  flags << "multiple_statements" if node.multiple_statements?
4707
4778
  flags.join(", ")
@@ -4709,7 +4780,9 @@ module Prism
4709
4780
 
4710
4781
  # Inspect a node that has range_flags flags to display the flags as a
4711
4782
  # comma-separated list.
4712
- def range_flags_inspect(node)
4783
+ #
4784
+ #: (FlipFlopNode | RangeNode node) -> String
4785
+ def range_flags_inspect(node) # :nodoc:
4713
4786
  flags = [] #: Array[String]
4714
4787
  flags << "exclude_end" if node.exclude_end?
4715
4788
  flags.join(", ")
@@ -4717,7 +4790,9 @@ module Prism
4717
4790
 
4718
4791
  # Inspect a node that has regular_expression_flags flags to display the flags as a
4719
4792
  # comma-separated list.
4720
- def regular_expression_flags_inspect(node)
4793
+ #
4794
+ #: (InterpolatedMatchLastLineNode | InterpolatedRegularExpressionNode | MatchLastLineNode | RegularExpressionNode node) -> String
4795
+ def regular_expression_flags_inspect(node) # :nodoc:
4721
4796
  flags = [] #: Array[String]
4722
4797
  flags << "ignore_case" if node.ignore_case?
4723
4798
  flags << "extended" if node.extended?
@@ -4735,7 +4810,9 @@ module Prism
4735
4810
 
4736
4811
  # Inspect a node that has shareable_constant_node_flags flags to display the flags as a
4737
4812
  # comma-separated list.
4738
- def shareable_constant_node_flags_inspect(node)
4813
+ #
4814
+ #: (ShareableConstantNode node) -> String
4815
+ def shareable_constant_node_flags_inspect(node) # :nodoc:
4739
4816
  flags = [] #: Array[String]
4740
4817
  flags << "literal" if node.literal?
4741
4818
  flags << "experimental_everything" if node.experimental_everything?
@@ -4745,7 +4822,9 @@ module Prism
4745
4822
 
4746
4823
  # Inspect a node that has string_flags flags to display the flags as a
4747
4824
  # comma-separated list.
4748
- def string_flags_inspect(node)
4825
+ #
4826
+ #: (SourceFileNode | StringNode node) -> String
4827
+ def string_flags_inspect(node) # :nodoc:
4749
4828
  flags = [] #: Array[String]
4750
4829
  flags << "forced_utf8_encoding" if node.forced_utf8_encoding?
4751
4830
  flags << "forced_binary_encoding" if node.forced_binary_encoding?
@@ -4756,7 +4835,9 @@ module Prism
4756
4835
 
4757
4836
  # Inspect a node that has symbol_flags flags to display the flags as a
4758
4837
  # comma-separated list.
4759
- def symbol_flags_inspect(node)
4838
+ #
4839
+ #: (SymbolNode node) -> String
4840
+ def symbol_flags_inspect(node) # :nodoc:
4760
4841
  flags = [] #: Array[String]
4761
4842
  flags << "forced_utf8_encoding" if node.forced_utf8_encoding?
4762
4843
  flags << "forced_binary_encoding" if node.forced_binary_encoding?