Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit fd435ef

Browse files
committed
Handle Array arg in parens
1 parent d0b8078 commit fd435ef

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/syntax_tree/node.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2068,7 +2068,9 @@ def format(q)
20682068
if part.is_a?(Paren)
20692069
if part.contents.body.length == 1 && skip_parens?(part.contents.body.first)
20702070
q.text(" ")
2071-
q.format(part.contents.body.first)
2071+
contents = part.contents.body.first
2072+
contents = contents.contents if contents.is_a?(ArrayLiteral)
2073+
q.format(contents)
20722074
else
20732075
q.format(arguments)
20742076
end

0 commit comments

Comments
 (0)