File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,9 +39,8 @@ def consecutive_lines
3939 @consecutive_lines . keys . sort
4040 end
4141
42- # Record lines where a method call is logically connected
43- # to subsequent lines. This is the case when a method call
44- # is broken up by a newline
42+ # Called by Prism::Visitor for every method-call node in the AST
43+ # (e.g. `foo.bar`, `foo.bar.baz`).
4544 def visit_call_node ( node )
4645 receiver_loc = node . receiver &.location
4746 call_operator_loc = node . call_operator_loc
@@ -66,10 +65,10 @@ def visit_call_node(node)
6665 super
6766 end
6867
69- # Endless method definitions like `def foo = 123` are valid without
70- # an `end` keyword. We record their keyword here so that we can later
71- # skip considering them for keywords since they have no coresponding
72- # end
68+ # Called by Prism::Visitor for every `def` node in the AST.
69+ # Records the keyword location for endless method definitions
70+ # like `def foo = 123`. These are valid without a matching `end`,
71+ # so Token must exclude them when deciding if a line is a keyword.
7372 def visit_def_node ( node )
7473 @endless_def_keyword_locs << node . def_keyword_loc if node . equal_loc
7574 super
You can’t perform that action at this time.
0 commit comments