Commit 1a41124
committed
Fix quoting of codepoints requiring surrogate pairs.
Previously, the parser would match each individual character within a
\Q...\E section. Runes requiring a surrogate pair would be incorrectly
treated as two individual characters.
E.g.
String source = new StringBuilder().appendCodePoint(110781).toString();
Before this change:
Parser.parse(source, ...) matches \x{1b0bd}
Parser.parse("\\Q" + source + "\\E", ...) matches \x{d82c}\x{dcbd}
After this change:
Parser.parse(source, ...) matches \x{1b0bd}
Parser.parse("\\Q" + source + "\\E", ...) matches \x{1b0bd}
Fixes #123.1 parent 689bf15 commit 1a41124
2 files changed
Lines changed: 12 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
922 | 922 | | |
923 | 923 | | |
924 | 924 | | |
925 | | - | |
926 | | - | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
927 | 929 | | |
928 | 930 | | |
929 | 931 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
84 | | - | |
85 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
86 | 91 | | |
87 | 92 | | |
88 | 93 | | |
| |||
0 commit comments