Expand description
The interpreter: Interscript::Interpreter::Stage parity. A
backtracking item matcher (the Ruby runtime’s regex semantics
without compiling to regex — Rust’s regex crate has no lookaround,
which the constraint semantics require) plus the stage executor
over parallel groups, sequential sub rules, run rules and funcalls.
Semantics contract (from interpreter.rb / stdlib.rb):
before-> lookbehind (?<=…)not_before-> (?<!…)after-> lookahead (?=…)not_after-> (?!…)- an EMPTY constraint item behaves like the empty regex in that
position: positive constraints become no-ops, negative ones
disable the rule (Ruby
(?<=)always true /(?<!)never true). - parallel groups: single left-to-right pass. Ruby’s two paths are
both mirrored (they disagree on duplicate
fromkeys): the tree path (parallel_replace_tree, constraint-free groups) is a last-wins char trie with longest-match scanning; the megaregexp fallback tries rules indeterministic_sort_by_max_lengthorder (-max_length*100000+idx), first match wins. - replacement
toitems collapse throughnth_string(Any -> first string) before building, exactly like build_item.
Structs§
- Runtime
- A loaded-map cache bound to a load path.
Interscript.transliterateparity:transliterate(map_id, string)runs stagemain.
Functions§
- execute_
stage_ pub - Public alias for diagnostics and tests.