tree-sitter-regex
tree-sitter-regex copied to clipboard
feat: Add unicode character escapes
Adresses issue #27
Assumption is made that pattern like \u{DEDBEF} always represents intent to escape a unicode character, as we are unable to access flags context.
This does not accomodate the entire complexity of parsing regexs with "Unicode" mode enabled (see trailing and heading surrogates), but it approximates general use-case. Arguably, Regex in unicode parsing mode must be treated as a strictly different incompatible syntax and it's elements should not be included in this parser as a consideration; javascript parsers (including tree-sitter-javascript) should in turn defer regex parsing to different parsers depending on flags.