File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -2329,22 +2329,27 @@ def split_arguments(line)
2329
2329
split_points = [ ]
2330
2330
i += 1 while line [ i ] != '('
2331
2331
i += 1
2332
- brackets = 1
2332
+ parens = 1
2333
+ generic = 0
2333
2334
split_points << i # ( start of arguments
2334
2335
2335
2336
2336
2337
while i < line . size
2337
2338
case line [ i ]
2338
2339
when '('
2339
- brackets += 1
2340
+ parens += 1
2340
2341
when ')'
2341
- brackets -= 1
2342
- if brackets == 0
2342
+ parens -= 1
2343
+ if parens == 0
2343
2344
split_points << i
2344
2345
break
2345
2346
end
2347
+ when '<'
2348
+ generic += 1
2349
+ when '>'
2350
+ generic -= 1
2346
2351
when ','
2347
- split_points << i if brackets == 1
2352
+ split_points << i if parens == 1 && generic == 0
2348
2353
else
2349
2354
# nothing to do
2350
2355
end
@@ -2382,7 +2387,7 @@ def iterate(&update)
2382
2387
# look for end of annotation
2383
2388
while braces != 0
2384
2389
new_content << line
2385
- line = lines . shift
2390
+ line = lines . shift
2386
2391
braces += count_braces ( line )
2387
2392
end
2388
2393
@@ -2398,11 +2403,11 @@ def iterate(&update)
2398
2403
end
2399
2404
2400
2405
# look for whole declaration
2401
- braces = count_braces ( line )
2406
+ braces = count_braces ( line )
2402
2407
declaration = [ line ]
2403
2408
while braces != 0
2404
2409
# new_content << line
2405
- line = lines . shift
2410
+ line = lines . shift
2406
2411
braces += count_braces ( line )
2407
2412
declaration << line
2408
2413
end
You can’t perform that action at this time.
0 commit comments