Repository navigation
feat: to-position case functions and same-map stage runs - #6
Merged
Merged
Conversation
The ISC corpus and the Ruby runtime express two constructs the
converter rejected:
- sub { from X to upcase } — the replacement is the match itself passed
through the casing function. The converter now emits subst ops with a
case field; the engine applies _CASE_FNS to the matched text
(upcase/downcase/title_case/swapcase/strip/reverse).
- run stage.X — same-map named runs now inline the referenced stage's
converted rules at conversion time (chained runs follow; cycles raise
a clear error). Stage names survive conversion as a result.
- run stage.X where X belongs to an imported (alias-less) dependency
resolves to a run op over the imported map.
Also unblocks the Ruby compiler bridge: interscript-ruby serializes
in-memory documents to ISC and executes them through this runtime.
The Ruby bridge regenerates synthetic documents under reused names; without eviction the stale engine keeps serving the old document.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Three ISC constructs the converter rejected, all needed by the Ruby runtime's DSL vocabulary (and present in corpus maps):
sub { from X to upcase }— the replacement is the match itself passed through the casing function. The converter emitssubstops with acasefield; the engine applies_CASE_FNS(upcase/downcase/title_case/swapcase/strip/reverse) to the matched text.run stage.X(same-map named runs) — inlined at conversion time: the referenced stage's converted rules splice into the calling stage, so each converted stage is self-contained (the engine keeps its flat rule list). Chained runs (one → two → three) follow transitively; cycles raise a clearcyclic run stage.Xerror.run stage.Xwhere X belongs to an imported (alias-less) dependency — resolves to arunop over the imported map, matching import semantics that merge its stages into scope.Why now
interscript-ruby's
Compiler::Pythonbridge is being reworked to serialize in-memory documents to ISC and execute them through this runtime (the old bridge wrote generated.pymodules — a contract this runtime no longer has). The dsl_stage/reversibility vocabulary needs these constructs.Tests
subst.caseopINTERSCRIPT_MAPS_PATH), no regressions