Skip to content

Commit 450c702

Browse files
committed
Args -> ArgumentsNode
- Fixes ruby-syntax-tree#351 - Changed all use of `parts` to `arguments` as well.
1 parent d08d23b commit 450c702

File tree

13 files changed

+209
-177
lines changed

13 files changed

+209
-177
lines changed

lib/syntax_tree/dsl.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ def ArgParen(arguments)
5555
ArgParen.new(arguments: arguments, location: Location.default)
5656
end
5757

58-
# Create a new Args node.
59-
def Args(parts)
60-
Args.new(parts: parts, location: Location.default)
58+
# Create a new ArgumentsNode node.
59+
def ArgumentsNode(arguments)
60+
ArgumentsNode.new(arguments: arguments, location: Location.default)
6161
end
6262

6363
# Create a new ArgBlock node.

lib/syntax_tree/field_visitor.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ def visit_arg_star(node)
9494
end
9595
end
9696

97-
def visit_args(node)
98-
node(node, "args") do
99-
list("parts", node.parts)
97+
def visit_arguments_node(node)
98+
node(node, "arguments_node") do
99+
list("arguments", node.arguments)
100100
comments(node)
101101
end
102102
end

lib/syntax_tree/index.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ def visit_command(node)
554554
node.location.start_column
555555
)
556556

557-
node.arguments.parts.each do |argument|
557+
node.arguments.arguments.each do |argument|
558558
next unless argument.is_a?(SymbolLiteral)
559559
name = argument.value.value.to_sym
560560

lib/syntax_tree/mutation_visitor.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ def visit_arg_paren(node)
8080
node.copy(arguments: visit(node.arguments))
8181
end
8282

83-
# Visit a Args node.
84-
def visit_args(node)
85-
node.copy(parts: visit_all(node.parts))
83+
# Visit a ArgumentsNode node.
84+
def visit_arguments_node(node)
85+
node.copy(arguments: visit_all(node.arguments))
8686
end
8787

8888
# Visit a ArgBlock node.

0 commit comments

Comments
 (0)