Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions docs/isc-wf-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,3 +259,53 @@ system "ALALC:tha-Thai:Latn:2011" {
### 8.2 Language-conditioned variants (ISO 9 pattern)

See §5.4.

## 9. Canonical-adopted rs grammar extensions

The interscript-rs portable grammar (`grammar/isc.parg`) extends the
ruby-DSL concern grammar with four constructs. They are the canonical
spelling of the workflow extension — every other runtime adopts them
(ts/py through the sha-pinned portable grammar, ruby through the
concern layer). All four are parse-additive and corpus-dormant at
adoption: no map in the corpus uses any of them at a position the
pre-WF-1 grammar would have parsed differently (verified against the
corpus at adoption time, re-verified at the WO19 G6 round).

1. **`ruleset_decl`** — a named rule collection at document level
(`ruleset <ident> { stage-items }`). A ruleset body is a stage
body: it carries rules and rule-line items only — a funcall or
stage `run` inside a ruleset is a load error, because ruleset
content joins passes through W1 expansion (§3) where non-rule items
cannot participate. Duplicate ruleset declarations in one document
are a load error (WO18 G7).

2. **`use_directive`** — `use <ident>[.<ident>] [override { … }]`
(§4). The bare form flattens the referenced ruleset's rules at this
position; the `override` form replaces rows whose collapsed from-key
matches, appending the survivors after the kept rows (§4.2, the
trailing-parallel join of §4.2.6). A stage-line `use` participates
in the stage like any other item; a `use` inside a
`parallel`/`sequence` block joins that block's single pass (§3.2,
ruby concern `rule_line`).

3. **`languages_decl`** — `languages <ident> (","? <ident>)*` at
document level (§5.1). Declared once per map; a second declaration
is a parse error. The declaration gates §5.1: a caller's language
selection outside the declaration makes every `when` guard inert.

4. **`when` guard on `sub` rules** — a trailing ident list on a rule,
inside the rule's own braces for the block form
(`sub { from … to … when kur }`; canonical binding, ruby parses the
inside form only — the ts/py outside-form tolerance was retired at
WO19 G6 item 5) and after the constraints for the compact form
(`sub "a" "b" when kur`). The list is comma- or whitespace-
separated, keyword-guarded so it never swallows the next rule (§5.2).

The four new keywords (`use`, `override`, `languages`, `when`) join
the keyword table, as does `ruleset` (the block head; the ident-list
guards need every sibling block head keyworded). WO19 G6 item 1
completed the table alignment: the six fn-literal names
(`upcase` `downcase` `title_case` `reverse` `strip` `swapcase`) are
reserved in every runtime's keyword table, while `name = any(...)`
alias declarations remain valid (the `alias_decl` production has no
keyword guard).
14 changes: 14 additions & 0 deletions docs/parity/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,20 @@ rs deliberately omits `ruleset` (`interscript-rs/grammar/isc.parg:119-122`
— "`ruleset` deliberately stays OUT (§2 lists exactly these four)");
ts and py keyword all of them (`grammar-source.ts` / `grammar_source.py`
`keyword` production).
ts and py keyword all of them (`grammar-source.ts` / `grammar_source.py`
`keyword` production).

**WO19 G6 errata (2026-11-14).** G6 item 1 adopted ruby's table
everywhere: ts, py and rs now keyword the six fn-literal names
(`upcase` `downcase` `title_case` `reverse` `strip` `swapcase`), so
the fn-literal divergence rows above are resolved — all 44 probed
identifiers agree across the four runtimes. The `ruleset` row was
already stale at this audit's snapshot: rs joined `ruleset` to its
keyword table in the G7 round (the block-head guard needs it; the
`grammar/isc.parg` comment "ruleset joins too" postdates the cited
line range). Alias declarations NAMED after keywords remain valid
everywhere (`alias_decl` has no keyword guard); a bare keyword is
never an alias reference.

Corpus equivalence: a ruby sweep of all 428 corpus maps (alias names +
stage names + dependency aliases vs the full keyword list) reports
Expand Down
5 changes: 5 additions & 0 deletions maps/alalc-bel-Cyrl-Latn-1997.isc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ tests {
"Кастрычніцкая" -> "Kastrychnitskai͡a"
"Плошча Леніна" -> "Ploshcha Lenina"
"Інстытут Культуры" -> "Instytut Kulʹtury"
# WO19 G6: the map's capital-\U row is spelled with a DOUBLED
# backslash ("\\U040E"), i.e. a literal backslash + the raw text
# U040E — not the \U040E escape — so it does NOT fire on Ў. Pin
# that dormancy (ruby and rs agree Ў passes through unchanged).
"Ў" -> "Ў"
}

stage main {
Expand Down
4 changes: 4 additions & 0 deletions maps/bgnpcgn-bel-Cyrl-Latn-1979.isc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ tests {
"Беліца" -> "Byelitsa"
"Ёдкавічы" -> "Yodkavichy"
"Нёман" -> "Nyoman"
# WO19 G6: the map's capital-\U row is spelled with a DOUBLED
# backslash ("\\U040E") — not the \U040E escape — so it does NOT
# fire on Ў. Pin that dormancy (ruby and rs agree).
"Ў" -> "Ў"
"Жлобін" -> "Zhlobin"
"Ружаны" -> "Ruzhany"
"Зоя" -> "Zoya"
Expand Down
5 changes: 5 additions & 0 deletions maps/gki-bel-Cyrl-Latn-2000.isc
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ tests {
"Баяры" -> "Bajary"
"Вязынка" -> "Viazynka"
"Валяр'яны" -> "Valiarjany"
# WO19 G6 item 4: pin the capital-\U escape row — the sub below
# spells "\U040E", which decodes to Ў (ruby/rs always decoded it;
# the generated ts/py parsers carried the literal "U040E" text and
# the row never fired).
"Ў" -> "Ŭ"
}

dependency "var-Cyrl"
Expand Down
4 changes: 4 additions & 0 deletions maps/mvd-bel-Cyrl-Latn-2008.isc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ tests {
"Чарняк" -> "Charniak"
"Лябецкая" -> "Liabietskaja" # in reference doc it's Liabetskaja CAMOBAP waiting confirmation from officials
"Дар’я" -> "Darja"
# WO19 G6 item 4: pin the capital-\U escape row (the sub below
# spells "\U040E", which decodes to Ў; the generated ts/py parsers
# carried the literal "U040E" text and the row never fired).
"Ў" -> "W"
}

stage main {
Expand Down
5 changes: 5 additions & 0 deletions maps/mvd-rus-Cyrl-Latn-2008.isc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ tests {
"Ева" -> "Eva"
"Васiльева" -> "Vasiĺeva"
"Адъютантов" -> "Adjutantov"
# WO19 G6: the capital-\U row lives in stage translit and is
# spelled with a DOUBLED backslash ("\\U040E") — not the \U040E
# escape — so it does NOT fire on Ў. Pin that dormancy (ruby and
# rs agree).
"Ў" -> "Ў"
}

stage translit {
Expand Down
4 changes: 4 additions & 0 deletions maps/odni-bel-Cyrl-Latn-2015.isc
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ tests {
"Бэз" -> "Bez"
"Чабор" -> "Chabor"
"Дзяўчына, дзяўчыначка пасярод гісторыі\nЗ прастадушнай шчырасьцю глядзіць на тэрыторыю.\nУ вакне заўсёды звыклая выява:\nШэры двор, шэры слуп, на слупе аб'явы." -> "Dzyawchyna, dzyawchynachka pasyarod historyi\nZ prastadushnay shchyrastsyu hlyadzits na terytoryyu.\nU vaknye zawsyody zvyklaya vyyava:\nShery dvor, shery slup, na slupye abyavy."
# WO19 G6 item 4: pin the capital-\U escape row (the sub below
# spells "\U040E", which decodes to Ў; the generated ts/py parsers
# carried the literal "U040E" text and the row never fired).
"Ў" -> "W"
}

stage main {
Expand Down
Loading