Commit 2a05904
authored
[clang-format] Keep the ObjC selector name and
Fixes llvm#36459. after ```Objective-C - (void)test { if ([object respondsToSelector:@selector( selectorNameThatIsReallyLong:param1:param2:)]) return; } ``` before ```Objective-C - (void)test { if ([object respondsToSelector:@selector (selectorNameThatIsReallyLong:param1:param2:)]) return; } ``` Before this patch, the `ObjCMethodExpr` type was assigned to many kinds of tokens. The rule for allowing breaking the line before the colon on line TokenAnnotator.cpp:6289 was intended for method declarations and calls. It matched the parenthesis following `@selector` by mistake. To fix the problem, this patch adds a new type for `@selector`. Most of the special things in the code related to the old type is intended for other constructs. So most of the code related to the old type is not changed in this patch.@selector together (llvm#160739)1 parent 36dc2a9 commit 2a05904
File tree
5 files changed
+62
-12
lines changed- clang
- lib/Format
- unittests/Format
5 files changed
+62
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3199 | 3199 | | |
3200 | 3200 | | |
3201 | 3201 | | |
3202 | | - | |
| 3202 | + | |
3203 | 3203 | | |
3204 | 3204 | | |
3205 | 3205 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
130 | 134 | | |
| 135 | + | |
131 | 136 | | |
132 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
133 | 141 | | |
134 | 142 | | |
135 | 143 | | |
| |||
146 | 154 | | |
147 | 155 | | |
148 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
149 | 160 | | |
150 | 161 | | |
151 | 162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
324 | | - | |
| 324 | + | |
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
330 | | - | |
| 330 | + | |
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
| |||
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
| 454 | + | |
| 455 | + | |
458 | 456 | | |
459 | 457 | | |
460 | 458 | | |
| |||
513 | 511 | | |
514 | 512 | | |
515 | 513 | | |
516 | | - | |
517 | | - | |
| 514 | + | |
| 515 | + | |
518 | 516 | | |
519 | 517 | | |
520 | 518 | | |
| |||
1449 | 1447 | | |
1450 | 1448 | | |
1451 | 1449 | | |
1452 | | - | |
| 1450 | + | |
1453 | 1451 | | |
1454 | 1452 | | |
1455 | 1453 | | |
| |||
4608 | 4606 | | |
4609 | 4607 | | |
4610 | 4608 | | |
4611 | | - | |
| 4609 | + | |
4612 | 4610 | | |
4613 | 4611 | | |
4614 | 4612 | | |
| |||
5464 | 5462 | | |
5465 | 5463 | | |
5466 | 5464 | | |
5467 | | - | |
| 5465 | + | |
5468 | 5466 | | |
5469 | 5467 | | |
5470 | 5468 | | |
| |||
6288 | 6286 | | |
6289 | 6287 | | |
6290 | 6288 | | |
| 6289 | + | |
6291 | 6290 | | |
6292 | 6291 | | |
6293 | 6292 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
763 | 763 | | |
764 | 764 | | |
765 | 765 | | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
766 | 775 | | |
767 | 776 | | |
768 | 777 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1929 | 1929 | | |
1930 | 1930 | | |
1931 | 1931 | | |
| 1932 | + | |
| 1933 | + | |
| 1934 | + | |
| 1935 | + | |
| 1936 | + | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + | |
| 1944 | + | |
| 1945 | + | |
| 1946 | + | |
| 1947 | + | |
| 1948 | + | |
| 1949 | + | |
| 1950 | + | |
| 1951 | + | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
1932 | 1963 | | |
1933 | 1964 | | |
1934 | 1965 | | |
| |||
0 commit comments