tokenizer: possessive quantifiers where the greedy reading matches the same

A possessive repetition of one class at the top level, whose tail in its concatenation is classes
that share no codepoint with it, gives the same matches read as greedy: a shorter run leaves the
tail facing a codepoint it cannot take. Ling-3.0's pre-tokeniser pattern has two such quantifiers.
Everything else stays refused by name.
This commit is contained in:
keptn42 authored and StillDeadcode committed 2026-11-03 19:07:34 +01:00
1 parent 702a0970cc
commit 9c5d4a656c
3 files changed
+88 -7

No files matched your search

+3 -1
View File
@@ -18,7 +18,9 @@
* the `onig` crate does.
*
* Anything else is refused at compile time with the construct named: backreferences, atomic
* groups and possessive quantifiers, lookaround wider than one codepoint, unbounded repetition of
* groups, possessive quantifiers except where the greedy reading provably matches the same (one
* class at the top level, followed only by classes it shares no codepoint with, as in Ling-3.0's
* pattern), lookaround wider than one codepoint, unbounded repetition of
* something that can match empty, `(?i)` over a character that folds to several (U+00DF vs "ss"),
* and properties the tables do not carry. There is no fallback matcher; a pattern that does not
* compile fails the vocabulary load.