tree-sitter.tree-sitter/crates
Will Lillis 15adfa9e51 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-14 01:16:45 -04:00
..
cli fix(query): correctly set a state's skipped_quantifier flag when a 2026-08-11 00:26:25 -05:00
config refactor(config)!: transition from anyhow to thiserror 2025-11-14 11:28:00 +01:00
generate fix(generate): fold case-insensitive patterns at the AST leaves 2026-08-14 01:16:45 -04:00
highlight fix(rust): fix new clippy lints 2026-04-23 02:19:20 -04:00
language 0.26.5 2026-02-01 20:27:27 +01:00
loader fix(highlight): use std::sync::OnceCell for various loader fields 2026-07-23 20:14:53 -04:00
tags fix(rust): address new clippy lints 2026-07-11 00:46:19 -04:00
xtask fix(xtask): eliminate silent errors in zig fetch 2026-06-30 20:06:29 -04:00