Files
regex-tools/docs/EXPLANATION_MODEL.md

38 lines
2.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Explanation model
The ECMAScript community provider converts regexpp nodes into a stable
application AST inside the syntax worker. Nodes carry deterministic IDs,
UTF-16 ranges, raw source, capture metadata, quantifier bounds, assertion kind,
support status, provider identity and provenance.
Explanations are original deterministic text selected by node type. Nullable
and minimum/maximum consumed-length properties are derived recursively where
the normalized node semantics support them. Backreference lengths and exact
bounds for Unicode properties of strings remain unknown rather than being
guessed.
regexpp 4.12.2 does not expose tolerant recovery. A malformed pattern therefore
gets the provider's exact diagnostic plus an application-owned error node. No
partial regexpp AST is claimed.
The PCRE2 provider currently emits a deliberately partial lexical tree for
common capture forms. It does not infer branch-reset numbering or claim full
nesting; authoritative compilation, capture counts, names and result ranges
come from PCRE2 itself.
The Python, Java, PHP, Perl, Ruby, C++, Go, Rust, .NET and Scala-compatibility
providers likewise emit deliberately partial lexical trees. They recognize
their documented capture and replacement forms for navigation and display,
but do not claim full grammar acceptance. The selected named runtime remains
authoritative for compilation. Java and Scala capture names displayed with
native numbered spans come from bounded lexical metadata; they are not
invented as a TeaVM-reported name table. C++ capture discovery is explicitly
unavailable for alternate grammars or `nosubs`.
The explanation tree is structural. It is never called an actual execution
trace. Selecting a node selects and scrolls its exact editor range; selecting
pattern text chooses the smallest enclosing node. PCRE2s separate trace viewer
contains actual bounded automatic callouts; its movement labels remain a
distinct derived layer and are never copied into the structural explanation.
The other eleven profiles expose no actual execution trace.