Commit 04f5d7b
committed
syntax: loosen ASCII compatible rules
Previously, patterns like `(?-u:☃)` were banned under the logic that
Unicode scalar values shouldn't be available unless Unicode mode is
enabled. But since patterns are required to be UTF-8, there really isn't
any difficulty in just interpreting Unicode literals as their
corresponding UTF-8 encoding.
Note though that Unicode character classes, even things like
`(?-u:[☃])`, remain banned. We probably could make character classes
work too, but it's unclear how that plays with ASCII compatible mode
requiring that a single byte is the fundamental atom of matching (where
as Unicode mode requires that Unicode scalar values are the fundamental
atom of matching).1 parent cfd0ca2 commit 04f5d7b
2 files changed
Lines changed: 12 additions & 38 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
388 | 388 | | |
389 | 389 | | |
390 | 390 | | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
402 | 395 | | |
403 | 396 | | |
404 | 397 | | |
| |||
872 | 865 | | |
873 | 866 | | |
874 | 867 | | |
875 | | - | |
876 | | - | |
| 868 | + | |
| 869 | + | |
877 | 870 | | |
878 | 871 | | |
879 | 872 | | |
| |||
1211 | 1204 | | |
1212 | 1205 | | |
1213 | 1206 | | |
1214 | | - | |
1215 | | - | |
1216 | | - | |
| 1207 | + | |
| 1208 | + | |
1217 | 1209 | | |
1218 | 1210 | | |
1219 | 1211 | | |
| |||
1661 | 1653 | | |
1662 | 1654 | | |
1663 | 1655 | | |
1664 | | - | |
1665 | | - | |
1666 | | - | |
1667 | | - | |
1668 | | - | |
1669 | | - | |
1670 | | - | |
1671 | | - | |
1672 | | - | |
1673 | | - | |
| 1656 | + | |
1674 | 1657 | | |
1675 | 1658 | | |
1676 | 1659 | | |
| |||
1748 | 1731 | | |
1749 | 1732 | | |
1750 | 1733 | | |
1751 | | - | |
1752 | | - | |
1753 | | - | |
1754 | | - | |
1755 | | - | |
1756 | | - | |
1757 | | - | |
1758 | | - | |
1759 | | - | |
1760 | | - | |
| 1734 | + | |
1761 | 1735 | | |
1762 | 1736 | | |
1763 | 1737 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | | - | |
| 71 | + | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
0 commit comments