Commit eeea2cb
Fix percent delimiter strings with crlfs
parse.y treats CRLF as a LF and basically "normalizes" them before
parsing. That means a string like `%\nfoo\r\n` is actually treated as
`%\nfoo\n` for the purposes of parsing. This happens on both the
opening side of the percent string as well as on the closing side. So
for example `%\r\nfoo\n` must be treated as `%\nfoo\n`.
To handle this in Prism, when we start a % string, we check if it starts
with `\r\n`, and then consider the terminator to actually be `\n`. Then
we check if there are `\r\n` as we lex the string and treat those as
`\n`, but only in the case the start was a `\n`.
Fixes: #3230
[Bug #20938]
Co-authored-by: John Hawthorn <[email protected]>
Co-authored-by: eileencodes <[email protected]>1 parent 75a6171 commit eeea2cb
2 files changed
+77
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10508 | 10508 | | |
10509 | 10509 | | |
10510 | 10510 | | |
| 10511 | + | |
10511 | 10512 | | |
10512 | 10513 | | |
10513 | 10514 | | |
| |||
10588 | 10589 | | |
10589 | 10590 | | |
10590 | 10591 | | |
10591 | | - | |
10592 | | - | |
| 10592 | + | |
| 10593 | + | |
| 10594 | + | |
| 10595 | + | |
| 10596 | + | |
| 10597 | + | |
| 10598 | + | |
10593 | 10599 | | |
| 10600 | + | |
10594 | 10601 | | |
10595 | 10602 | | |
10596 | 10603 | | |
| |||
12340 | 12347 | | |
12341 | 12348 | | |
12342 | 12349 | | |
| 12350 | + | |
| 12351 | + | |
| 12352 | + | |
| 12353 | + | |
| 12354 | + | |
| 12355 | + | |
| 12356 | + | |
| 12357 | + | |
| 12358 | + | |
12343 | 12359 | | |
12344 | 12360 | | |
12345 | 12361 | | |
12346 | | - | |
| 12362 | + | |
12347 | 12363 | | |
12348 | 12364 | | |
12349 | 12365 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
0 commit comments