Skip to content

Commit 21a7d13

Browse files
committed
Miscelanous other doc tweaks
* Format code as code * Nodoc some missed methods * Fix method reference
1 parent d98f896 commit 21a7d13

3 files changed

Lines changed: 35 additions & 35 deletions

File tree

lib/prism/desugar_compiler.rb

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -254,137 +254,137 @@ def desugar # :nodoc:
254254
# DesugarCompiler is a compiler that desugars Ruby code into a more primitive
255255
# form. This is useful for consumers that want to deal with fewer node types.
256256
class DesugarCompiler < MutationCompiler
257-
# @@foo &&= bar
257+
# `@@foo &&= bar`
258258
#
259259
# becomes
260260
#
261-
# @@foo && @@foo = bar
261+
# `@@foo && @@foo = bar`
262262
def visit_class_variable_and_write_node(node)
263263
node.desugar
264264
end
265265

266-
# @@foo ||= bar
266+
# `@@foo ||= bar`
267267
#
268268
# becomes
269269
#
270-
# defined?(@@foo) ? @@foo : @@foo = bar
270+
# `defined?(@@foo) ? @@foo : @@foo = bar`
271271
def visit_class_variable_or_write_node(node)
272272
node.desugar
273273
end
274274

275-
# @@foo += bar
275+
# `@@foo += bar`
276276
#
277277
# becomes
278278
#
279-
# @@foo = @@foo + bar
279+
# `@@foo = @@foo + bar`
280280
def visit_class_variable_operator_write_node(node)
281281
node.desugar
282282
end
283283

284-
# Foo &&= bar
284+
# `Foo &&= bar`
285285
#
286286
# becomes
287287
#
288-
# Foo && Foo = bar
288+
# `Foo && Foo = bar`
289289
def visit_constant_and_write_node(node)
290290
node.desugar
291291
end
292292

293-
# Foo ||= bar
293+
# `Foo ||= bar`
294294
#
295295
# becomes
296296
#
297-
# defined?(Foo) ? Foo : Foo = bar
297+
# `defined?(Foo) ? Foo : Foo = bar`
298298
def visit_constant_or_write_node(node)
299299
node.desugar
300300
end
301301

302-
# Foo += bar
302+
# `Foo += bar`
303303
#
304304
# becomes
305305
#
306-
# Foo = Foo + bar
306+
# `Foo = Foo + bar`
307307
def visit_constant_operator_write_node(node)
308308
node.desugar
309309
end
310310

311-
# $foo &&= bar
311+
# `$foo &&= bar`
312312
#
313313
# becomes
314314
#
315-
# $foo && $foo = bar
315+
# `$foo && $foo = bar`
316316
def visit_global_variable_and_write_node(node)
317317
node.desugar
318318
end
319319

320-
# $foo ||= bar
320+
# `$foo ||= bar`
321321
#
322322
# becomes
323323
#
324-
# defined?($foo) ? $foo : $foo = bar
324+
# `defined?($foo) ? $foo : $foo = bar`
325325
def visit_global_variable_or_write_node(node)
326326
node.desugar
327327
end
328328

329-
# $foo += bar
329+
# `$foo += bar`
330330
#
331331
# becomes
332332
#
333-
# $foo = $foo + bar
333+
# `$foo = $foo + bar`
334334
def visit_global_variable_operator_write_node(node)
335335
node.desugar
336336
end
337337

338-
# @foo &&= bar
338+
# `@foo &&= bar`
339339
#
340340
# becomes
341341
#
342-
# @foo && @foo = bar
342+
# `@foo && @foo = bar`
343343
def visit_instance_variable_and_write_node(node)
344344
node.desugar
345345
end
346346

347-
# @foo ||= bar
347+
# `@foo ||= bar`
348348
#
349349
# becomes
350350
#
351-
# @foo || @foo = bar
351+
# `@foo || @foo = bar`
352352
def visit_instance_variable_or_write_node(node)
353353
node.desugar
354354
end
355355

356-
# @foo += bar
356+
# `@foo += bar`
357357
#
358358
# becomes
359359
#
360-
# @foo = @foo + bar
360+
# `@foo = @foo + bar`
361361
def visit_instance_variable_operator_write_node(node)
362362
node.desugar
363363
end
364364

365-
# foo &&= bar
365+
# `foo &&= bar`
366366
#
367367
# becomes
368368
#
369-
# foo && foo = bar
369+
# `foo && foo = bar`
370370
def visit_local_variable_and_write_node(node)
371371
node.desugar
372372
end
373373

374-
# foo ||= bar
374+
# `foo ||= bar`
375375
#
376376
# becomes
377377
#
378-
# foo || foo = bar
378+
# `foo || foo = bar`
379379
def visit_local_variable_or_write_node(node)
380380
node.desugar
381381
end
382382

383-
# foo += bar
383+
# `foo += bar`
384384
#
385385
# becomes
386386
#
387-
# foo = foo + bar
387+
# `foo = foo + bar`
388388
def visit_local_variable_operator_write_node(node)
389389
node.desugar
390390
end

lib/prism/parse_result.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ def inspect # :nodoc:
556556
# EmbDocComment objects correspond to comments that are surrounded by =begin
557557
# and =end.
558558
class EmbDocComment < Comment
559-
# This can only be true for inline comments.
559+
# Returns false. This can only be true for inline comments.
560560
def trailing?
561561
false
562562
end
@@ -670,9 +670,9 @@ def inspect # :nodoc:
670670
end
671671
end
672672

673-
# This represents the result of a call to ::parse or ::parse_file. It contains
674-
# the requested structure, any comments that were encounters, and any errors
675-
# that were encountered.
673+
# This represents the result of a call to Prism.parse or Prism.parse_file.
674+
# It contains the requested structure, any comments that were encounters,
675+
# and any errors that were encountered.
676676
class Result
677677
# The list of comments that were encountered during parsing.
678678
attr_reader :comments

lib/prism/pattern.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Pattern
4141
class CompilationError < StandardError
4242
# Create a new CompilationError with the given representation of the node
4343
# that caused the error.
44-
def initialize(repr)
44+
def initialize(repr) # :nodoc:
4545
super(<<~ERROR)
4646
prism was unable to compile the pattern you provided into a usable
4747
expression. It failed on to understand the node represented by:

0 commit comments

Comments
 (0)