tsc-ts 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -2
- package/dist/api/compiler/ast-utilities.d.ts +82 -0
- package/dist/api/compiler/ast-utilities.js +462 -0
- package/dist/api/compiler/ast.d.ts +2351 -0
- package/dist/api/compiler/ast.js +11212 -0
- package/dist/api/compiler/astnav.d.ts +37 -0
- package/dist/api/compiler/astnav.js +767 -0
- package/dist/api/compiler/binder-utilities.d.ts +182 -0
- package/dist/api/compiler/binder-utilities.js +1241 -0
- package/dist/api/compiler/binder.d.ts +33 -0
- package/dist/api/compiler/binder.js +2359 -0
- package/dist/api/compiler/character-codes.d.ts +161 -0
- package/dist/api/compiler/character-codes.js +160 -0
- package/dist/api/compiler/checker-calls.d.ts +46 -0
- package/dist/api/compiler/checker-calls.js +1641 -0
- package/dist/api/compiler/checker-classes.d.ts +30 -0
- package/dist/api/compiler/checker-classes.js +582 -0
- package/dist/api/compiler/checker-contextual.d.ts +77 -0
- package/dist/api/compiler/checker-contextual.js +1136 -0
- package/dist/api/compiler/checker-declaration-order.d.ts +12 -0
- package/dist/api/compiler/checker-declaration-order.js +357 -0
- package/dist/api/compiler/checker-declarations.d.ts +33 -0
- package/dist/api/compiler/checker-declarations.js +888 -0
- package/dist/api/compiler/checker-declared-types.d.ts +48 -0
- package/dist/api/compiler/checker-declared-types.js +788 -0
- package/dist/api/compiler/checker-decorators.d.ts +26 -0
- package/dist/api/compiler/checker-decorators.js +562 -0
- package/dist/api/compiler/checker-deprecation.d.ts +33 -0
- package/dist/api/compiler/checker-deprecation.js +314 -0
- package/dist/api/compiler/checker-destructuring.d.ts +34 -0
- package/dist/api/compiler/checker-destructuring.js +584 -0
- package/dist/api/compiler/checker-elaboration.d.ts +15 -0
- package/dist/api/compiler/checker-elaboration.js +291 -0
- package/dist/api/compiler/checker-emit-helpers.d.ts +58 -0
- package/dist/api/compiler/checker-emit-helpers.js +154 -0
- package/dist/api/compiler/checker-emit-resolver.d.ts +75 -0
- package/dist/api/compiler/checker-emit-resolver.js +580 -0
- package/dist/api/compiler/checker-evaluator.d.ts +27 -0
- package/dist/api/compiler/checker-evaluator.js +188 -0
- package/dist/api/compiler/checker-expressions.d.ts +67 -0
- package/dist/api/compiler/checker-expressions.js +1351 -0
- package/dist/api/compiler/checker-features.d.ts +6 -0
- package/dist/api/compiler/checker-features.js +354 -0
- package/dist/api/compiler/checker-flow.d.ts +86 -0
- package/dist/api/compiler/checker-flow.js +169 -0
- package/dist/api/compiler/checker-functions.d.ts +43 -0
- package/dist/api/compiler/checker-functions.js +1002 -0
- package/dist/api/compiler/checker-generated-code.d.ts +25 -0
- package/dist/api/compiler/checker-generated-code.js +168 -0
- package/dist/api/compiler/checker-globals.d.ts +14 -0
- package/dist/api/compiler/checker-globals.js +37 -0
- package/dist/api/compiler/checker-grammar.d.ts +35 -0
- package/dist/api/compiler/checker-grammar.js +2587 -0
- package/dist/api/compiler/checker-heritage.d.ts +28 -0
- package/dist/api/compiler/checker-heritage.js +901 -0
- package/dist/api/compiler/checker-inference.d.ts +179 -0
- package/dist/api/compiler/checker-inference.js +2105 -0
- package/dist/api/compiler/checker-iteration.d.ts +115 -0
- package/dist/api/compiler/checker-iteration.js +857 -0
- package/dist/api/compiler/checker-javascript.d.ts +42 -0
- package/dist/api/compiler/checker-javascript.js +442 -0
- package/dist/api/compiler/checker-jsdoc.d.ts +30 -0
- package/dist/api/compiler/checker-jsdoc.js +320 -0
- package/dist/api/compiler/checker-jsx.d.ts +94 -0
- package/dist/api/compiler/checker-jsx.js +1433 -0
- package/dist/api/compiler/checker-literals.d.ts +6 -0
- package/dist/api/compiler/checker-literals.js +43 -0
- package/dist/api/compiler/checker-members.d.ts +200 -0
- package/dist/api/compiler/checker-members.js +2148 -0
- package/dist/api/compiler/checker-modules.d.ts +85 -0
- package/dist/api/compiler/checker-modules.js +2141 -0
- package/dist/api/compiler/checker-narrowing.d.ts +120 -0
- package/dist/api/compiler/checker-narrowing.js +2797 -0
- package/dist/api/compiler/checker-object-literals.d.ts +14 -0
- package/dist/api/compiler/checker-object-literals.js +483 -0
- package/dist/api/compiler/checker-operators.d.ts +33 -0
- package/dist/api/compiler/checker-operators.js +1040 -0
- package/dist/api/compiler/checker-overloads.d.ts +7 -0
- package/dist/api/compiler/checker-overloads.js +271 -0
- package/dist/api/compiler/checker-property-access.d.ts +34 -0
- package/dist/api/compiler/checker-property-access.js +672 -0
- package/dist/api/compiler/checker-services.d.ts +49 -0
- package/dist/api/compiler/checker-services.js +995 -0
- package/dist/api/compiler/checker-signatures.d.ts +55 -0
- package/dist/api/compiler/checker-signatures.js +789 -0
- package/dist/api/compiler/checker-source-file.d.ts +27 -0
- package/dist/api/compiler/checker-source-file.js +619 -0
- package/dist/api/compiler/checker-statements.d.ts +18 -0
- package/dist/api/compiler/checker-statements.js +226 -0
- package/dist/api/compiler/checker-super.d.ts +13 -0
- package/dist/api/compiler/checker-super.js +241 -0
- package/dist/api/compiler/checker-symbol-types.d.ts +51 -0
- package/dist/api/compiler/checker-symbol-types.js +955 -0
- package/dist/api/compiler/checker-symbols.d.ts +181 -0
- package/dist/api/compiler/checker-symbols.js +1784 -0
- package/dist/api/compiler/checker-type-factory.d.ts +142 -0
- package/dist/api/compiler/checker-type-factory.js +2542 -0
- package/dist/api/compiler/checker-type-nodes.d.ts +26 -0
- package/dist/api/compiler/checker-type-nodes.js +828 -0
- package/dist/api/compiler/checker-type-operators.d.ts +109 -0
- package/dist/api/compiler/checker-type-operators.js +1842 -0
- package/dist/api/compiler/checker-types.d.ts +1093 -0
- package/dist/api/compiler/checker-types.js +1874 -0
- package/dist/api/compiler/checker-unused.d.ts +19 -0
- package/dist/api/compiler/checker-unused.js +524 -0
- package/dist/api/compiler/checker-utilities.d.ts +33 -0
- package/dist/api/compiler/checker-utilities.js +141 -0
- package/dist/api/compiler/checker.d.ts +512 -0
- package/dist/api/compiler/checker.js +932 -0
- package/dist/api/compiler/command-line.d.ts +32 -0
- package/dist/api/compiler/command-line.js +383 -0
- package/dist/api/compiler/compile-program.d.ts +118 -0
- package/dist/api/compiler/compile-program.js +384 -0
- package/dist/api/compiler/diagnostic-locales.d.ts +22 -0
- package/dist/api/compiler/diagnostic-locales.js +64 -0
- package/dist/api/compiler/diagnostic-messages.d.ts +2166 -0
- package/dist/api/compiler/diagnostic-messages.js +184 -0
- package/dist/api/compiler/diagnostics.d.ts +161 -0
- package/dist/api/compiler/diagnostics.js +784 -0
- package/dist/api/compiler/emitter.d.ts +71 -0
- package/dist/api/compiler/emitter.js +327 -0
- package/dist/api/compiler/file-include.d.ts +144 -0
- package/dist/api/compiler/file-include.js +599 -0
- package/dist/api/compiler/file-loader.d.ts +290 -0
- package/dist/api/compiler/file-loader.js +1323 -0
- package/dist/api/compiler/file-system.d.ts +51 -0
- package/dist/api/compiler/file-system.js +132 -0
- package/dist/api/compiler/flow.d.ts +60 -0
- package/dist/api/compiler/flow.js +45 -0
- package/dist/api/compiler/instantiation.d.ts +74 -0
- package/dist/api/compiler/instantiation.js +835 -0
- package/dist/api/compiler/jsdoc.d.ts +75 -0
- package/dist/api/compiler/jsdoc.js +1229 -0
- package/dist/api/compiler/link-tables.d.ts +105 -0
- package/dist/api/compiler/link-tables.js +319 -0
- package/dist/api/compiler/locale-data.d.ts +24 -0
- package/dist/api/compiler/locale-data.js +183 -0
- package/dist/api/compiler/locale.d.ts +4 -0
- package/dist/api/compiler/locale.js +317 -0
- package/dist/api/compiler/locales/cs-CZ.d.ts +2 -0
- package/dist/api/compiler/locales/cs-CZ.js +3 -0
- package/dist/api/compiler/locales/de-DE.d.ts +2 -0
- package/dist/api/compiler/locales/de-DE.js +3 -0
- package/dist/api/compiler/locales/es-ES.d.ts +2 -0
- package/dist/api/compiler/locales/es-ES.js +3 -0
- package/dist/api/compiler/locales/fr-FR.d.ts +2 -0
- package/dist/api/compiler/locales/fr-FR.js +3 -0
- package/dist/api/compiler/locales/it-IT.d.ts +2 -0
- package/dist/api/compiler/locales/it-IT.js +3 -0
- package/dist/api/compiler/locales/ja-JP.d.ts +2 -0
- package/dist/api/compiler/locales/ja-JP.js +3 -0
- package/dist/api/compiler/locales/ko-KR.d.ts +2 -0
- package/dist/api/compiler/locales/ko-KR.js +3 -0
- package/dist/api/compiler/locales/pl-PL.d.ts +2 -0
- package/dist/api/compiler/locales/pl-PL.js +3 -0
- package/dist/api/compiler/locales/pt-BR.d.ts +2 -0
- package/dist/api/compiler/locales/pt-BR.js +3 -0
- package/dist/api/compiler/locales/ru-RU.d.ts +2 -0
- package/dist/api/compiler/locales/ru-RU.js +3 -0
- package/dist/api/compiler/locales/tr-TR.d.ts +2 -0
- package/dist/api/compiler/locales/tr-TR.js +3 -0
- package/dist/api/compiler/locales/zh-CN.d.ts +2 -0
- package/dist/api/compiler/locales/zh-CN.js +3 -0
- package/dist/api/compiler/locales/zh-TW.d.ts +2 -0
- package/dist/api/compiler/locales/zh-TW.js +3 -0
- package/dist/api/compiler/module-resolution-types.d.ts +83 -0
- package/dist/api/compiler/module-resolution-types.js +176 -0
- package/dist/api/compiler/module-resolution.d.ts +71 -0
- package/dist/api/compiler/module-resolution.js +1598 -0
- package/dist/api/compiler/module-specifiers.d.ts +64 -0
- package/dist/api/compiler/module-specifiers.js +1101 -0
- package/dist/api/compiler/name-resolver.d.ts +43 -0
- package/dist/api/compiler/name-resolver.js +509 -0
- package/dist/api/compiler/node-builder-names.d.ts +32 -0
- package/dist/api/compiler/node-builder-names.js +854 -0
- package/dist/api/compiler/node-builder-pseudo.d.ts +36 -0
- package/dist/api/compiler/node-builder-pseudo.js +745 -0
- package/dist/api/compiler/node-builder-reuse.d.ts +4 -0
- package/dist/api/compiler/node-builder-reuse.js +647 -0
- package/dist/api/compiler/node-builder.d.ts +270 -0
- package/dist/api/compiler/node-builder.js +2645 -0
- package/dist/api/compiler/option-declarations.d.ts +90 -0
- package/dist/api/compiler/option-declarations.js +1460 -0
- package/dist/api/compiler/options.d.ts +289 -0
- package/dist/api/compiler/options.js +1197 -0
- package/dist/api/compiler/output-paths.d.ts +42 -0
- package/dist/api/compiler/output-paths.js +195 -0
- package/dist/api/compiler/package-json.d.ts +175 -0
- package/dist/api/compiler/package-json.js +1015 -0
- package/dist/api/compiler/parallel-parse.d.ts +221 -0
- package/dist/api/compiler/parallel-parse.js +541 -0
- package/dist/api/compiler/parser.d.ts +604 -0
- package/dist/api/compiler/parser.js +6426 -0
- package/dist/api/compiler/path.d.ts +91 -0
- package/dist/api/compiler/path.js +705 -0
- package/dist/api/compiler/printer/async-helpers.d.ts +22 -0
- package/dist/api/compiler/printer/async-helpers.js +91 -0
- package/dist/api/compiler/printer/auto-generate.d.ts +13 -0
- package/dist/api/compiler/printer/auto-generate.js +20 -0
- package/dist/api/compiler/printer/decorator-helpers.d.ts +24 -0
- package/dist/api/compiler/printer/decorator-helpers.js +118 -0
- package/dist/api/compiler/printer/emit-context.d.ts +157 -0
- package/dist/api/compiler/printer/emit-context.js +582 -0
- package/dist/api/compiler/printer/emit-flags.d.ts +60 -0
- package/dist/api/compiler/printer/emit-flags.js +2 -0
- package/dist/api/compiler/printer/factory-base.d.ts +171 -0
- package/dist/api/compiler/printer/factory-base.js +1505 -0
- package/dist/api/compiler/printer/factory.d.ts +147 -0
- package/dist/api/compiler/printer/factory.js +542 -0
- package/dist/api/compiler/printer/helpers.d.ts +27 -0
- package/dist/api/compiler/printer/helpers.js +164 -0
- package/dist/api/compiler/printer/name-generator.d.ts +41 -0
- package/dist/api/compiler/printer/name-generator.js +283 -0
- package/dist/api/compiler/printer/printer.d.ts +411 -0
- package/dist/api/compiler/printer/printer.js +4517 -0
- package/dist/api/compiler/printer/text-writer.d.ts +46 -0
- package/dist/api/compiler/printer/text-writer.js +172 -0
- package/dist/api/compiler/printer/utilities.d.ts +82 -0
- package/dist/api/compiler/printer/utilities.js +817 -0
- package/dist/api/compiler/program-checker.d.ts +156 -0
- package/dist/api/compiler/program-checker.js +529 -0
- package/dist/api/compiler/program-utilities.d.ts +52 -0
- package/dist/api/compiler/program-utilities.js +365 -0
- package/dist/api/compiler/program.d.ts +180 -0
- package/dist/api/compiler/program.js +1019 -0
- package/dist/api/compiler/pseudo-bigint.d.ts +5 -0
- package/dist/api/compiler/pseudo-bigint.js +61 -0
- package/dist/api/compiler/regexp-checker.d.ts +38 -0
- package/dist/api/compiler/regexp-checker.js +942 -0
- package/dist/api/compiler/relations.d.ts +263 -0
- package/dist/api/compiler/relations.js +4002 -0
- package/dist/api/compiler/reparser.d.ts +48 -0
- package/dist/api/compiler/reparser.js +1323 -0
- package/dist/api/compiler/scanner.d.ts +256 -0
- package/dist/api/compiler/scanner.js +2853 -0
- package/dist/api/compiler/side-state.d.ts +16 -0
- package/dist/api/compiler/side-state.js +89 -0
- package/dist/api/compiler/sourcemap.d.ts +55 -0
- package/dist/api/compiler/sourcemap.js +340 -0
- package/dist/api/compiler/spelling.d.ts +14 -0
- package/dist/api/compiler/spelling.js +128 -0
- package/dist/api/compiler/symbol-accessibility.d.ts +57 -0
- package/dist/api/compiler/symbol-accessibility.js +991 -0
- package/dist/api/compiler/symbol.d.ts +282 -0
- package/dist/api/compiler/symbol.js +339 -0
- package/dist/api/compiler/symlinks.d.ts +32 -0
- package/dist/api/compiler/symlinks.js +114 -0
- package/dist/api/compiler/syntax-kind.d.ts +389 -0
- package/dist/api/compiler/syntax-kind.js +2 -0
- package/dist/api/compiler/timeline.d.ts +9 -0
- package/dist/api/compiler/timeline.js +54 -0
- package/dist/api/compiler/transformers/alias-references.d.ts +39 -0
- package/dist/api/compiler/transformers/alias-references.js +677 -0
- package/dist/api/compiler/transformers/async-utilities.d.ts +51 -0
- package/dist/api/compiler/transformers/async-utilities.js +260 -0
- package/dist/api/compiler/transformers/async.d.ts +53 -0
- package/dist/api/compiler/transformers/async.js +645 -0
- package/dist/api/compiler/transformers/class-fields.d.ts +206 -0
- package/dist/api/compiler/transformers/class-fields.js +2418 -0
- package/dist/api/compiler/transformers/class-utilities.d.ts +46 -0
- package/dist/api/compiler/transformers/class-utilities.js +261 -0
- package/dist/api/compiler/transformers/commonjs-module.d.ts +103 -0
- package/dist/api/compiler/transformers/commonjs-module.js +1180 -0
- package/dist/api/compiler/transformers/const-enum-inliner.d.ts +11 -0
- package/dist/api/compiler/transformers/const-enum-inliner.js +36 -0
- package/dist/api/compiler/transformers/declarations-diagnostics.d.ts +52 -0
- package/dist/api/compiler/transformers/declarations-diagnostics.js +539 -0
- package/dist/api/compiler/transformers/declarations-pseudo.d.ts +160 -0
- package/dist/api/compiler/transformers/declarations-pseudo.js +799 -0
- package/dist/api/compiler/transformers/declarations-resolver.d.ts +152 -0
- package/dist/api/compiler/transformers/declarations-resolver.js +35 -0
- package/dist/api/compiler/transformers/declarations-syntactic.d.ts +119 -0
- package/dist/api/compiler/transformers/declarations-syntactic.js +1582 -0
- package/dist/api/compiler/transformers/declarations-tracker.d.ts +46 -0
- package/dist/api/compiler/transformers/declarations-tracker.js +198 -0
- package/dist/api/compiler/transformers/declarations.d.ts +175 -0
- package/dist/api/compiler/transformers/declarations.js +2381 -0
- package/dist/api/compiler/transformers/decorator-metadata.d.ts +54 -0
- package/dist/api/compiler/transformers/decorator-metadata.js +554 -0
- package/dist/api/compiler/transformers/decorator-utilities.d.ts +38 -0
- package/dist/api/compiler/transformers/decorator-utilities.js +238 -0
- package/dist/api/compiler/transformers/destructuring.d.ts +25 -0
- package/dist/api/compiler/transformers/destructuring.js +626 -0
- package/dist/api/compiler/transformers/downlevel.d.ts +6 -0
- package/dist/api/compiler/transformers/downlevel.js +45 -0
- package/dist/api/compiler/transformers/emit-resolver.d.ts +61 -0
- package/dist/api/compiler/transformers/emit-resolver.js +197 -0
- package/dist/api/compiler/transformers/es-decorators.d.ts +118 -0
- package/dist/api/compiler/transformers/es-decorators.js +1901 -0
- package/dist/api/compiler/transformers/exponentiation.d.ts +11 -0
- package/dist/api/compiler/transformers/exponentiation.js +76 -0
- package/dist/api/compiler/transformers/external-module-info.d.ts +35 -0
- package/dist/api/compiler/transformers/external-module-info.js +351 -0
- package/dist/api/compiler/transformers/for-await.d.ts +43 -0
- package/dist/api/compiler/transformers/for-await.js +469 -0
- package/dist/api/compiler/transformers/import-elision.d.ts +16 -0
- package/dist/api/compiler/transformers/import-elision.js +124 -0
- package/dist/api/compiler/transformers/jsx-entities.d.ts +1 -0
- package/dist/api/compiler/transformers/jsx-entities.js +256 -0
- package/dist/api/compiler/transformers/jsx.d.ts +71 -0
- package/dist/api/compiler/transformers/jsx.js +700 -0
- package/dist/api/compiler/transformers/legacy-decorators.d.ts +56 -0
- package/dist/api/compiler/transformers/legacy-decorators.js +564 -0
- package/dist/api/compiler/transformers/logical-assignment.d.ts +14 -0
- package/dist/api/compiler/transformers/logical-assignment.js +62 -0
- package/dist/api/compiler/transformers/module-utilities.d.ts +9 -0
- package/dist/api/compiler/transformers/module-utilities.js +36 -0
- package/dist/api/compiler/transformers/module.d.ts +49 -0
- package/dist/api/compiler/transformers/module.js +296 -0
- package/dist/api/compiler/transformers/named-evaluation.d.ts +26 -0
- package/dist/api/compiler/transformers/named-evaluation.js +266 -0
- package/dist/api/compiler/transformers/nullish-coalescing.d.ts +9 -0
- package/dist/api/compiler/transformers/nullish-coalescing.js +26 -0
- package/dist/api/compiler/transformers/object-rest-spread.d.ts +34 -0
- package/dist/api/compiler/transformers/object-rest-spread.js +411 -0
- package/dist/api/compiler/transformers/optional-catch.d.ts +9 -0
- package/dist/api/compiler/transformers/optional-catch.js +20 -0
- package/dist/api/compiler/transformers/optional-chain.d.ts +14 -0
- package/dist/api/compiler/transformers/optional-chain.js +188 -0
- package/dist/api/compiler/transformers/reference-resolver.d.ts +129 -0
- package/dist/api/compiler/transformers/reference-resolver.js +1157 -0
- package/dist/api/compiler/transformers/runtime-syntax.d.ts +71 -0
- package/dist/api/compiler/transformers/runtime-syntax.js +753 -0
- package/dist/api/compiler/transformers/subtree-facts.d.ts +10 -0
- package/dist/api/compiler/transformers/subtree-facts.js +205 -0
- package/dist/api/compiler/transformers/syntax-facts.d.ts +52 -0
- package/dist/api/compiler/transformers/syntax-facts.js +258 -0
- package/dist/api/compiler/transformers/tagged-template.d.ts +17 -0
- package/dist/api/compiler/transformers/tagged-template.js +148 -0
- package/dist/api/compiler/transformers/transformer.d.ts +17 -0
- package/dist/api/compiler/transformers/transformer.js +54 -0
- package/dist/api/compiler/transformers/type-eraser.d.ts +21 -0
- package/dist/api/compiler/transformers/type-eraser.js +346 -0
- package/dist/api/compiler/transformers/type-serialization.d.ts +20 -0
- package/dist/api/compiler/transformers/type-serialization.js +347 -0
- package/dist/api/compiler/transformers/using.d.ts +56 -0
- package/dist/api/compiler/transformers/using.js +453 -0
- package/dist/api/compiler/transformers/utilities.d.ts +50 -0
- package/dist/api/compiler/transformers/utilities.js +347 -0
- package/dist/api/compiler/transformers/visitor-base.d.ts +6 -0
- package/dist/api/compiler/transformers/visitor-base.js +817 -0
- package/dist/api/compiler/transformers/visitor-hooks.d.ts +29 -0
- package/dist/api/compiler/transformers/visitor-hooks.js +189 -0
- package/dist/api/compiler/tsconfig.d.ts +177 -0
- package/dist/api/compiler/tsconfig.js +1311 -0
- package/dist/api/compiler/type-printer.d.ts +15 -0
- package/dist/api/compiler/type-printer.js +74 -0
- package/dist/api/compiler/types.d.ts +87 -0
- package/dist/api/compiler/types.js +23 -0
- package/dist/api/compiler/unicode-identifiers.d.ts +2 -0
- package/dist/api/compiler/unicode-identifiers.js +209 -0
- package/dist/api/compiler/unicode-properties.d.ts +8 -0
- package/dist/api/compiler/unicode-properties.js +531 -0
- package/dist/api/compiler/vfs-match.d.ts +24 -0
- package/dist/api/compiler/vfs-match.js +587 -0
- package/dist/api/library/ast.d.ts +3 -2
- package/dist/api/library/ast.generated.d.ts +127 -139
- package/dist/api/library/checker.d.ts +51 -0
- package/dist/api/library/checker.js +318 -0
- package/dist/api/library/diagnostics.d.ts +13 -0
- package/dist/api/library/diagnostics.js +50 -0
- package/dist/api/library/disk.d.ts +13 -0
- package/dist/api/library/disk.js +66 -0
- package/dist/api/library/errors.d.ts +13 -0
- package/dist/api/library/errors.js +24 -0
- package/dist/api/library/host.d.ts +24 -0
- package/dist/api/library/host.js +52 -0
- package/dist/api/library/index.d.ts +5 -1
- package/dist/api/library/index.js +4 -0
- package/dist/api/library/nodes.d.ts +51 -0
- package/dist/api/library/nodes.js +196 -0
- package/dist/api/library/options.d.ts +144 -0
- package/dist/api/library/options.js +308 -0
- package/dist/api/library/parse.d.ts +19 -0
- package/dist/api/library/parse.js +41 -0
- package/dist/api/library/program.d.ts +21 -0
- package/dist/api/library/program.js +234 -0
- package/dist/api/library/types.d.ts +14 -1
- package/package.json +12 -8
- package/src/compiler/ast-utilities.ts +548 -0
- package/src/compiler/ast.ts +12870 -0
- package/src/compiler/astnav.ts +799 -0
- package/src/compiler/binder-utilities.ts +1392 -0
- package/src/compiler/binder.ts +2707 -0
- package/src/compiler/build-info.ts +1197 -0
- package/src/compiler/character-codes.ts +323 -0
- package/src/compiler/checker-calls.ts +2155 -0
- package/src/compiler/checker-classes.ts +706 -0
- package/src/compiler/checker-contextual.ts +1457 -0
- package/src/compiler/checker-declaration-order.ts +438 -0
- package/src/compiler/checker-declarations.ts +1201 -0
- package/src/compiler/checker-declared-types.ts +919 -0
- package/src/compiler/checker-decorators.ts +694 -0
- package/src/compiler/checker-deprecation.ts +355 -0
- package/src/compiler/checker-destructuring.ts +805 -0
- package/src/compiler/checker-elaboration.ts +477 -0
- package/src/compiler/checker-emit-helpers.ts +224 -0
- package/src/compiler/checker-emit-resolver.ts +769 -0
- package/src/compiler/checker-evaluator.ts +243 -0
- package/src/compiler/checker-expressions.ts +1831 -0
- package/src/compiler/checker-features.ts +361 -0
- package/src/compiler/checker-flow.ts +394 -0
- package/src/compiler/checker-functions.ts +1296 -0
- package/src/compiler/checker-generated-code.ts +227 -0
- package/src/compiler/checker-globals.ts +52 -0
- package/src/compiler/checker-grammar.ts +3596 -0
- package/src/compiler/checker-heritage.ts +1240 -0
- package/src/compiler/checker-inference.ts +2584 -0
- package/src/compiler/checker-iteration.ts +1206 -0
- package/src/compiler/checker-javascript.ts +502 -0
- package/src/compiler/checker-jsdoc.ts +360 -0
- package/src/compiler/checker-jsx.ts +1928 -0
- package/src/compiler/checker-literals.ts +61 -0
- package/src/compiler/checker-members.ts +2480 -0
- package/src/compiler/checker-modules.ts +2896 -0
- package/src/compiler/checker-narrowing.ts +3230 -0
- package/src/compiler/checker-object-literals.ts +591 -0
- package/src/compiler/checker-operators.ts +1422 -0
- package/src/compiler/checker-overloads.ts +328 -0
- package/src/compiler/checker-property-access.ts +906 -0
- package/src/compiler/checker-services.ts +1149 -0
- package/src/compiler/checker-signatures.ts +1032 -0
- package/src/compiler/checker-source-file.ts +732 -0
- package/src/compiler/checker-statements.ts +292 -0
- package/src/compiler/checker-super.ts +261 -0
- package/src/compiler/checker-symbol-types.ts +1187 -0
- package/src/compiler/checker-symbols.ts +2157 -0
- package/src/compiler/checker-type-factory.ts +2616 -0
- package/src/compiler/checker-type-nodes.ts +1033 -0
- package/src/compiler/checker-type-operators.ts +2510 -0
- package/src/compiler/checker-types.ts +2520 -0
- package/src/compiler/checker-unused.ts +642 -0
- package/src/compiler/checker-utilities.ts +161 -0
- package/src/compiler/checker.ts +1138 -0
- package/src/compiler/command-line.ts +436 -0
- package/src/compiler/compile-program.ts +439 -0
- package/src/compiler/decoder.ts +1209 -0
- package/src/compiler/diagnostic-locales.ts +86 -0
- package/src/compiler/diagnostic-messages.ts +2349 -0
- package/src/compiler/diagnostics.ts +858 -0
- package/src/compiler/emitter.ts +434 -0
- package/src/compiler/encoder.ts +1945 -0
- package/src/compiler/file-include.ts +741 -0
- package/src/compiler/file-loader.ts +1597 -0
- package/src/compiler/file-system.ts +143 -0
- package/src/compiler/flow.ts +89 -0
- package/src/compiler/help.ts +473 -0
- package/src/compiler/incremental.ts +2818 -0
- package/src/compiler/init.ts +141 -0
- package/src/compiler/instantiation.ts +938 -0
- package/src/compiler/jsdoc.ts +1386 -0
- package/src/compiler/link-tables.ts +343 -0
- package/src/compiler/locale-data.ts +203 -0
- package/src/compiler/locale.ts +307 -0
- package/src/compiler/locales/cs-CZ.ts +5 -0
- package/src/compiler/locales/de-DE.ts +5 -0
- package/src/compiler/locales/es-ES.ts +5 -0
- package/src/compiler/locales/fr-FR.ts +5 -0
- package/src/compiler/locales/it-IT.ts +5 -0
- package/src/compiler/locales/ja-JP.ts +5 -0
- package/src/compiler/locales/ko-KR.ts +5 -0
- package/src/compiler/locales/pl-PL.ts +5 -0
- package/src/compiler/locales/pt-BR.ts +5 -0
- package/src/compiler/locales/ru-RU.ts +5 -0
- package/src/compiler/locales/tr-TR.ts +5 -0
- package/src/compiler/locales/zh-CN.ts +5 -0
- package/src/compiler/locales/zh-TW.ts +5 -0
- package/src/compiler/module-resolution-types.ts +243 -0
- package/src/compiler/module-resolution.ts +2072 -0
- package/src/compiler/module-specifiers.ts +1491 -0
- package/src/compiler/name-resolver.ts +646 -0
- package/src/compiler/node-builder-names.ts +1071 -0
- package/src/compiler/node-builder-pseudo.ts +892 -0
- package/src/compiler/node-builder-reuse.ts +764 -0
- package/src/compiler/node-builder.ts +3433 -0
- package/src/compiler/option-declarations.ts +1560 -0
- package/src/compiler/options.ts +1576 -0
- package/src/compiler/output-paths.ts +334 -0
- package/src/compiler/package-json.ts +1083 -0
- package/src/compiler/parallel-check.ts +1954 -0
- package/src/compiler/parallel-parse.ts +595 -0
- package/src/compiler/parse-thread.ts +136 -0
- package/src/compiler/parser.ts +7766 -0
- package/src/compiler/path.ts +717 -0
- package/src/compiler/printer/async-helpers.ts +183 -0
- package/src/compiler/printer/auto-generate.ts +27 -0
- package/src/compiler/printer/decorator-helpers.ts +218 -0
- package/src/compiler/printer/emit-context.ts +684 -0
- package/src/compiler/printer/emit-flags.ts +64 -0
- package/src/compiler/printer/factory-base.ts +2577 -0
- package/src/compiler/printer/factory.ts +764 -0
- package/src/compiler/printer/helpers.ts +291 -0
- package/src/compiler/printer/name-generator.ts +372 -0
- package/src/compiler/printer/printer.ts +5072 -0
- package/src/compiler/printer/text-writer.ts +183 -0
- package/src/compiler/printer/utilities.ts +884 -0
- package/src/compiler/program-checker.ts +594 -0
- package/src/compiler/program-utilities.ts +435 -0
- package/src/compiler/program.ts +1426 -0
- package/src/compiler/pseudo-bigint.ts +62 -0
- package/src/compiler/regexp-checker.ts +1142 -0
- package/src/compiler/relations.ts +5149 -0
- package/src/compiler/reparser.ts +1566 -0
- package/src/compiler/scanner.ts +2951 -0
- package/src/compiler/show-config.ts +239 -0
- package/src/compiler/side-state.ts +125 -0
- package/src/compiler/sourcemap.ts +366 -0
- package/src/compiler/spelling.ts +122 -0
- package/src/compiler/symbol-accessibility.ts +1166 -0
- package/src/compiler/symbol.ts +557 -0
- package/src/compiler/symlinks.ts +137 -0
- package/src/compiler/syntax-kind.ts +391 -0
- package/src/compiler/thread-entry.ts +191 -0
- package/src/compiler/timeline.ts +53 -0
- package/src/compiler/transformers/alias-references.ts +757 -0
- package/src/compiler/transformers/async-utilities.ts +335 -0
- package/src/compiler/transformers/async.ts +838 -0
- package/src/compiler/transformers/class-fields.ts +2967 -0
- package/src/compiler/transformers/class-utilities.ts +324 -0
- package/src/compiler/transformers/commonjs-module.ts +1621 -0
- package/src/compiler/transformers/const-enum-inliner.ts +50 -0
- package/src/compiler/transformers/declarations-diagnostics.ts +833 -0
- package/src/compiler/transformers/declarations-pseudo.ts +969 -0
- package/src/compiler/transformers/declarations-resolver.ts +249 -0
- package/src/compiler/transformers/declarations-syntactic.ts +1867 -0
- package/src/compiler/transformers/declarations-tracker.ts +269 -0
- package/src/compiler/transformers/declarations.ts +3120 -0
- package/src/compiler/transformers/decorator-metadata.ts +697 -0
- package/src/compiler/transformers/decorator-utilities.ts +283 -0
- package/src/compiler/transformers/destructuring.ts +708 -0
- package/src/compiler/transformers/downlevel.ts +50 -0
- package/src/compiler/transformers/emit-resolver.ts +258 -0
- package/src/compiler/transformers/es-decorators.ts +2682 -0
- package/src/compiler/transformers/exponentiation.ts +80 -0
- package/src/compiler/transformers/external-module-info.ts +412 -0
- package/src/compiler/transformers/for-await.ts +687 -0
- package/src/compiler/transformers/import-elision.ts +152 -0
- package/src/compiler/transformers/jsx-entities.ts +256 -0
- package/src/compiler/transformers/jsx.ts +824 -0
- package/src/compiler/transformers/legacy-decorators.ts +726 -0
- package/src/compiler/transformers/logical-assignment.ts +75 -0
- package/src/compiler/transformers/module-utilities.ts +42 -0
- package/src/compiler/transformers/module.ts +474 -0
- package/src/compiler/transformers/named-evaluation.ts +389 -0
- package/src/compiler/transformers/nullish-coalescing.ts +35 -0
- package/src/compiler/transformers/object-rest-spread.ts +577 -0
- package/src/compiler/transformers/optional-catch.ts +29 -0
- package/src/compiler/transformers/optional-chain.ts +246 -0
- package/src/compiler/transformers/reference-resolver.ts +1213 -0
- package/src/compiler/transformers/runtime-syntax.ts +942 -0
- package/src/compiler/transformers/subtree-facts.ts +253 -0
- package/src/compiler/transformers/syntax-facts.ts +358 -0
- package/src/compiler/transformers/tagged-template.ts +167 -0
- package/src/compiler/transformers/transformer.ts +56 -0
- package/src/compiler/transformers/type-eraser.ts +520 -0
- package/src/compiler/transformers/type-serialization.ts +374 -0
- package/src/compiler/transformers/using.ts +613 -0
- package/src/compiler/transformers/utilities.ts +419 -0
- package/src/compiler/transformers/visitor-base.ts +1601 -0
- package/src/compiler/transformers/visitor-hooks.ts +252 -0
- package/src/compiler/tsc-build.ts +1422 -0
- package/src/compiler/tsc-cli.ts +669 -0
- package/src/compiler/tsc-compile.ts +446 -0
- package/src/compiler/tsc-watch.ts +922 -0
- package/src/compiler/tsconfig.ts +1574 -0
- package/src/compiler/type-printer.ts +110 -0
- package/src/compiler/types.ts +115 -0
- package/src/compiler/unicode-identifiers.ts +212 -0
- package/src/compiler/unicode-properties.ts +537 -0
- package/src/compiler/vfs-match.ts +597 -0
- package/src/compiler/xxh3.ts +650 -0
- package/src/library/ast.generated.ts +141 -167
- package/src/library/ast.ts +4 -1
- package/src/library/checker.ts +384 -0
- package/src/library/diagnostics.ts +72 -0
- package/src/library/disk.ts +73 -0
- package/src/library/errors.ts +26 -0
- package/src/library/host.ts +63 -0
- package/src/library/index.ts +21 -0
- package/src/library/nodes.ts +232 -0
- package/src/library/options.ts +449 -0
- package/src/library/parse.ts +63 -0
- package/src/library/program.ts +293 -0
- package/src/library/types.ts +14 -1
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
// Side tables of checker links, indexed by node or symbol id.
|
|
2
|
+
//
|
|
3
|
+
// The checker caches values per node and per symbol. A cached value that many nodes or symbols
|
|
4
|
+
// have lives in a table of its own (a column) instead of a field of a links object, so a node or
|
|
5
|
+
// symbol costs a slot in each column it uses rather than a whole object, and a lookup is two
|
|
6
|
+
// array reads. Columns are stored in pages of `LinkPaging.Size` ids created on first write: a
|
|
7
|
+
// checker that touches part of a program (as each of several parallel checkers does) stores only
|
|
8
|
+
// the pages it touches.
|
|
9
|
+
|
|
10
|
+
import type { Symbol } from './symbol.js';
|
|
11
|
+
|
|
12
|
+
/** Links are stored in pages of 256 ids. */
|
|
13
|
+
export const enum LinkPaging {
|
|
14
|
+
Bits = 8,
|
|
15
|
+
Size = 1 << Bits,
|
|
16
|
+
Mask = Size - 1,
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** A page of values, indexed by the low bits of an id; undefined until a value in it is stored. */
|
|
20
|
+
export type LinkPage<T> = (T | undefined)[] | undefined;
|
|
21
|
+
|
|
22
|
+
/** Values by id; undefined where none is stored. */
|
|
23
|
+
export class LinkTable<T> {
|
|
24
|
+
readonly pages: LinkPage<T>[] = [];
|
|
25
|
+
|
|
26
|
+
get(id: number): T | undefined {
|
|
27
|
+
const page = this.pages[id >> LinkPaging.Bits];
|
|
28
|
+
return page !== undefined ? page[id & LinkPaging.Mask] : undefined;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
set(id: number, value: T | undefined): void {
|
|
32
|
+
const index = id >> LinkPaging.Bits;
|
|
33
|
+
const page = this.pages[index];
|
|
34
|
+
if (page !== undefined) page[id & LinkPaging.Mask] = value;
|
|
35
|
+
else if (value !== undefined) newLinkPage(this.pages, index)[id & LinkPaging.Mask] = value;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
clear(): void {
|
|
39
|
+
this.pages.length = 0;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Creates the page at `index`, filling the gap below it so the page list stays dense. */
|
|
44
|
+
export function newLinkPage<T>(pages: LinkPage<T>[], index: number): (T | undefined)[] {
|
|
45
|
+
while (pages.length <= index) pages.push(undefined);
|
|
46
|
+
const page: (T | undefined)[] = [];
|
|
47
|
+
for (let i = 0; i < LinkPaging.Size; i++) page.push(undefined);
|
|
48
|
+
pages[index] = page;
|
|
49
|
+
return page;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Int32 values by id, zero where none is stored: flags and small counters. */
|
|
53
|
+
export class IntLinkTable {
|
|
54
|
+
readonly pages: (Int32Array | undefined)[] = [];
|
|
55
|
+
|
|
56
|
+
get(id: number): number {
|
|
57
|
+
const page = this.pages[id >> LinkPaging.Bits];
|
|
58
|
+
return page !== undefined ? page[id & LinkPaging.Mask]! : 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
set(id: number, value: number): void {
|
|
62
|
+
const index = id >> LinkPaging.Bits;
|
|
63
|
+
const page = this.pages[index];
|
|
64
|
+
if (page !== undefined) page[id & LinkPaging.Mask] = value;
|
|
65
|
+
else if (value !== 0) this.newPage(index)[id & LinkPaging.Mask] = value;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
private newPage(index: number): Int32Array {
|
|
69
|
+
while (this.pages.length <= index) this.pages.push(undefined);
|
|
70
|
+
const page = new Int32Array(LinkPaging.Size);
|
|
71
|
+
this.pages[index] = page;
|
|
72
|
+
return page;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
clear(): void {
|
|
76
|
+
this.pages.length = 0;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Values by id in a map, for ids that are sparse: a checker caches values for a small part of the
|
|
82
|
+
* nodes of a program, spread over the declaration files it reads, where a page would mostly hold
|
|
83
|
+
* empty slots.
|
|
84
|
+
*/
|
|
85
|
+
export class SparseLinkTable<T> {
|
|
86
|
+
readonly values = new Map<number, T>();
|
|
87
|
+
|
|
88
|
+
get(id: number): T | undefined {
|
|
89
|
+
return this.values.get(id);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
set(id: number, value: T | undefined): void {
|
|
93
|
+
if (value !== undefined) this.values.set(id, value);
|
|
94
|
+
else this.values.delete(id);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
clear(): void {
|
|
98
|
+
this.values.clear();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Values by id for ids in a few clusters, as one file's emit uses them: the file's nodes and the
|
|
104
|
+
* nodes the emit synthesizes, far above them. Pages of `LinkPaging.Size` ids are found through a
|
|
105
|
+
* map from the page index, so the ids between clusters cost nothing, and the page of the last
|
|
106
|
+
* lookup is kept, since lookups come in runs of nearby ids.
|
|
107
|
+
*/
|
|
108
|
+
export class ClusteredLinkTable<T> {
|
|
109
|
+
private readonly pages = new Map<number, (T | undefined)[]>();
|
|
110
|
+
private lastIndex = -1;
|
|
111
|
+
private lastPage: (T | undefined)[] | undefined = undefined;
|
|
112
|
+
|
|
113
|
+
get(id: number): T | undefined {
|
|
114
|
+
const page = this.pageOf(id >> LinkPaging.Bits);
|
|
115
|
+
return page !== undefined ? page[id & LinkPaging.Mask] : undefined;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
set(id: number, value: T | undefined): void {
|
|
119
|
+
const index = id >> LinkPaging.Bits;
|
|
120
|
+
const page = this.pageOf(index);
|
|
121
|
+
if (page !== undefined) page[id & LinkPaging.Mask] = value;
|
|
122
|
+
else if (value !== undefined) {
|
|
123
|
+
const created: (T | undefined)[] = [];
|
|
124
|
+
for (let i = 0; i < LinkPaging.Size; i++) created.push(undefined);
|
|
125
|
+
created[id & LinkPaging.Mask] = value;
|
|
126
|
+
this.pages.set(index, created);
|
|
127
|
+
this.lastPage = created;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
private pageOf(index: number): (T | undefined)[] | undefined {
|
|
132
|
+
if (index !== this.lastIndex) {
|
|
133
|
+
this.lastIndex = index;
|
|
134
|
+
this.lastPage = this.pages.get(index);
|
|
135
|
+
}
|
|
136
|
+
return this.lastPage;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/** Int32 values by id, zero where none is stored, for ids in a few clusters (`ClusteredLinkTable`). */
|
|
141
|
+
export class ClusteredIntLinkTable {
|
|
142
|
+
private readonly pages = new Map<number, Int32Array>();
|
|
143
|
+
private lastIndex = -1;
|
|
144
|
+
private lastPage: Int32Array | undefined = undefined;
|
|
145
|
+
|
|
146
|
+
get(id: number): number {
|
|
147
|
+
const page = this.pageOf(id >> LinkPaging.Bits);
|
|
148
|
+
return page !== undefined ? page[id & LinkPaging.Mask]! : 0;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
set(id: number, value: number): void {
|
|
152
|
+
const index = id >> LinkPaging.Bits;
|
|
153
|
+
const page = this.pageOf(index);
|
|
154
|
+
if (page !== undefined) page[id & LinkPaging.Mask] = value;
|
|
155
|
+
else if (value !== 0) {
|
|
156
|
+
const created = new Int32Array(LinkPaging.Size);
|
|
157
|
+
created[id & LinkPaging.Mask] = value;
|
|
158
|
+
this.pages.set(index, created);
|
|
159
|
+
this.lastPage = created;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
private pageOf(index: number): Int32Array | undefined {
|
|
164
|
+
if (index !== this.lastIndex) {
|
|
165
|
+
this.lastIndex = index;
|
|
166
|
+
this.lastPage = this.pages.get(index);
|
|
167
|
+
}
|
|
168
|
+
return this.lastPage;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/** The number of set bits of a 32-bit value. */
|
|
173
|
+
function bitCount(x: number): number {
|
|
174
|
+
x = x - ((x >>> 1) & 0x55555555);
|
|
175
|
+
x = (x & 0x33333333) + ((x >>> 2) & 0x33333333);
|
|
176
|
+
x = (x + (x >>> 4)) & 0x0f0f0f0f;
|
|
177
|
+
return Math.imul(x, 0x01010101) >>> 24;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* A page of a `CompactSymbolLinkTable`: one bit per id of the page in eight 32-id words, the number
|
|
182
|
+
* of symbols stored before each word, and the symbols in id order. The words are fields, so a
|
|
183
|
+
* lookup reads one object before the symbols. The class isn't generic, so natively the words are
|
|
184
|
+
* 32-bit fields: every write stores an int32.
|
|
185
|
+
*/
|
|
186
|
+
class CompactLinkPage {
|
|
187
|
+
readonly values: Symbol[];
|
|
188
|
+
private w0: number;
|
|
189
|
+
private w1: number;
|
|
190
|
+
private w2: number;
|
|
191
|
+
private w3: number;
|
|
192
|
+
private w4: number;
|
|
193
|
+
private w5: number;
|
|
194
|
+
private w6: number;
|
|
195
|
+
private w7: number;
|
|
196
|
+
/** Byte `w & 3` of `before0` (words 1 to 3) or of `before1` (words 4 to 7): the values before word `w`. */
|
|
197
|
+
private before0: number;
|
|
198
|
+
private before1: number;
|
|
199
|
+
|
|
200
|
+
constructor() {
|
|
201
|
+
this.values = [];
|
|
202
|
+
this.w0 = 0;
|
|
203
|
+
this.w1 = 0;
|
|
204
|
+
this.w2 = 0;
|
|
205
|
+
this.w3 = 0;
|
|
206
|
+
this.w4 = 0;
|
|
207
|
+
this.w5 = 0;
|
|
208
|
+
this.w6 = 0;
|
|
209
|
+
this.w7 = 0;
|
|
210
|
+
this.before0 = 0;
|
|
211
|
+
this.before1 = 0;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/** The presence bits of ids `32 * word` to `32 * word + 31`. */
|
|
215
|
+
word(word: number): number {
|
|
216
|
+
switch (word) {
|
|
217
|
+
case 0:
|
|
218
|
+
return this.w0;
|
|
219
|
+
case 1:
|
|
220
|
+
return this.w1;
|
|
221
|
+
case 2:
|
|
222
|
+
return this.w2;
|
|
223
|
+
case 3:
|
|
224
|
+
return this.w3;
|
|
225
|
+
case 4:
|
|
226
|
+
return this.w4;
|
|
227
|
+
case 5:
|
|
228
|
+
return this.w5;
|
|
229
|
+
case 6:
|
|
230
|
+
return this.w6;
|
|
231
|
+
default:
|
|
232
|
+
return this.w7;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
setWord(word: number, bits: number): void {
|
|
237
|
+
switch (word) {
|
|
238
|
+
case 0:
|
|
239
|
+
this.w0 = bits | 0;
|
|
240
|
+
break;
|
|
241
|
+
case 1:
|
|
242
|
+
this.w1 = bits | 0;
|
|
243
|
+
break;
|
|
244
|
+
case 2:
|
|
245
|
+
this.w2 = bits | 0;
|
|
246
|
+
break;
|
|
247
|
+
case 3:
|
|
248
|
+
this.w3 = bits | 0;
|
|
249
|
+
break;
|
|
250
|
+
case 4:
|
|
251
|
+
this.w4 = bits | 0;
|
|
252
|
+
break;
|
|
253
|
+
case 5:
|
|
254
|
+
this.w5 = bits | 0;
|
|
255
|
+
break;
|
|
256
|
+
case 6:
|
|
257
|
+
this.w6 = bits | 0;
|
|
258
|
+
break;
|
|
259
|
+
default:
|
|
260
|
+
this.w7 = bits | 0;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/** The index in `values` of the value of `slot` (an id's low bits), or of where it goes. */
|
|
265
|
+
rank(slot: number, bits: number): number {
|
|
266
|
+
const word = slot >> 5;
|
|
267
|
+
const before = ((word < 4 ? this.before0 : this.before1) >>> ((word & 3) << 3)) & 0xff;
|
|
268
|
+
return before + bitCount(bits & ((1 << (slot & 31)) - 1));
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/** Adds `delta` to the counts of the words after `word`. */
|
|
272
|
+
shiftCounts(word: number, delta: number): void {
|
|
273
|
+
for (let w = word + 1; w < 8; w++) {
|
|
274
|
+
const step = delta << ((w & 3) << 3);
|
|
275
|
+
if (w < 4) this.before0 = (this.before0 + step) | 0;
|
|
276
|
+
else this.before1 = (this.before1 + step) | 0;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Symbols by node id, for ids a checker resolves in one in four to one in eight of the ids of the
|
|
283
|
+
* pages it touches, as it resolves the identifiers and names of the files it checks. Pages of
|
|
284
|
+
* `LinkPaging.Size` ids keep a presence bit per id and only the symbols stored, so a symbol costs
|
|
285
|
+
* about one array slot. A `LinkTable` page costs a slot for every id, and a `Map` entry also
|
|
286
|
+
* stores its key and a share of the hash buckets. At fewer values per page than that, the page's
|
|
287
|
+
* own allocations outweigh what it saves, and a `SparseLinkTable` costs less.
|
|
288
|
+
*/
|
|
289
|
+
export class CompactSymbolLinkTable {
|
|
290
|
+
readonly pages: (CompactLinkPage | undefined)[] = [];
|
|
291
|
+
/** The number of symbols stored. */
|
|
292
|
+
size = 0;
|
|
293
|
+
|
|
294
|
+
get(id: number): Symbol | undefined {
|
|
295
|
+
const page = this.pages[id >> LinkPaging.Bits];
|
|
296
|
+
if (page === undefined) return undefined;
|
|
297
|
+
const slot = id & LinkPaging.Mask;
|
|
298
|
+
const bits = page.word(slot >> 5);
|
|
299
|
+
if ((bits & (1 << (slot & 31))) === 0) return undefined;
|
|
300
|
+
return page.values[page.rank(slot, bits)];
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
set(id: number, value: Symbol | undefined): void {
|
|
304
|
+
const index = id >> LinkPaging.Bits;
|
|
305
|
+
let page = this.pages[index];
|
|
306
|
+
if (page === undefined) {
|
|
307
|
+
if (value === undefined) return;
|
|
308
|
+
while (this.pages.length <= index) this.pages.push(undefined);
|
|
309
|
+
page = new CompactLinkPage();
|
|
310
|
+
this.pages[index] = page;
|
|
311
|
+
}
|
|
312
|
+
const slot = id & LinkPaging.Mask;
|
|
313
|
+
const word = slot >> 5;
|
|
314
|
+
const bit = 1 << (slot & 31);
|
|
315
|
+
const bits = page.word(word);
|
|
316
|
+
const at = page.rank(slot, bits);
|
|
317
|
+
const values = page.values;
|
|
318
|
+
if ((bits & bit) !== 0) {
|
|
319
|
+
if (value !== undefined) {
|
|
320
|
+
values[at] = value;
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
for (let i = at; i < values.length - 1; i++) values[i] = values[i + 1]!;
|
|
324
|
+
values.pop();
|
|
325
|
+
page.setWord(word, bits & ~bit);
|
|
326
|
+
page.shiftCounts(word, -1);
|
|
327
|
+
this.size--;
|
|
328
|
+
return;
|
|
329
|
+
}
|
|
330
|
+
if (value === undefined) return;
|
|
331
|
+
values.push(value);
|
|
332
|
+
for (let i = values.length - 1; i > at; i--) values[i] = values[i - 1]!;
|
|
333
|
+
values[at] = value;
|
|
334
|
+
page.setWord(word, bits | bit);
|
|
335
|
+
page.shiftCounts(word, 1);
|
|
336
|
+
this.size++;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
clear(): void {
|
|
340
|
+
this.pages.length = 0;
|
|
341
|
+
this.size = 0;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
// Locale data of golang.org/x/text/language v0.38.0: the subtag registry tsgo validates `--locale`
|
|
2
|
+
// against, and the CLDR matching results it picks a translation with.
|
|
3
|
+
//
|
|
4
|
+
// Registry lists are space-separated and lowercase.
|
|
5
|
+
|
|
6
|
+
/** Known three-letter language subtags as a bitset over `aaa`..`zzz`, six bits per base64 character. */
|
|
7
|
+
export const languages3 =
|
|
8
|
+
'/3//+////u9+/7v+3/BPX92l7h////Pc/Ow///cBFKX+/3//////3//////////4p////3EvK43////////9//////9b0HP8dd+n' +
|
|
9
|
+
'UcAIf3/n/lcI4////////////9///////////f/f////////v///////v//////v//////9//v////3///v////////9//f/////' +
|
|
10
|
+
'//////v////3///37///+/////////3v9Xdr/B0/cG8QswQJBBAUEBAw//v/fSrQFZ9m0g497d+FWVVfOwxN/N/7//fX4UGCAAB/' +
|
|
11
|
+
'//7////f34zxH/9/BEIAwWAgAACAAMAUAAkkhA9//9v3+7FBAIAZNmRwfv3IAAAAf3m3mUe2z7////8nUEEDGCQ0AA/xn9l1Z61t' +
|
|
12
|
+
't/+AAIAAAAAw3p9VS2WAuY9e0////BAAAEADWNAAAALFnElFaAQAAAAERkEAAAGEAAAAQAAAERAAQAYBYAAAFAAgoQAAAAV1tABZ' +
|
|
13
|
+
'3QyU1X9vj38AAAIAABBAAAAAEcROB091ZGCmniAAFAkgAAQAEAAAAIQAABARAAAs+/eOAIAAAAABAAAAAAAIAAEBAAAACAAAAAxo' +
|
|
14
|
+
'qWAAAAAAEACBmiABAgQgQBAAIEjhABAAAAAQAdQ9DBBCEAAAAA+uzOBAACQEAAAAAAAAAAAAAAAA///////3PPooA//3n8+XnPAE' +
|
|
15
|
+
'gIbxmWUJbOw35/9AUjEkB4Qw3PJXbjz8/9fb5////RACAEQISw339/QhPREQAQw///v1ovB93MaDAAAI7lnAHQIAw////DAGFEIA' +
|
|
16
|
+
'AAAgQQLHhAAAAAAAQAEAEgAt+fKDABAARSCBsBAYw////ZPGF853uNAARAAAAAUB16rgoQAAEEl4///PFkACFAEAAAAAQEAAMAAA' +
|
|
17
|
+
'AAQoCw25JRRigA8RQeAAAAAzQBEJFeEhABCEAEiAQhYEAkN7vT1NdERaO036zgAAgUAQRAAAAAFRWmk1dfawHd5+AABAIAAgAAUR' +
|
|
18
|
+
'AEgAAEAQACgRIg/63vDxdaBAAwABBACIdLaAAAAASQEAAQAEw3ZlTQAgAEA0WAEAQAPkixk0CEgSAYEBAigAAACwAAoBAgAAAAAA' +
|
|
19
|
+
'wj97VIACAAQAAAAAAARAAABAAAw////////////f//v/////////////f////////////7//////////////9//3////////////' +
|
|
20
|
+
'/7/+///////////////////////7////////////////d/9/8iZBs8/Bw////BACAMcffYg5yB////HRiAzn75R//fl8//z/y7Rl' +
|
|
21
|
+
'3///HBYACAAIAV1nK+d+uFxhRh/9/fHQDUQ0YxFAABAEEIAAgoAg/////7/////////7/////9///////////f////9f////////' +
|
|
22
|
+
'///v///+////f////f///f////////////////33//773////////////////9///////////9//f6/////f//nACSw/////X/+/' +
|
|
23
|
+
'/f//i755/f//21fz/////////////9wpRZAxXCdXva6/9//Ydt1////PgQBAXFlwlVfTy///fLUhFXAAiAAdpBBGFEEABYAAAAAA' +
|
|
24
|
+
'AEFYFQQAAAgBRACAYUgkx3/ZrZQlGcV773Un7NIBiBEAVIEAAAAVHn/XQ4cyG999TEDAgAAAAAJAAAAAAoAEAEAQAA/3//bf++8/' +
|
|
25
|
+
'/KEFEGGs/3neEIAAJ1CFn8f7x/77/AAACcM4ew/v/3/+33/9//P/9/+R0/HEBEAx/9/9dn/XFY471fX/9AAAAMUcCBAQAAQADlBJ' +
|
|
26
|
+
'IAw///////////////////////////////////////////////////////////////////////////////////////fvnfl7T0VC' +
|
|
27
|
+
'BDUI6fRAACAAAAA8+//vAMCAgAAAIAAAwU74QAAAAEBJWAQACAzgjGAUAEwgRgEAAAA8f///SoKE/jvUAAIIAAAAAAEECIQPABhQ' +
|
|
28
|
+
'QE2XfHDAAAQAcJAIAAQAAIUAgAAA/////////8t3P37/v+///tEQQEf/v3/9///+///bxvX8/9/f///////////3/3///f1/vF4d' +
|
|
29
|
+
'fy/9//////v///1V/9+XQhhc///nV8ZFP0nx9Fqk1/////////f/d///9b/3//DQYKw/v//927/////fQ7TF7x7/++//3///3/3/' +
|
|
30
|
+
'/7//3fd/v/Cg/W8///////////f////fG9xd/n/2d9cfWkr67BqHgAAMCQAJIRAAAAE1GQAAAQAAEAAMJYAUAgAAABAJAQAAQwNe' +
|
|
31
|
+
'X30DU9U8WQW1KpAQCAAQAgAAAAA//v+HYhUQkAKBAAjEAJCAQAAAAAAAAEAAAgAgQAxvvNJABAAAAAAAAAAwA+CAAAAAAAgCAAAA' +
|
|
32
|
+
'AfowCAQAAEw/YIAASA//59DAlAAAIoAAAAAAAAAQAAxAAkAIAAQAAAwgAAAAAEAAAAAAAAAAAAAAAAw////z+5bEQAAASGgRNnvX' +
|
|
33
|
+
'AEAAwQBBVBRAEY/P6VABAALggUVdf233xxMeVPU9XfGFBAAAAAAAsc/2fQFYDiWBQsIO6GAAAADAkQEAAAxAxIQAAAA81//1XzLc' +
|
|
34
|
+
'WjneVAVBkSY6BBAAAsWOSRHQpDDkqJJAAIw/v//fFOF9v///y39xMVvQ8///fAAgAbFzW85+3037/3LpvGARYEQXOpECQhCMgDIE' +
|
|
35
|
+
'gQCA////v5fAGgoKAZRABUxK+EAAAABkpVkACEQ6/+7AAAAEcfa0U5JRf3/jmNbVgQ94YDTPACAAAwE9RUMhvBFAiA1f/u9BAACE' +
|
|
36
|
+
'EKbRQYARAAgECEBAw/f//VgAWkIAAAACAABDDAAAAAwgwIALEGwMAPCJAAAALTuOGhMVx////ZRABQIUHw////QAAAEE4EQAcIBQ' +
|
|
37
|
+
'hbnFIOAEAAAABAAAAAAAiQiCABIAAA';
|
|
38
|
+
|
|
39
|
+
export const languages2 =
|
|
40
|
+
'aa ab ae af ak am an ar as av ay az ba be bg bh bi bm bn bo br bs ca ce ch co cr cs cu cv cy da de ' +
|
|
41
|
+
'dv dz ee el en eo es et eu fa ff fi fj fo fr fy ga gd gl gn gu gv ha he hi ho hr ht hu hy hz ia id ' +
|
|
42
|
+
'ie ig ii ik in io is it iu iw ja ji jv jw ka kg ki kj kk kl km kn ko kr ks ku kv kw ky la lb lg li ' +
|
|
43
|
+
'ln lo lt lu lv mg mh mi mk ml mn mo mr ms mt my na nb nd ne ng nl nn no nr nv ny oc oj om or os pa ' +
|
|
44
|
+
'pi pl ps pt qu rm rn ro ru rw sa sc sd se sg sh si sk sl sm sn so sq sr ss st su sv sw ta te tg th ' +
|
|
45
|
+
'ti tk tl tn to tr ts tt tw ty ug uk ur uz ve vi vo wa wo xh yi yo za zh zu';
|
|
46
|
+
|
|
47
|
+
export const scripts =
|
|
48
|
+
'adlm afak aghb ahom arab aran armi armn avst bali bamu bass batk beng bhks blis bopo brah brai bugi' +
|
|
49
|
+
' buhd cakm cans cari cham cher chrs cirt copt cpmn cprt cyrl cyrs deva diak dogr dsrt dupl egyd egy' +
|
|
50
|
+
'h egyp elba elym ethi geok geor glag gong gonm goth gran grek gujr guru hanb hang hani hano hans ha' +
|
|
51
|
+
'nt hatr hebr hira hluw hmng hmnp hrkt hung inds ital jamo java jpan jurc kali kana kawi khar khmr k' +
|
|
52
|
+
'hoj kitl kits knda kore kpel kthi lana laoo latf latg latn leke lepc limb lina linb lisu loma lyci ' +
|
|
53
|
+
'lydi mahj maka mand mani marc maya medf mend merc mero mlym modi mong moon mroo mtei mult mymr nagm' +
|
|
54
|
+
' nand narb nbat newa nkdb nkgb nkoo nshu ogam olck orkh orya osge osma ougr palm pauc pcun pelm per' +
|
|
55
|
+
'm phag phli phlp phlv phnx piqd plrd prti psin qaaa qaab qaac qaad qaae qaaf qaag qaah qaai qaaj qa' +
|
|
56
|
+
'ak qaal qaam qaan qaao qaap qaaq qaar qaas qaat qaau qaav qaaw qaax qaay qaaz qaba qabb qabc qabd q' +
|
|
57
|
+
'abe qabf qabg qabh qabi qabj qabk qabl qabm qabn qabo qabp qabq qabr qabs qabt qabu qabv qabw qabx ' +
|
|
58
|
+
'ranj rjng rohg roro runr samr sara sarb saur sgnw shaw shrd shui sidd sind sinh sogd sogo sora soyo' +
|
|
59
|
+
' sund sunu sylo syrc syre syrj syrn tagb takr tale talu taml tang tavt telu teng tfng tglg thaa tha' +
|
|
60
|
+
'i tibt tirh tnsa toto ugar vaii visp vith wara wcho wole xpeo xsux yezi yiii zanb zinh zmth zsye zs' +
|
|
61
|
+
'ym zxxx zyyy zzzz';
|
|
62
|
+
|
|
63
|
+
export const regions =
|
|
64
|
+
'aa ac ad ae af ag ai al am an ao aq ar as at au aw ax az ba bb bd be bf bg bh bi bj bl bm bn bo bq ' +
|
|
65
|
+
'br bs bt bu bv bw by bz ca cc cd cf cg ch ci ck cl cm cn co cp cq cr cs ct cu cv cw cx cy cz dd de ' +
|
|
66
|
+
'dg dj dk dm do dy dz ea ec ee eg eh er es et eu ez fi fj fk fm fo fq fr fx ga gb gd ge gf gg gh gi ' +
|
|
67
|
+
'gl gm gn gp gq gr gs gt gu gw gy hk hm hn hr ht hu hv ic id ie il im in io iq ir is it je jm jo jp ' +
|
|
68
|
+
'jt ke kg kh ki km kn kp kr kw ky kz la lb lc li lk lr ls lt lu lv ly ma mc md me mf mg mh mi mk ml ' +
|
|
69
|
+
'mm mn mo mp mq mr ms mt mu mv mw mx my mz na nc ne nf ng nh ni nl no np nq nr nt nu nz om pa pc pe ' +
|
|
70
|
+
'pf pg ph pk pl pm pn pr ps pt pu pw py pz qa qm qn qo qp qq qr qs qt qu qv qw qx qy qz re rh ro rs ' +
|
|
71
|
+
'ru rw sa sb sc sd se sg sh si sj sk sl sm sn so sr ss st su sv sx sy sz ta tc td tf tg th tj tk tl ' +
|
|
72
|
+
'tm tn to tp tr tt tv tw tz ua ug uk um un us uy uz va vc vd ve vg vi vn vu wf wk ws xa xb xc xd xe ' +
|
|
73
|
+
'xf xg xh xi xj xk xl xm xn xo xp xq xr xs xt xu xv xw xx xy xz yd ye yt yu za zm zr zw zz aaa abw a' +
|
|
74
|
+
'fg ago aia ala alb and ant are arg arm asc asm ata atf atg atn aus aut aze bdi bel ben bes bfa bgd ' +
|
|
75
|
+
'bgr bhr bhs bih blm blr blz bmu bol bra brb brn btn bur bvt bwa caf can cck che chl chn civ cmr cod' +
|
|
76
|
+
' cog cok col com cpt cpv cri cte cub cuw cxr cym cyp cze ddr deu dga dhy dji dma dnk dom dza ecu eg' +
|
|
77
|
+
'y eri esh esp est eth fin fji flk fra fro fsm fxx gab gbr geo ggy gha gib gin glp gmb gnb gnq grc g' +
|
|
78
|
+
'rd grl gtm guf gum guy hkg hmd hnd hrv hti hun hvo idn imn ind iot irl irn irq isl isr ita jam jey ' +
|
|
79
|
+
'jor jpn jtn kaz ken kgz khm kir kna kor kwt lao lbn lbr lby lca lie lka lso ltu lux lva mac maf mar' +
|
|
80
|
+
' mco mda mdg mdv mex mhl mid mkd mli mlt mmr mne mng mnp moz mrt msr mtq mus mwi mys myt nam ncl ne' +
|
|
81
|
+
'r nfk nga nhb nic niu nld nor npl nru ntz nzl omn pak pan pci pcn pcz per phl plw png pol pri prk p' +
|
|
82
|
+
'rt pry pse pus pyf qat qmm qnn qoo qpp qqq qrr qss qtt quu qvv qww qxx qyy qzz reu rho rou rus rwa ' +
|
|
83
|
+
'sau scg sdn sen sgp sgs shn sjm slb sle slv smr som spm srb ssd stp sun sur svk svn swe swz sxm syc' +
|
|
84
|
+
' syr taa tca tcd tgo tha tjk tkl tkm tls tmp ton tto tun tur tuv twn tza uga ukr umi ury usa uzb va' +
|
|
85
|
+
't vct vdr ven vgb vir vnm vut wak wlf wsm xaa xbb xcc xdd xee xff xgg xhh xii xjj xkk xll xmm xnn x' +
|
|
86
|
+
'oo xpp xqq xrr xss xtt xuu xvv xww xxx xyy xzz yem ymd yug zaf zar zmb zwe zzz 001 002 003 004 005 ' +
|
|
87
|
+
'008 009 010 011 012 013 014 015 016 017 018 019 020 021 024 028 029 030 031 032 034 035 036 039 040' +
|
|
88
|
+
' 044 048 050 051 052 053 054 056 057 060 061 064 068 070 072 074 076 084 086 090 092 096 100 104 10' +
|
|
89
|
+
'8 112 116 120 124 132 136 140 142 143 144 145 148 150 151 152 154 155 156 158 162 166 170 174 175 1' +
|
|
90
|
+
'78 180 184 188 191 192 196 202 203 204 208 212 214 218 222 226 230 231 232 233 234 238 239 242 246 ' +
|
|
91
|
+
'248 249 250 254 258 260 262 266 268 270 275 276 278 280 288 292 296 300 304 308 312 316 320 324 328' +
|
|
92
|
+
' 332 334 336 340 344 348 352 356 360 364 368 372 376 380 384 388 392 398 400 404 408 410 414 417 41' +
|
|
93
|
+
'8 419 422 426 428 430 434 438 440 442 446 450 454 458 462 466 470 474 478 480 484 492 496 498 499 5' +
|
|
94
|
+
'00 504 508 512 516 520 524 528 530 531 533 534 535 536 540 548 554 558 562 566 570 574 578 580 581 ' +
|
|
95
|
+
'583 584 585 586 591 598 600 604 608 612 616 620 624 626 630 634 638 642 643 646 652 654 659 660 662' +
|
|
96
|
+
' 663 666 670 674 678 682 686 688 690 694 702 703 704 705 706 710 716 720 724 728 729 732 736 740 74' +
|
|
97
|
+
'4 748 752 756 760 762 764 768 772 776 780 784 788 792 795 796 798 800 804 807 810 818 826 831 832 8' +
|
|
98
|
+
'33 834 840 850 854 858 860 862 876 882 886 887 891 894 958 959 960 961 962 963 964 965 966 967 968 ' +
|
|
99
|
+
'969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993' +
|
|
100
|
+
' 994 995 996 997 998 999';
|
|
101
|
+
|
|
102
|
+
export const variants =
|
|
103
|
+
'1606nict 1694acad 1901 1959acad 1994 1996 abl1943 akuapem alalc97 aluku ao1990 aranes arevela arevm' +
|
|
104
|
+
'da arkaika asante auvern baku1926 balanka barla basiceng bauddha bciav bcizbl biscayan biske bohori' +
|
|
105
|
+
'c boont bornholm cisaup colb1945 cornu creiss dajnko ekavsk emodeng fonipa fonkirsh fonnapa fonupa ' +
|
|
106
|
+
'fonxsamp gallo gascon grclass grital grmistr hepburn heploc hognorsk hsistemo ijekavsk itihasa ivan' +
|
|
107
|
+
'chov jauer jyutping kkcor kociewie kscor laukika lemosin lengadoc lipaw ltg1929 ltg2007 luna1918 me' +
|
|
108
|
+
'telko monoton ndyuka nedis newfound nicard njiva nulik osojs oxendict pahawh2 pahawh3 pahawh4 pamak' +
|
|
109
|
+
'a peano petr1708 pinyin polyton provenc puter rigik rozaj rumgr scotland scouse simple solba sotav ' +
|
|
110
|
+
'spanglis surmiran sursilv sutsilv synnejyl tarask tongyong tunumiit uccor ucrcor ulster unifon vaid' +
|
|
111
|
+
'ika valencia vallader vecdruka vivaraup wadegile xsistemo';
|
|
112
|
+
|
|
113
|
+
//// Matching: space-separated `key=value` pairs, where numbers name a `Locale`.
|
|
114
|
+
|
|
115
|
+
/** ISO 639-2 codes of languages that can select a translation, with their canonical code. */
|
|
116
|
+
export const languageAliases = `
|
|
117
|
+
abk=ab aym=ay aze=az bel=be bre=br ces=cs chi=zh cos=co cze=cs deu=de eus=eu fra=fr fre=fr ger=de glg=gl
|
|
118
|
+
grn=gn hat=ht hye=hy ita=it jpn=ja kaz=kk kin=rw kir=ky kon=kg kor=ko kur=ku lat=la lin=ln ltz=lb mlg=mg
|
|
119
|
+
mon=mn oci=oc pol=pl por=pt que=qu roh=rm rus=ru spa=es tat=tt tgk=tg tuk=tk tur=tr uig=ug uzb=uz wol=wo
|
|
120
|
+
zho=zh
|
|
121
|
+
`;
|
|
122
|
+
|
|
123
|
+
/** Bibliographic codes x/text only canonicalizes when the whole tag parses without error. */
|
|
124
|
+
export const bibliographicAliases = 'arm=hy baq=eu';
|
|
125
|
+
|
|
126
|
+
/** The translation chosen for a language in a script, where there is one. */
|
|
127
|
+
export const scriptMatches = `
|
|
128
|
+
ab-Cyrl=12 ay-Latn=5 az-Cyrl=12 az-Latn=12 be-Cyrl=12 br-Latn=6 cmn-Hans=1 cmn-Hant=2 co-Latn=6 crs-Latn=6
|
|
129
|
+
cs-Latn=3 de-Latn=4 es-Latn=5 eu-Latn=5 fr-Latn=6 gl-Latn=5 gn-Latn=5 gsw-Latn=4 ht-Latn=6 hy-Armn=12
|
|
130
|
+
hy-Cyrl=12 it-Latn=7 ja-Jpan=8 kg-Latn=6 kk-Cyrl=12 ko-Kore=9 ku-Latn=13 ky-Cyrl=12 la-Latn=7 lb-Latn=4
|
|
131
|
+
ln-Latn=6 lua-Latn=6 mg-Latn=6 mn-Cyrl=12 oc-Latn=6 pl-Latn=10 pt-Latn=11 qu-Latn=5 rm-Latn=4 ru-Cyrl=12
|
|
132
|
+
ru-Latn=12 rw-Latn=6 tg-Cyrl=12 tk-Cyrl=12 tk-Latn=12 tr-Latn=13 tt-Cyrl=12 ug-Hans=1 ug-Hant=2 uz-Cyrl=12
|
|
133
|
+
uz-Latn=12 wo-Latn=6 zh-Hans=1 zh-Hant=2
|
|
134
|
+
`;
|
|
135
|
+
|
|
136
|
+
/** The usual script of each language that can select a translation. */
|
|
137
|
+
export const likelyScripts = `
|
|
138
|
+
ab=Cyrl ay=Latn az=Latn be=Cyrl br=Latn cmn=Hans co=Latn crs=Latn cs=Latn de=Latn es=Latn eu=Latn fr=Latn
|
|
139
|
+
gl=Latn gn=Latn gsw=Latn ht=Latn hy=Armn it=Latn ja=Jpan kg=Latn kk=Cyrl ko=Kore ku=Latn ky=Cyrl la=Latn
|
|
140
|
+
lb=Latn ln=Latn lua=Latn mg=Latn mn=Cyrl oc=Latn pl=Latn pt=Latn qu=Latn rm=Latn ru=Cyrl rw=Latn tg=Cyrl
|
|
141
|
+
tk=Latn tr=Latn tt=Cyrl ug=Arab uz=Latn wo=Latn zh=Hans
|
|
142
|
+
`;
|
|
143
|
+
|
|
144
|
+
/** Regions where a language is usually written in another script, when that changes the translation. */
|
|
145
|
+
export const regionScripts = `
|
|
146
|
+
az-034=Arab az-364=Arab az-368=Arab az-IQ=Arab az-IR=Arab cmn-003=Hant cmn-005=Hant cmn-009=Hant cmn-013=Hant
|
|
147
|
+
cmn-019=Hant cmn-021=Hant cmn-035=Hant cmn-036=Hant cmn-053=Hant cmn-061=Hant cmn-096=Hant cmn-150=Hant
|
|
148
|
+
cmn-154=Hant cmn-158=Hant cmn-254=Hant cmn-258=Hant cmn-344=Hant cmn-360=Hant cmn-419=Hant cmn-446=Hant
|
|
149
|
+
cmn-458=Hant cmn-591=Hant cmn-608=Hant cmn-704=Hant cmn-740=Hant cmn-764=Hant cmn-826=Hant cmn-840=Hant
|
|
150
|
+
cmn-967=Hant cmn-AU=Hant cmn-BN=Hant cmn-EU=Hant cmn-GB=Hant cmn-GF=Hant cmn-HK=Hant cmn-ID=Hant cmn-MO=Hant
|
|
151
|
+
cmn-MY=Hant cmn-PA=Hant cmn-PF=Hant cmn-PH=Hant cmn-PZ=Hant cmn-QU=Hant cmn-SR=Hant cmn-TH=Hant cmn-TW=Hant
|
|
152
|
+
cmn-UK=Hant cmn-US=Hant cmn-VD=Hant cmn-VN=Hant kk-004=Arab kk-030=Arab kk-034=Arab kk-156=Arab kk-364=Arab
|
|
153
|
+
kk-496=Arab kk-AF=Arab kk-CN=Arab kk-IR=Arab kk-MN=Arab ku-422=Arab ku-LB=Arab ky-030=Arab ky-145=Latn
|
|
154
|
+
ky-156=Arab ky-792=Latn ky-CN=Arab ky-TR=Latn mn-156=Mong mn-CN=Mong tg-034=Arab tg-586=Arab tg-PK=Arab
|
|
155
|
+
uz-004=Arab uz-034=Arab uz-AF=Arab zh-003=Hant zh-005=Hant zh-009=Hant zh-013=Hant zh-019=Hant zh-021=Hant
|
|
156
|
+
zh-035=Hant zh-036=Hant zh-053=Hant zh-061=Hant zh-096=Hant zh-150=Hant zh-154=Hant zh-158=Hant zh-254=Hant
|
|
157
|
+
zh-258=Hant zh-344=Hant zh-360=Hant zh-419=Hant zh-446=Hant zh-458=Hant zh-591=Hant zh-608=Hant zh-704=Hant
|
|
158
|
+
zh-740=Hant zh-764=Hant zh-826=Hant zh-840=Hant zh-967=Hant zh-AU=Hant zh-BN=Hant zh-EU=Hant zh-GB=Hant
|
|
159
|
+
zh-GF=Hant zh-HK=Hant zh-ID=Hant zh-MO=Hant zh-MY=Hant zh-PA=Hant zh-PF=Hant zh-PH=Hant zh-PZ=Hant zh-QU=Hant
|
|
160
|
+
zh-SR=Hant zh-TH=Hant zh-TW=Hant zh-UK=Hant zh-US=Hant zh-VD=Hant zh-VN=Hant
|
|
161
|
+
`;
|
|
162
|
+
|
|
163
|
+
/** For `und-REGION`: the region's usual script and translation, where there is one. */
|
|
164
|
+
export const undRegions = `
|
|
165
|
+
005=Latn:11 013=Latn:5 024=Latn:11 029=Latn:5 030=Hans:1 031=Latn:12 032=Latn:5 039=Latn:7 040=Latn:4
|
|
166
|
+
051=Armn:12 068=Latn:5 076=Latn:11 112=Cyrl:12 120=Latn:6 132=Latn:11 140=Latn:6 142=Hans:1 143=Latn:12
|
|
167
|
+
148=Latn:6 150=Cyrl:12 151=Cyrl:12 152=Latn:5 155=Latn:4 156=Hans:1 158=Hant:2 170=Latn:5 175=Latn:6
|
|
168
|
+
178=Latn:6 188=Latn:5 192=Latn:5 203=Latn:3 204=Latn:6 214=Latn:5 218=Latn:5 222=Latn:5 226=Latn:5 249=Latn:6
|
|
169
|
+
250=Latn:6 254=Latn:6 258=Latn:6 260=Latn:6 266=Latn:6 276=Latn:4 278=Latn:4 280=Latn:4 312=Latn:6 320=Latn:5
|
|
170
|
+
324=Latn:6 332=Latn:6 336=Latn:7 340=Latn:5 344=Hant:2 380=Latn:7 384=Latn:6 392=Jpan:8 398=Cyrl:12 408=Kore:9
|
|
171
|
+
410=Kore:9 417=Cyrl:12 419=Latn:5 438=Latn:4 442=Latn:6 446=Hant:2 450=Latn:6 474=Latn:6 484=Latn:5 492=Latn:6
|
|
172
|
+
496=Cyrl:12 508=Latn:11 540=Latn:6 558=Latn:5 591=Latn:5 600=Latn:5 604=Latn:5 616=Latn:10 620=Latn:11
|
|
173
|
+
624=Latn:11 626=Latn:11 630=Latn:5 638=Latn:6 643=Cyrl:12 646=Latn:6 652=Latn:6 663=Latn:6 666=Latn:6
|
|
174
|
+
674=Latn:7 678=Latn:11 686=Latn:6 690=Latn:6 724=Latn:5 756=Latn:4 762=Cyrl:12 768=Latn:6 792=Latn:13
|
|
175
|
+
795=Latn:12 854=Latn:6 858=Latn:5 860=Latn:12 862=Latn:5 876=Latn:6 AM=Armn:12 AO=Latn:11 AR=Latn:5 AT=Latn:4
|
|
176
|
+
AZ=Latn:12 BF=Latn:6 BJ=Latn:6 BL=Latn:6 BO=Latn:5 BR=Latn:11 BY=Cyrl:12 CF=Latn:6 CG=Latn:6 CH=Latn:4
|
|
177
|
+
CI=Latn:6 CL=Latn:5 CM=Latn:6 CN=Hans:1 CO=Latn:5 CR=Latn:5 CU=Latn:5 CV=Latn:11 CZ=Latn:3 DD=Latn:4 DE=Latn:4
|
|
178
|
+
DO=Latn:5 DY=Latn:6 EA=Latn:5 EC=Latn:5 ES=Latn:5 EZ=Latn:4 FR=Latn:6 FX=Latn:6 GA=Latn:6 GF=Latn:6 GN=Latn:6
|
|
179
|
+
GP=Latn:6 GQ=Latn:5 GT=Latn:5 GW=Latn:11 HK=Hant:2 HN=Latn:5 HT=Latn:6 HV=Latn:6 IC=Latn:5 IT=Latn:7 JP=Jpan:8
|
|
180
|
+
KG=Cyrl:12 KP=Kore:9 KR=Kore:9 KZ=Cyrl:12 LI=Latn:4 LU=Latn:6 MC=Latn:6 MF=Latn:6 MG=Latn:6 MN=Cyrl:12
|
|
181
|
+
MO=Hant:2 MQ=Latn:6 MX=Latn:5 MZ=Latn:11 NC=Latn:6 NI=Latn:5 PA=Latn:5 PE=Latn:5 PF=Latn:6 PL=Latn:10
|
|
182
|
+
PM=Latn:6 PR=Latn:5 PT=Latn:11 PY=Latn:5 PZ=Latn:5 RE=Latn:6 RU=Cyrl:12 RW=Latn:6 SC=Latn:6 SM=Latn:7
|
|
183
|
+
SN=Latn:6 ST=Latn:11 SV=Latn:5 TD=Latn:6 TF=Latn:6 TG=Latn:6 TJ=Cyrl:12 TL=Latn:11 TM=Latn:12 TP=Latn:11
|
|
184
|
+
TR=Latn:13 TW=Hant:2 UY=Latn:5 UZ=Latn:12 VA=Latn:7 VE=Latn:5 WF=Latn:6 YT=Latn:6
|
|
185
|
+
`;
|
|
186
|
+
|
|
187
|
+
/** For `und-Script`: the translation for the script's usual language, where there is one. */
|
|
188
|
+
export const undScripts = 'Armn=12 Cyrl=12 Hans=1 Hant=2 Jpan=8 Kore=9';
|
|
189
|
+
|
|
190
|
+
/** Tags the rules above get wrong, with x/text's answer. */
|
|
191
|
+
export const exceptions = `
|
|
192
|
+
ug-156=1 ug-158=2 ug-CN=1 ug-TW=2 und-Cyrl-008=0 und-Cyrl-070=0 und-Cyrl-100=0 und-Cyrl-300=0 und-Cyrl-498=0
|
|
193
|
+
und-Cyrl-642=0 und-Cyrl-688=0 und-Cyrl-703=0 und-Cyrl-792=0 und-Cyrl-804=0 und-Cyrl-807=0 und-Cyrl-983=0
|
|
194
|
+
und-Cyrl-AL=0 und-Cyrl-BA=0 und-Cyrl-BG=0 und-Cyrl-GR=0 und-Cyrl-MD=0 und-Cyrl-MK=0 und-Cyrl-RO=0
|
|
195
|
+
und-Cyrl-RS=0 und-Cyrl-SK=0 und-Cyrl-TR=0 und-Cyrl-UA=0 und-Cyrl-XK=0 und-Latn-004=12 und-Latn-012=6
|
|
196
|
+
und-Latn-051=13 und-Latn-150=12 und-Latn-151=12 und-Latn-174=6 und-Latn-196=13 und-Latn-268=13 und-Latn-364=12
|
|
197
|
+
und-Latn-398=12 und-Latn-446=11 und-Latn-478=6 und-Latn-504=6 und-Latn-760=6 und-Latn-788=6 und-Latn-804=10
|
|
198
|
+
und-Latn-AF=12 und-Latn-AM=13 und-Latn-CY=13 und-Latn-DZ=6 und-Latn-GE=13 und-Latn-IR=12 und-Latn-KM=6
|
|
199
|
+
und-Latn-KZ=12 und-Latn-MA=6 und-Latn-MO=11 und-Latn-MR=6 und-Latn-SY=6 und-Latn-TN=6 und-Latn-UA=10
|
|
200
|
+
`;
|
|
201
|
+
|
|
202
|
+
/** Deprecated region codes x/text only replaces when the whole tag parses without error. */
|
|
203
|
+
export const deprecatedRegions = 'BU CT DD DY FX HV JT MI NH NQ PU PZ QU RH TP UK VD WK YD ZR 249 278 720';
|