pomsky
pomsky copied to clipboard
Deprecate `[cp]` and `[.]`
Status Quo
[codepoint] and [.] are special snowflakes: They can't contain other character classes, i.e. [. 'x'] is illegal.
Solution
Deprecate [codepoint] and [.].
- Instead of
[codepoint], introduce a built-in variableCodepoint. - Add aliases:
Codepoint == C,Grapheme == G [.]can be replaced with![n].- No built-in variable is added for the dot, since we don't want to produce
.in the output; it doesn't work the same across regex engines, and its behavior is affected by several modes/flags/options. - For the user,
Codepoint/Cis usually better anyway. If a user happens to want to match anything except for line breaks, it's better to be explicit with![vert_space].
- No built-in variable is added for the dot, since we don't want to produce
Deprecation schedule
- [x] Add the built-ins
Codepoint,C, andG - [x] Update the documentation to recommend these built-ins
- [x] Remove documentation for the old syntax
- [x] Emit a deprecation warning in the CLI and the playground when the old syntax is used
- [x] Remove
[cp]and[codepoint]syntax - [ ] Remove
[.]syntax -- let's wait until there is a replacement, if the dot really desired