Commit 7f39939
committed
Fix non-idempotent formatting of multi-line binary strings
When a binary contains a string with newlines, string_to_algebra splits
it into multiple lines. On re-parse, the AST represents this as a concat
node instead of a string node. break_behaviour and is_tag only matched
the string form, causing different layout decisions on the second pass.
Fix by checking is_multiline_string in both break_behaviour and is_tag
so that a multi-line string in a bin_element is treated the same way as
the concat that it will become after formatting.1 parent 3b157c0 commit 7f39939
File tree
3 files changed
+27
-4
lines changed- src
- test
- erlfmt_SUITE_data
3 files changed
+27
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
528 | 528 | | |
529 | 529 | | |
530 | 530 | | |
531 | | - | |
532 | | - | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
533 | 536 | | |
534 | 537 | | |
535 | 538 | | |
| |||
550 | 553 | | |
551 | 554 | | |
552 | 555 | | |
553 | | - | |
554 | | - | |
| 556 | + | |
| 557 | + | |
555 | 558 | | |
556 | 559 | | |
557 | 560 | | |
| |||
565 | 568 | | |
566 | 569 | | |
567 | 570 | | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
568 | 579 | | |
569 | 580 | | |
570 | 581 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
163 | 164 | | |
164 | 165 | | |
165 | 166 | | |
| 167 | + | |
166 | 168 | | |
167 | 169 | | |
168 | 170 | | |
| |||
1068 | 1070 | | |
1069 | 1071 | | |
1070 | 1072 | | |
| 1073 | + | |
1071 | 1074 | | |
1072 | 1075 | | |
1073 | 1076 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
0 commit comments