tree-sitter.tree-sitter/crates
Will Lillis 2b15649f93 fix(generate): fold case-insensitive patterns at the AST leaves
A previous fix moved case folding for `/i` patterns out of `regex_syntax` and
into `expand_regex`, so folding could drop the two non-ASCII code points
Unicode simple folding maps onto ASCII letters: the long s `ſ` (U+017F)
onto `s`, and the Kelvin sign `K` (U+212A) onto `k`. Left in, they leak
into otherwise-ASCII tokens and stop those tokens from being extracted as
keywords.

By that point, though, the HIR has already turned a negated class into a
complement, so folding it applies the fold on the wrong side of the
negation. `(?i)[^a-z]` folds a set that contains `A-Z`, which re-admits
`a-z` and leaves a class matching very nearly everything.

`regex_syntax` folds each leaf of a class expression before applying that
leaf's negation and the set algebra above it. Keep that order and change
only the fold: walk the AST, replace each leaf with its fold, and translate
with `case_insensitive(false)`.
2026-08-12 23:40:32 -04:00
..
cli refactor(rust): trim unused imports (#5845) 2026-08-12 14:27:52 +02:00
config fix(rust): use more accurate types for various IoError structs 2026-06-13 09:35:12 -04:00
generate fix(generate): fold case-insensitive patterns at the AST leaves 2026-08-12 23:40:32 -04:00
highlight refactor(rust): trim unused imports (#5845) 2026-08-12 14:27:52 +02:00
language treewide: add taplo config and reformat toml files 2026-02-18 00:59:34 -05:00
loader fix(highlight): use std::sync::OnceCell for various loader fields 2026-07-23 18:30:15 -04:00
tags refactor(rust): trim unused imports (#5845) 2026-08-12 14:27:52 +02:00
xtask fix(xtask): eliminate silent errors in zig fetch 2026-06-30 19:37:55 -04:00