Skip to content

feat: ISC map support — the runtime reads the current corpus again - #5

Merged
ronaldtse merged 1 commit into
mainfrom
isc-support
Sep 8, 2026
Merged

ronaldtse merged 1 commit into
mainfrom
isc-support

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

What

The Python map runtime reads the current ISC corpus again.

Why

The corpus ships only .isc (zero .imp files remain); the Python runtime parsed .imp only, so every map call raised at line 1 — the whole runtime was dark, unseen because CI last ran 2026-08-20. TypeScript and Ruby both parse the current format.

Implementation

  • src/interscript/isc.py — a faithful port of the reference TypeScript parser (interscript-ts/src/isc, mirroring the Ruby Parslet grammar) + the converter into the engine's existing tree. Engine and .imp parser untouched (OCP).
  • Parallel subs render to expression source; sequence/bare rules render to raw regex with before/after/not_before/not_after as lookarounds. Capture-bearing parallel rules degrade to ordered substitutions ahead of the capture-free parallel op (documented — the digraph-prevention shape real maps use). Library dependencies (.iml) contribute aliases, re-rendered through the existing expression layer.
  • on_unsupported now threads through load_map for conversion-time vocabulary gaps — the engine's own raise/skip contract.

Verification (measured)

  • Full corpus census: 252/289 maps convert cleanly, zero parse errors; the other 37 fail loudly on known gaps (function-in-result 22, ...).
  • Gallery parity (the TS examples' table): Anton Olehovych / Solomiia / Kyiv, Tschueß! — byte-identical with TypeScript and Ruby.
  • Embedded-test parity restored: Bulgarian 98/98, Greek >=200/242.
  • Suite: 22 passed, 1 xfailed.

The maps corpus ships only .isc now (zero .imp files remain); the
Python runtime could not parse any of it — every map call raised at
line 1 (CI last ran 2026-08-20, so nobody saw it go dark).

isc.py: a faithful port of the reference TypeScript parser
(interscript-ts src/isc, itself mirroring the Ruby Parslet grammar)
plus the converter into the engine's existing tree — engine and .imp
parser untouched (OCP). Coverage measured against the full corpus:
252/289 maps convert cleanly, zero parse errors; the remaining 37 fail
LOUDLY on known vocabulary gaps (function-in-result 22, etc.) under
the engine's own on_unsupported contract, which now threads through
load_map for conversion-time gaps too.

Converter semantics worth naming:
- parallel subs render to expression source; sequence/bare rules to
  raw regex with before/after/not_before/not_after as lookarounds
  (_guarded_regex) — dropping them was the Oleghovych regression,
  caught by the parity table
- capture-bearing parallel rules degrade to ordered substitutions
  ahead of the capture-free parallel op (documented; the digraph-
  prevention shape every real map uses)
- library dependencies (posix/unicode .iml) contribute aliases,
  harvested and re-rendered through the expression layer — no
  duplicated grammar; single-quoted .iml literals normalized

Parity: bgnpcgn-ukr returns Anton Olehovych / Solomiia / Kyiv and
bgnpcgn-deu returns Tschueß! — byte-identical with the TypeScript and
Ruby runtimes (tests/test_gallery_parity.py is the gate). Bulgarian
98/98 and Greek >=200/242 embedded-test parity restored.
@ronaldtse
ronaldtse merged commit 0088d7b into main Sep 8, 2026
6 checks passed
@ronaldtse
ronaldtse deleted the isc-support branch September 8, 2026 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant