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

Commit 22c0d0a

Browse files
committed
Format again with syntax tree
1 parent 748efa1 commit 22c0d0a

File tree

1 file changed

+11
-18
lines changed

1 file changed

+11
-18
lines changed

lib/syntax_tree.rb

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1826,12 +1826,7 @@ def child_nodes
18261826
end
18271827

18281828
def deconstruct_keys(keys)
1829-
{
1830-
target: target,
1831-
value: value,
1832-
location: location,
1833-
comments: comments
1834-
}
1829+
{ target: target, value: value, location: location, comments: comments }
18351830
end
18361831

18371832
def format(q)
@@ -1927,12 +1922,7 @@ def child_nodes
19271922
end
19281923

19291924
def deconstruct_keys(keys)
1930-
{
1931-
key: key,
1932-
value: value,
1933-
location: location,
1934-
comments: comments
1935-
}
1925+
{ key: key, value: value, location: location, comments: comments }
19361926
end
19371927

19381928
def format(q)
@@ -2439,7 +2429,7 @@ def on_begin(bodystmt)
24392429
keyword = find_token(Kw, "begin")
24402430
end_char =
24412431
if bodystmt.rescue_clause || bodystmt.ensure_clause ||
2442-
bodystmt.else_clause
2432+
bodystmt.else_clause
24432433
bodystmt.location.end_char
24442434
else
24452435
find_token(Kw, "end").location.end_char
@@ -2558,8 +2548,7 @@ def on_binary(left, operator, right)
25582548
tokens.rindex do |token|
25592549
location = token.location
25602550

2561-
token.is_a?(Op) &&
2562-
token.value == operator.to_s &&
2551+
token.is_a?(Op) && token.value == operator.to_s &&
25632552
location.start_char > left.location.end_char &&
25642553
location.end_char < right.location.start_char
25652554
end
@@ -10464,7 +10453,7 @@ def deconstruct_keys(keys)
1046410453
statements: statements,
1046510454
consequent: consequent,
1046610455
location: location,
10467-
comments: comments
10456+
comments: comments
1046810457
}
1046910458
end
1047010459

@@ -13140,8 +13129,12 @@ def pretty_print(q)
1314013129
end
1314113130

1314213131
def to_json(*opts)
13143-
{ type: :pinned_var_ref, value: value, loc: location, cmts: comments }
13144-
.to_json(*opts)
13132+
{
13133+
type: :pinned_var_ref,
13134+
value: value,
13135+
loc: location,
13136+
cmts: comments
13137+
}.to_json(*opts)
1314513138
end
1314613139
end
1314713140

0 commit comments

Comments
 (0)