Commit 066f5e2
committed
fix(backend/sdoc_source_code): let lark scan CR to NEWLINE, not to NODE_STRING_VALUE
strictdoc#2554 added dedent logic, #2555 added hash generation. that
hash results for same input were different on Windows and Linux even if
CR LF was normalized to LF.
Further investigation revealed that dedent logic didn't work as expected
on Windows, because CR LF got split half into the string token, and half
into the newline token, which in turn confused the dedent logic. By
trial it turned out that "/[^\n\r]+/x" (verbose regex mode, real
newlines) is not the same as "/[^\\n\\r]+/" (normal regex mode,
symbolized newlines). The former wrongly lets lark scan a \r into
NODE_STRING_VALUE.
Thus change to the latter pattern.1 parent 2d2f4e9 commit 066f5e2
File tree
2 files changed
+42
-2
lines changed- strictdoc/backend/sdoc_source_code/comment_parser
- tests/unit/strictdoc/backend/sdoc_source_code
2 files changed
+42
-2
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
Lines changed: 41 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
489 | 489 | | |
490 | 490 | | |
491 | 491 | | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
492 | 532 | | |
493 | 533 | | |
494 | 534 | | |
| |||
0 commit comments