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
2 changes: 1 addition & 1 deletion .github/workflows/map-artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
run: |
test -f dist/interscript-maps-ir/manifest.json
test -f dist/interscript-maps-ir/SHA256SUMS
test "$(find dist/interscript-maps-ir/maps -name '*.json' | wc -l | tr -d ' ')" = "289"
test "$(find dist/interscript-maps-ir/maps -name '*.json' | wc -l | tr -d ' ')" = "293"
node - <<'NODE'
import { createHash } from 'node:crypto'
import { readFileSync } from 'node:fs'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
require "interscript/isc"
total = 0
failures = []
Dir.glob("../maps/maps/*.isc").sort.each do |path|
Dir.glob(["../maps/maps/*.isc", "../maps/libs/*.isc"]).sort.each do |path|
total += 1
begin
tree = Interscript::Isc::Parser.parse(File.read(path), filename: File.basename(path))
Expand Down
7 changes: 7 additions & 0 deletions libs/posix.isc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
system "posix" {

aliases {
upper = any("\u0041\u0042\u0043\u0044\u0045\u0046\u0047\u0048\u0049\u004a\u004b\u004c\u004d\u004e\u004f\u0050\u0051\u0052\u0053\u0054\u0055\u0056\u0057\u0058\u0059\u005a\u00c0\u00c1\u00c2\u00c3\u00c4\u00c5\u00c6\u00c7\u00c8\u00c9\u00ca\u00cb\u00cc\u00cd\u00ce\u00cf\u00d0\u00d1\u00d2\u00d3\u00d4\u00d5\u00d6\u00d8\u00d9\u00da\u00db\u00dc\u00dd\u00de\u0100\u0102\u0104\u0106\u0108\u010a\u010c\u010e\u0110\u0112\u0114\u0116\u0118\u011a\u011c\u011e\u0120\u0122\u0124\u0126\u0128\u012a\u012c\u012e\u0130\u0132\u0134\u0136\u0139\u013b\u013d\u013f\u0141\u0143\u0145\u0147\u014a\u014c\u014e\u0150\u0152\u0154\u0156\u0158\u015a\u015c\u015e\u0160\u0162\u0164\u0166\u0168\u016a\u016c\u016e\u0170\u0172\u0174\u0176\u0178\u0179\u017b\u017d\u0181\u0182\u0184\u0186\u0187\u0189\u018a\u018b\u018e\u018f\u0190\u0191\u0193\u0194\u0196\u0197\u0198\u019c\u019d\u019f\u01a0\u01a2\u01a4\u01a6\u01a7\u01a9\u01ac\u01ae\u01af\u01b1\u01b2\u01b3\u01b5\u01b7\u01b8\u01bc\u01c4\u01c7\u01ca\u01cd\u01cf\u01d1\u01d3\u01d5\u01d7\u01d9\u01db\u01de\u01e0\u01e2\u01e4\u01e6\u01e8\u01ea\u01ec\u01ee\u01f1\u01f4\u01f6\u01f7\u01f8\u01fa\u01fc\u01fe\u0200\u0202\u0204\u0206\u0208\u020a\u020c\u020e\u0210\u0212\u0214\u0216\u0218\u021a\u021c\u021e\u0220\u0222\u0224\u0226\u0228\u022a\u022c\u022e\u0230\u0232\u023a\u023b\u023d\u023e\u0241\u0243\u0244\u0245\u0246\u0248\u024a\u024c\u024e\u0370\u0372\u0376\u037f\u0386\u0388\u0389\u038a\u038c\u038e\u038f\u0391\u0392\u0393\u0394\u0395\u0396\u0397\u0398\u0399\u039a\u039b\u039c\u039d\u039e\u039f\u03a0\u03a1\u03a3\u03a4\u03a5\u03a6\u03a7\u03a8\u03a9\u03aa\u03ab\u03cf\u03d2\u03d3\u03d4\u03d8\u03da\u03dc\u03de\u03e0\u03e2\u03e4\u03e6\u03e8\u03ea\u03ec\u03ee\u03f4\u03f7\u03f9\u03fa\u03fd\u03fe\u03ff\u0400\u0401\u0402\u0403\u0404\u0405\u0406\u0407\u0408\u0409\u040a\u040b\u040c\u040d\u040e\u040f\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041a\u041b\u041c\u041d\u041e\u041f\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042a\u042b\u042c\u042d\u042e\u042f\u0460\u0462\u0464\u0466\u0468\u046a\u046c\u046e\u0470\u0472\u0474\u0476\u0478\u047a\u047c\u047e\u0480\u048a\u048c\u048e\u0490\u0492\u0494\u0496\u0498\u049a\u049c\u049e\u04a0\u04a2\u04a4\u04a6\u04a8\u04aa\u04ac\u04ae\u04b0\u04b2\u04b4\u04b6\u04b8\u04ba\u04bc\u04be\u04c0\u04c1\u04c3\u04c5\u04c7\u04c9\u04cb\u04cd\u04d0\u04d2\u04d4\u04d6\u04d8\u04da\u04dc\u04de\u04e0\u04e2\u04e4\u04e6\u04e8\u04ea\u04ec\u04ee\u04f0\u04f2\u04f4\u04f6\u04f8\u04fa\u04fc\u04fe\u0500\u0502\u0504\u0506\u0508\u050a\u050c\u050e\u0510\u0512\u0514\u0516\u0518\u051a\u051c\u051e\u0520\u0522\u0524\u0526\u0528\u052a\u052c\u052e\u0531\u0532\u0533\u0534\u0535\u0536\u0537\u0538\u0539\u053a\u053b\u053c\u053d\u053e\u053f\u0540\u0541\u0542\u0543\u0544\u0545\u0546\u0547\u0548\u0549\u054a\u054b\u054c\u054d\u054e\u054f\u0550\u0551\u0552\u0553\u0554\u0555\u0556\u10a0\u10a1\u10a2\u10a3\u10a4\u10a5\u10a6\u10a7\u10a8\u10a9\u10aa\u10ab\u10ac\u10ad\u10ae\u10af\u10b0\u10b1\u10b2\u10b3\u10b4\u10b5\u10b6\u10b7\u10b8\u10b9\u10ba\u10bb\u10bc\u10bd\u10be\u10bf\u10c0\u10c1\u10c2\u10c3\u10c4\u10c5\u10c7\u10cd\u13a0\u13a1\u13a2\u13a3\u13a4\u13a5\u13a6\u13a7\u13a8\u13a9\u13aa\u13ab\u13ac\u13ad\u13ae\u13af\u13b0\u13b1\u13b2\u13b3\u13b4\u13b5\u13b6\u13b7\u13b8\u13b9\u13ba\u13bb\u13bc\u13bd\u13be\u13bf\u13c0\u13c1\u13c2\u13c3\u13c4\u13c5\u13c6\u13c7\u13c8\u13c9\u13ca\u13cb\u13cc\u13cd\u13ce\u13cf\u13d0\u13d1\u13d2\u13d3\u13d4\u13d5\u13d6\u13d7\u13d8\u13d9\u13da\u13db\u13dc\u13dd\u13de\u13df\u13e0\u13e1\u13e2\u13e3\u13e4\u13e5\u13e6\u13e7\u13e8\u13e9\u13ea\u13eb\u13ec\u13ed\u13ee\u13ef\u13f0\u13f1\u13f2\u13f3\u13f4\u13f5\u1c90\u1c91\u1c92\u1c93\u1c94\u1c95\u1c96\u1c97\u1c98\u1c99\u1c9a\u1c9b\u1c9c\u1c9d\u1c9e\u1c9f\u1ca0\u1ca1\u1ca2\u1ca3\u1ca4\u1ca5\u1ca6\u1ca7\u1ca8\u1ca9\u1caa\u1cab\u1cac\u1cad\u1cae\u1caf\u1cb0\u1cb1\u1cb2\u1cb3\u1cb4\u1cb5\u1cb6\u1cb7\u1cb8\u1cb9\u1cba\u1cbd\u1cbe\u1cbf\u1e00\u1e02\u1e04\u1e06\u1e08\u1e0a\u1e0c\u1e0e\u1e10\u1e12\u1e14\u1e16\u1e18\u1e1a\u1e1c\u1e1e\u1e20\u1e22\u1e24\u1e26\u1e28\u1e2a\u1e2c\u1e2e\u1e30\u1e32\u1e34\u1e36\u1e38\u1e3a\u1e3c\u1e3e\u1e40\u1e42\u1e44\u1e46\u1e48\u1e4a\u1e4c\u1e4e\u1e50\u1e52\u1e54\u1e56\u1e58\u1e5a\u1e5c\u1e5e\u1e60\u1e62\u1e64\u1e66\u1e68\u1e6a\u1e6c\u1e6e\u1e70\u1e72\u1e74\u1e76\u1e78\u1e7a\u1e7c\u1e7e\u1e80\u1e82\u1e84\u1e86\u1e88\u1e8a\u1e8c\u1e8e\u1e90\u1e92\u1e94\u1e9e\u1ea0\u1ea2\u1ea4\u1ea6\u1ea8\u1eaa\u1eac\u1eae\u1eb0\u1eb2\u1eb4\u1eb6\u1eb8\u1eba\u1ebc\u1ebe\u1ec0\u1ec2\u1ec4\u1ec6\u1ec8\u1eca\u1ecc\u1ece\u1ed0\u1ed2\u1ed4\u1ed6\u1ed8\u1eda\u1edc\u1ede\u1ee0\u1ee2\u1ee4\u1ee6\u1ee8\u1eea\u1eec\u1eee\u1ef0\u1ef2\u1ef4\u1ef6\u1ef8\u1efa\u1efc\u1efe\u1f08\u1f09\u1f0a\u1f0b\u1f0c\u1f0d\u1f0e\u1f0f\u1f18\u1f19\u1f1a\u1f1b\u1f1c\u1f1d\u1f28\u1f29\u1f2a\u1f2b\u1f2c\u1f2d\u1f2e\u1f2f\u1f38\u1f39\u1f3a\u1f3b\u1f3c\u1f3d\u1f3e\u1f3f\u1f48\u1f49\u1f4a\u1f4b\u1f4c\u1f4d\u1f59\u1f5b\u1f5d\u1f5f\u1f68\u1f69\u1f6a\u1f6b\u1f6c\u1f6d\u1f6e\u1f6f\u1fb8\u1fb9\u1fba\u1fbb\u1fc8\u1fc9\u1fca\u1fcb\u1fd8\u1fd9\u1fda\u1fdb\u1fe8\u1fe9\u1fea\u1feb\u1fec\u1ff8\u1ff9\u1ffa\u1ffb\u2102\u2107\u210b\u210c\u210d\u2110\u2111\u2112\u2115\u2119\u211a\u211b\u211c\u211d\u2124\u2126\u2128\u212a\u212b\u212c\u212d\u2130\u2131\u2132\u2133\u213e\u213f\u2145\u2160\u2161\u2162\u2163\u2164\u2165\u2166\u2167\u2168\u2169\u216a\u216b\u216c\u216d\u216e\u216f\u2183\u24b6\u24b7\u24b8\u24b9\u24ba\u24bb\u24bc\u24bd\u24be\u24bf\u24c0\u24c1\u24c2\u24c3\u24c4\u24c5\u24c6\u24c7\u24c8\u24c9\u24ca\u24cb\u24cc\u24cd\u24ce\u24cf\u2c00\u2c01\u2c02\u2c03\u2c04\u2c05\u2c06\u2c07\u2c08\u2c09\u2c0a\u2c0b\u2c0c\u2c0d\u2c0e\u2c0f\u2c10\u2c11\u2c12\u2c13\u2c14\u2c15\u2c16\u2c17\u2c18\u2c19\u2c1a\u2c1b\u2c1c\u2c1d\u2c1e\u2c1f\u2c20\u2c21\u2c22\u2c23\u2c24\u2c25\u2c26\u2c27\u2c28\u2c29\u2c2a\u2c2b\u2c2c\u2c2d\u2c2e\u2c60\u2c62\u2c63\u2c64\u2c67\u2c69\u2c6b\u2c6d\u2c6e\u2c6f\u2c70\u2c72\u2c75\u2c7e\u2c7f\u2c80\u2c82\u2c84\u2c86\u2c88\u2c8a\u2c8c\u2c8e\u2c90\u2c92\u2c94\u2c96\u2c98\u2c9a\u2c9c\u2c9e\u2ca0\u2ca2\u2ca4\u2ca6\u2ca8\u2caa\u2cac\u2cae\u2cb0\u2cb2\u2cb4\u2cb6\u2cb8\u2cba\u2cbc\u2cbe\u2cc0\u2cc2\u2cc4\u2cc6\u2cc8\u2cca\u2ccc\u2cce\u2cd0\u2cd2\u2cd4\u2cd6\u2cd8\u2cda\u2cdc\u2cde\u2ce0\u2ce2\u2ceb\u2ced\u2cf2\ua640\ua642\ua644\ua646\ua648\ua64a\ua64c\ua64e\ua650\ua652\ua654\ua656\ua658\ua65a\ua65c\ua65e\ua660\ua662\ua664\ua666\ua668\ua66a\ua66c\ua680\ua682\ua684\ua686\ua688\ua68a\ua68c\ua68e\ua690\ua692\ua694\ua696\ua698\ua69a\ua722\ua724\ua726\ua728\ua72a\ua72c\ua72e\ua732\ua734\ua736\ua738\ua73a\ua73c\ua73e\ua740\ua742\ua744\ua746\ua748\ua74a\ua74c\ua74e\ua750\ua752\ua754\ua756\ua758\ua75a\ua75c\ua75e\ua760\ua762\ua764\ua766\ua768\ua76a\ua76c\ua76e\ua779\ua77b\ua77d\ua77e\ua780\ua782\ua784\ua786\ua78b\ua78d\ua790\ua792\ua796\ua798\ua79a\ua79c\ua79e\ua7a0\ua7a2\ua7a4\ua7a6\ua7a8\ua7aa\ua7ab\ua7ac\ua7ad\ua7ae\ua7b0\ua7b1\ua7b2\ua7b3\ua7b4\ua7b6\ua7b8\ua7ba\ua7bc\ua7be\ua7c2\ua7c4\ua7c5\ua7c6\uff21\uff22\uff23\uff24\uff25\uff26\uff27\uff28\uff29\uff2a\uff2b\uff2c\uff2d\uff2e\uff2f\uff30\uff31\uff32\uff33\uff34\uff35\uff36\uff37\uff38\uff39\uff3a")
}

}
8 changes: 8 additions & 0 deletions libs/unicode.isc

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions libs/var-Cyrl.isc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
system "var-Cyrl" {

aliases {
bel_consonant = any("БбВвГгДдЖжЗзЙйКкЛлМмНнПпРрСсТтФфХхЦцЧчШш")
cyrl_upper = any('AБBГДЕЁЖЗИЙКЛМНОПРСТУЎФХЦЧШЩЪЫЬЭЮЯІ')
}

}
14 changes: 14 additions & 0 deletions libs/var-kor.isc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
system "var-kor" {

aliases {
hangul = any("\uac00".."\ud7af")
jamo_leading_cons = any([any("\u1100".."\u115e"), any("\ua960".."\ua97c")])
jamo_vowel = any([any("\u1161".."\u11a7"), any("\ud7b0".."\ud7c6")])
jamo_trailing_cons = any([any("\u11a8".."\u11ff"), any("\ud7cb".."\ud7fb")])
jamo = any([jamo_leading_cons, jamo_vowel, jamo_trailing_cons])
hangul_or_jamo = any([hangul, jamo])
double_cons_jamo = any("ᄁᄄᄈᄍᄊ")
aspirated_cons_jamo = any("ᄏᄐᄑᄎ")
}

}
1 change: 1 addition & 0 deletions maps/alalc-ell-Grek-Latn-2010.isc
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ tests {
}

dependency "unicode"
dependency "var-kor"

# https://en.wikipedia.org/wiki/Romanization_of_Greek
stage main {
Expand Down
1 change: 1 addition & 0 deletions maps/alalc-mkd-Cyrl-Latn-1997.isc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ tests {
}

dependency "posix"
dependency "var-kor"

stage main {

Expand Down
1 change: 1 addition & 0 deletions maps/alalc-mkd-Cyrl-Latn-2013.isc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ tests {
}

dependency "posix"
dependency "var-kor"

stage main {

Expand Down
1 change: 1 addition & 0 deletions maps/alalc-srp-Cyrl-Latn-1997.isc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ tests {
}

dependency "posix"
dependency "var-kor"

stage main {

Expand Down
1 change: 1 addition & 0 deletions maps/bas-rus-Cyrl-Latn-2017-bss.isc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ tests {
}

dependency "posix"
dependency "var-kor"

stage main {

Expand Down
1 change: 1 addition & 0 deletions maps/bgnpcgn-deu-Latn-Latn-2000.isc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ tests {
}

dependency "posix"
dependency "var-kor"

stage main {

Expand Down
1 change: 1 addition & 0 deletions maps/bgnpcgn-mkd-Cyrl-Latn-1981.isc
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ tests {
}

dependency "var-Cyrl"
dependency "var-kor"

stage main {

Expand Down
1 change: 1 addition & 0 deletions maps/bgnpcgn-mkd-Cyrl-Latn-2013.isc
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ tests {
}

dependency "posix"
dependency "var-kor"

stage main {

Expand Down
1 change: 1 addition & 0 deletions maps/by-bel-Cyrl-Latn-1998.isc
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ tests {

dependency "gost-rus-Cyrl-Latn-16876-71-1983" as cyrllatn
dependency "var-Cyrl"
dependency "var-kor"

stage main {
# RULES
Expand Down
1 change: 1 addition & 0 deletions maps/gki-bel-Cyrl-Latn-2000.isc
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ tests {
}

dependency "var-Cyrl"
dependency "var-kor"

stage main {

Expand Down
1 change: 1 addition & 0 deletions maps/gost-rus-Cyrl-Latn-16876-71-1983.isc
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ tests {
}

dependency "var-Cyrl"
dependency "var-kor"

stage main {

Expand Down
1 change: 1 addition & 0 deletions maps/kp-kor-Hang-Latn-2002.isc
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ tests {

dependency "unicode"
dependency "var-kor-Hang-Hang-jamo" as hanghang
dependency "var-kor"


stage main {
Expand Down
1 change: 1 addition & 0 deletions maps/odni-kor-Hang-Latn-2015.isc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ tests {

dependency "unicode"
dependency "var-kor-Hang-Hang-jamo" as hanghang
dependency "var-kor"

aliases {

Expand Down
1 change: 1 addition & 0 deletions maps/un-bul-Cyrl-Latn-1977.isc
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ tests {
}

dependency "posix"
dependency "var-kor"

stage main {

Expand Down
1 change: 1 addition & 0 deletions maps/un-mkd-Cyrl-Latn-1977.isc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ tests {
}

dependency "posix"
dependency "var-kor"

stage main {
sub {
Expand Down
10 changes: 8 additions & 2 deletions scripts/build-json-ir-artifact.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,20 @@ const { iscToCompiledMap } = await import(pathToFileURL(resolve(tsDir, "src/isc/
rmSync(outputRoot, { recursive: true, force: true })
mkdirSync(outputMaps, { recursive: true })

const files = readdirSync(mapsDir)
// System maps live in maps/, dependency libraries (posix, unicode,
// var-Cyrl, var-kor) in libs/ — both compile into the artifact so the
// runtime can resolve library aliases (18 maps depend on them).
const files = [
...readdirSync(mapsDir).map((f) => join("maps", f)),
...readdirSync(join(repoRoot, "libs")).map((f) => join("libs", f)),
]
.filter((file) => file.endsWith(".isc"))
.sort()

const systems = []
for (const file of files) {
const code = basename(file, ".isc")
const source = readFileSync(join(mapsDir, file), "utf8")
const source = readFileSync(join(repoRoot, file), "utf8")
const doc = parseIsc(source, file)
const compiled = iscToCompiledMap(doc)
writeFileSync(join(outputMaps, `${code}.json`), `${JSON.stringify(compiled)}\n`)
Expand Down
14 changes: 7 additions & 7 deletions scripts/parse-isc.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Parse every maps/*.isc with the interscript-ts ISC parser.
// Parse every maps/*.isc and libs/*.isc with the interscript-ts ISC parser.
// Usage: node scripts/parse-isc.mjs <path-to-interscript-ts-checkout>
import { readdirSync, readFileSync } from "node:fs"
import { pathToFileURL } from "node:url"
import { resolve } from "node:path"
import { basename, join, resolve } from "node:path"

const tsDir = process.argv[2]
if (!tsDir) {
Expand All @@ -13,16 +13,16 @@ if (!tsDir) {
const mod = await import(pathToFileURL(resolve(tsDir, "src/isc/parser.ts")))
const parseIsc = mod.parseIsc

const dir = new URL("../maps/", import.meta.url).pathname
const files = readdirSync(dir).filter((f) => f.endsWith(".isc"))
const roots = ["../maps/", "../libs/"].map((r) => new URL(r, import.meta.url).pathname)
const files = roots.flatMap((dir) => readdirSync(dir).filter((f) => f.endsWith(".isc")).map((f) => join(dir, f)))
let ok = 0
const failures = []
for (const f of files.sort()) {
for (const path of files.sort()) {
try {
parseIsc(readFileSync(resolve(dir, f), "utf8"), f)
parseIsc(readFileSync(path, "utf8"), basename(path))
ok++
} catch (e) {
failures.push(`${f}: ${e.message.slice(0, 120)}`)
failures.push(`${basename(path)}: ${e.message.slice(0, 120)}`)
}
}
console.log(`Parsed ${ok}/${files.length} .isc files`)
Expand Down
Loading