File tree Expand file tree Collapse file tree 2 files changed +18
-9
lines changed Expand file tree Collapse file tree 2 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -1384,17 +1384,29 @@ def visit_hash_pattern_node(node)
1384
1384
elements =
1385
1385
if node . elements . any? || !node . rest . nil?
1386
1386
node . elements . map do |element |
1387
- bounds ( element . key . location )
1388
- key = on_label ( element . key . slice )
1389
- value = visit ( element . value )
1390
-
1391
- [ key , value ]
1387
+ [
1388
+ if ( key = element . key ) . opening_loc . nil?
1389
+ visit ( key )
1390
+ else
1391
+ bounds ( key . value_loc )
1392
+ if ( value = key . value ) . empty?
1393
+ on_string_content
1394
+ else
1395
+ on_string_add ( on_string_content , on_tstring_content ( value ) )
1396
+ end
1397
+ end ,
1398
+ visit ( element . value )
1399
+ ]
1392
1400
end
1393
1401
end
1394
1402
1395
1403
rest =
1396
- if !node . rest . nil?
1404
+ case node . rest
1405
+ when AssocSplatNode
1397
1406
visit ( node . rest . value )
1407
+ when NoKeywordsParameterNode
1408
+ bounds ( node . rest . location )
1409
+ on_var_field ( :nil )
1398
1410
end
1399
1411
1400
1412
bounds ( node . location )
Original file line number Diff line number Diff line change @@ -58,7 +58,6 @@ class RipperTest < TestCase
58
58
seattlerb/call_array_lambda_block_call.txt
59
59
seattlerb/call_assoc_trailing_comma.txt
60
60
seattlerb/call_trailing_comma.txt
61
- seattlerb/case_in.txt
62
61
seattlerb/defn_oneliner_eq2.txt
63
62
seattlerb/defs_oneliner_eq2.txt
64
63
seattlerb/difficult3_5.txt
@@ -86,7 +85,6 @@ class RipperTest < TestCase
86
85
seattlerb/parse_opt_call_args_lit_comma.txt
87
86
seattlerb/parse_pattern_051.txt
88
87
seattlerb/parse_pattern_058.txt
89
- seattlerb/parse_pattern_076.txt
90
88
seattlerb/return_call_assocs.txt
91
89
seattlerb/stabby_block_iter_call.txt
92
90
seattlerb/stabby_block_iter_call_no_target_with_arg.txt
@@ -135,7 +133,6 @@ class RipperTest < TestCase
135
133
whitequark/masgn_attr.txt
136
134
whitequark/masgn_nested.txt
137
135
whitequark/masgn_splat.txt
138
- whitequark/newline_in_hash_argument.txt
139
136
whitequark/numbered_args_after_27.txt
140
137
whitequark/parser_bug_640.txt
141
138
whitequark/parser_drops_truncated_parts_of_squiggly_heredoc.txt
You can’t perform that action at this time.
0 commit comments