@aster-cloud/aster-lang-ts 0.0.1
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 +144 -0
- package/dist/peg/headers-parser.js +1887 -0
- package/dist/scripts/aster.d.ts +3 -0
- package/dist/scripts/aster.d.ts.map +1 -0
- package/dist/scripts/aster.js +304 -0
- package/dist/scripts/aster.js.map +1 -0
- package/dist/scripts/build-example-packages.d.ts +3 -0
- package/dist/scripts/build-example-packages.d.ts.map +1 -0
- package/dist/scripts/build-example-packages.js +78 -0
- package/dist/scripts/build-example-packages.js.map +1 -0
- package/dist/scripts/build-peg.d.ts +3 -0
- package/dist/scripts/build-peg.d.ts.map +1 -0
- package/dist/scripts/build-peg.js +13 -0
- package/dist/scripts/build-peg.js.map +1 -0
- package/dist/scripts/cleanup-examples.d.ts +3 -0
- package/dist/scripts/cleanup-examples.d.ts.map +1 -0
- package/dist/scripts/cleanup-examples.js +40 -0
- package/dist/scripts/cleanup-examples.js.map +1 -0
- package/dist/scripts/clear-method-cache.d.ts +3 -0
- package/dist/scripts/clear-method-cache.d.ts.map +1 -0
- package/dist/scripts/clear-method-cache.js +20 -0
- package/dist/scripts/clear-method-cache.js.map +1 -0
- package/dist/scripts/cli.d.ts +3 -0
- package/dist/scripts/cli.d.ts.map +1 -0
- package/dist/scripts/cli.js +51 -0
- package/dist/scripts/cli.js.map +1 -0
- package/dist/scripts/determinism.d.ts +3 -0
- package/dist/scripts/determinism.d.ts.map +1 -0
- package/dist/scripts/determinism.js +124 -0
- package/dist/scripts/determinism.js.map +1 -0
- package/dist/scripts/emit-classfiles-core.d.ts +3 -0
- package/dist/scripts/emit-classfiles-core.d.ts.map +1 -0
- package/dist/scripts/emit-classfiles-core.js +86 -0
- package/dist/scripts/emit-classfiles-core.js.map +1 -0
- package/dist/scripts/emit-classfiles.d.ts +3 -0
- package/dist/scripts/emit-classfiles.d.ts.map +1 -0
- package/dist/scripts/emit-classfiles.js +401 -0
- package/dist/scripts/emit-classfiles.js.map +1 -0
- package/dist/scripts/emit-core.d.ts +3 -0
- package/dist/scripts/emit-core.d.ts.map +1 -0
- package/dist/scripts/emit-core.js +52 -0
- package/dist/scripts/emit-core.js.map +1 -0
- package/dist/scripts/emit-hints.d.ts +3 -0
- package/dist/scripts/emit-hints.d.ts.map +1 -0
- package/dist/scripts/emit-hints.js +75 -0
- package/dist/scripts/emit-hints.js.map +1 -0
- package/dist/scripts/format-examples.d.ts +3 -0
- package/dist/scripts/format-examples.d.ts.map +1 -0
- package/dist/scripts/format-examples.js +55 -0
- package/dist/scripts/format-examples.js.map +1 -0
- package/dist/scripts/generate_error_code_docs.d.ts +8 -0
- package/dist/scripts/generate_error_code_docs.d.ts.map +1 -0
- package/dist/scripts/generate_error_code_docs.js +128 -0
- package/dist/scripts/generate_error_code_docs.js.map +1 -0
- package/dist/scripts/generate_error_codes.d.ts +3 -0
- package/dist/scripts/generate_error_codes.d.ts.map +1 -0
- package/dist/scripts/generate_error_codes.js +224 -0
- package/dist/scripts/generate_error_codes.js.map +1 -0
- package/dist/scripts/golden.d.ts +3 -0
- package/dist/scripts/golden.d.ts.map +1 -0
- package/dist/scripts/golden.js +405 -0
- package/dist/scripts/golden.js.map +1 -0
- package/dist/scripts/health-check.d.ts +3 -0
- package/dist/scripts/health-check.d.ts.map +1 -0
- package/dist/scripts/health-check.js +42 -0
- package/dist/scripts/health-check.js.map +1 -0
- package/dist/scripts/inspect-method-cache.d.ts +3 -0
- package/dist/scripts/inspect-method-cache.d.ts.map +1 -0
- package/dist/scripts/inspect-method-cache.js +24 -0
- package/dist/scripts/inspect-method-cache.js.map +1 -0
- package/dist/scripts/lsp-build-index.d.ts +3 -0
- package/dist/scripts/lsp-build-index.d.ts.map +1 -0
- package/dist/scripts/lsp-build-index.js +60 -0
- package/dist/scripts/lsp-build-index.js.map +1 -0
- package/dist/scripts/lsp-capmanifest-codeaction-smoke.d.ts +3 -0
- package/dist/scripts/lsp-capmanifest-codeaction-smoke.d.ts.map +1 -0
- package/dist/scripts/lsp-capmanifest-codeaction-smoke.js +161 -0
- package/dist/scripts/lsp-capmanifest-codeaction-smoke.js.map +1 -0
- package/dist/scripts/lsp-client-helper.d.ts +30 -0
- package/dist/scripts/lsp-client-helper.d.ts.map +1 -0
- package/dist/scripts/lsp-client-helper.js +192 -0
- package/dist/scripts/lsp-client-helper.js.map +1 -0
- package/dist/scripts/lsp-client-helper.test.d.ts +7 -0
- package/dist/scripts/lsp-client-helper.test.d.ts.map +1 -0
- package/dist/scripts/lsp-client-helper.test.js +45 -0
- package/dist/scripts/lsp-client-helper.test.js.map +1 -0
- package/dist/scripts/lsp-codeaction-smoke.d.ts +3 -0
- package/dist/scripts/lsp-codeaction-smoke.d.ts.map +1 -0
- package/dist/scripts/lsp-codeaction-smoke.js +98 -0
- package/dist/scripts/lsp-codeaction-smoke.js.map +1 -0
- package/dist/scripts/lsp-harness.d.ts +3 -0
- package/dist/scripts/lsp-harness.d.ts.map +1 -0
- package/dist/scripts/lsp-harness.js +33 -0
- package/dist/scripts/lsp-harness.js.map +1 -0
- package/dist/scripts/lsp-health-smoke.d.ts +3 -0
- package/dist/scripts/lsp-health-smoke.d.ts.map +1 -0
- package/dist/scripts/lsp-health-smoke.js +98 -0
- package/dist/scripts/lsp-health-smoke.js.map +1 -0
- package/dist/scripts/lsp-health.d.ts +3 -0
- package/dist/scripts/lsp-health.d.ts.map +1 -0
- package/dist/scripts/lsp-health.js +22 -0
- package/dist/scripts/lsp-health.js.map +1 -0
- package/dist/scripts/lsp-highlight-smoke.d.ts +3 -0
- package/dist/scripts/lsp-highlight-smoke.d.ts.map +1 -0
- package/dist/scripts/lsp-highlight-smoke.js +124 -0
- package/dist/scripts/lsp-highlight-smoke.js.map +1 -0
- package/dist/scripts/lsp-missing-header-codeaction-smoke.d.ts +3 -0
- package/dist/scripts/lsp-missing-header-codeaction-smoke.d.ts.map +1 -0
- package/dist/scripts/lsp-missing-header-codeaction-smoke.js +78 -0
- package/dist/scripts/lsp-missing-header-codeaction-smoke.js.map +1 -0
- package/dist/scripts/lsp-multi-rename.test.d.ts +3 -0
- package/dist/scripts/lsp-multi-rename.test.d.ts.map +1 -0
- package/dist/scripts/lsp-multi-rename.test.js +81 -0
- package/dist/scripts/lsp-multi-rename.test.js.map +1 -0
- package/dist/scripts/lsp-punct-codeaction-smoke.d.ts +3 -0
- package/dist/scripts/lsp-punct-codeaction-smoke.d.ts.map +1 -0
- package/dist/scripts/lsp-punct-codeaction-smoke.js +71 -0
- package/dist/scripts/lsp-punct-codeaction-smoke.js.map +1 -0
- package/dist/scripts/lsp-signaturehelp-smoke.d.ts +3 -0
- package/dist/scripts/lsp-signaturehelp-smoke.d.ts.map +1 -0
- package/dist/scripts/lsp-signaturehelp-smoke.js +129 -0
- package/dist/scripts/lsp-signaturehelp-smoke.js.map +1 -0
- package/dist/scripts/lsp-smoke.d.ts +3 -0
- package/dist/scripts/lsp-smoke.d.ts.map +1 -0
- package/dist/scripts/lsp-smoke.js +54 -0
- package/dist/scripts/lsp-smoke.js.map +1 -0
- package/dist/scripts/lsp-streaming-progress-smoke.d.ts +3 -0
- package/dist/scripts/lsp-streaming-progress-smoke.d.ts.map +1 -0
- package/dist/scripts/lsp-streaming-progress-smoke.js +116 -0
- package/dist/scripts/lsp-streaming-progress-smoke.js.map +1 -0
- package/dist/scripts/lsp-workspace-diagnostics-smoke.d.ts +3 -0
- package/dist/scripts/lsp-workspace-diagnostics-smoke.d.ts.map +1 -0
- package/dist/scripts/lsp-workspace-diagnostics-smoke.js +81 -0
- package/dist/scripts/lsp-workspace-diagnostics-smoke.js.map +1 -0
- package/dist/scripts/perf-assert-report.d.ts +8 -0
- package/dist/scripts/perf-assert-report.d.ts.map +1 -0
- package/dist/scripts/perf-assert-report.js +44 -0
- package/dist/scripts/perf-assert-report.js.map +1 -0
- package/dist/scripts/perf-assert.d.ts +3 -0
- package/dist/scripts/perf-assert.d.ts.map +1 -0
- package/dist/scripts/perf-assert.js +29 -0
- package/dist/scripts/perf-assert.js.map +1 -0
- package/dist/scripts/perf-benchmark.d.ts +9 -0
- package/dist/scripts/perf-benchmark.d.ts.map +1 -0
- package/dist/scripts/perf-benchmark.js +272 -0
- package/dist/scripts/perf-benchmark.js.map +1 -0
- package/dist/scripts/perf-diagnostics.d.ts +7 -0
- package/dist/scripts/perf-diagnostics.d.ts.map +1 -0
- package/dist/scripts/perf-diagnostics.js +87 -0
- package/dist/scripts/perf-diagnostics.js.map +1 -0
- package/dist/scripts/perf-lsp-e2e-v2.d.ts +15 -0
- package/dist/scripts/perf-lsp-e2e-v2.d.ts.map +1 -0
- package/dist/scripts/perf-lsp-e2e-v2.js +323 -0
- package/dist/scripts/perf-lsp-e2e-v2.js.map +1 -0
- package/dist/scripts/perf-lsp-e2e.d.ts +3 -0
- package/dist/scripts/perf-lsp-e2e.d.ts.map +1 -0
- package/dist/scripts/perf-lsp-e2e.js +331 -0
- package/dist/scripts/perf-lsp-e2e.js.map +1 -0
- package/dist/scripts/perf-lsp-internal.d.ts +11 -0
- package/dist/scripts/perf-lsp-internal.d.ts.map +1 -0
- package/dist/scripts/perf-lsp-internal.js +163 -0
- package/dist/scripts/perf-lsp-internal.js.map +1 -0
- package/dist/scripts/perf-lsp-ipc.d.ts +11 -0
- package/dist/scripts/perf-lsp-ipc.d.ts.map +1 -0
- package/dist/scripts/perf-lsp-ipc.js +127 -0
- package/dist/scripts/perf-lsp-ipc.js.map +1 -0
- package/dist/scripts/perf-lsp.d.ts +3 -0
- package/dist/scripts/perf-lsp.d.ts.map +1 -0
- package/dist/scripts/perf-lsp.js +87 -0
- package/dist/scripts/perf-lsp.js.map +1 -0
- package/dist/scripts/perf-utils.d.ts +29 -0
- package/dist/scripts/perf-utils.d.ts.map +1 -0
- package/dist/scripts/perf-utils.js +40 -0
- package/dist/scripts/perf-utils.js.map +1 -0
- package/dist/scripts/profile-medium-project.d.ts +7 -0
- package/dist/scripts/profile-medium-project.d.ts.map +1 -0
- package/dist/scripts/profile-medium-project.js +152 -0
- package/dist/scripts/profile-medium-project.js.map +1 -0
- package/dist/scripts/repl.d.ts +3 -0
- package/dist/scripts/repl.d.ts.map +1 -0
- package/dist/scripts/repl.js +88 -0
- package/dist/scripts/repl.js.map +1 -0
- package/dist/scripts/scaffold.d.ts +3 -0
- package/dist/scripts/scaffold.d.ts.map +1 -0
- package/dist/scripts/scaffold.js +73 -0
- package/dist/scripts/scaffold.js.map +1 -0
- package/dist/scripts/seed-method-cache.d.ts +3 -0
- package/dist/scripts/seed-method-cache.d.ts.map +1 -0
- package/dist/scripts/seed-method-cache.js +37 -0
- package/dist/scripts/seed-method-cache.js.map +1 -0
- package/dist/scripts/test-comments-golden.d.ts +3 -0
- package/dist/scripts/test-comments-golden.d.ts.map +1 -0
- package/dist/scripts/test-comments-golden.js +36 -0
- package/dist/scripts/test-comments-golden.js.map +1 -0
- package/dist/scripts/test-lossless-golden.d.ts +3 -0
- package/dist/scripts/test-lossless-golden.d.ts.map +1 -0
- package/dist/scripts/test-lossless-golden.js +42 -0
- package/dist/scripts/test-lossless-golden.js.map +1 -0
- package/dist/scripts/test-lossless.d.ts +3 -0
- package/dist/scripts/test-lossless.d.ts.map +1 -0
- package/dist/scripts/test-lossless.js +26 -0
- package/dist/scripts/test-lossless.js.map +1 -0
- package/dist/scripts/test-lsp-index.d.ts +3 -0
- package/dist/scripts/test-lsp-index.d.ts.map +1 -0
- package/dist/scripts/test-lsp-index.js +37 -0
- package/dist/scripts/test-lsp-index.js.map +1 -0
- package/dist/scripts/test-medium-diagnostics.d.ts +7 -0
- package/dist/scripts/test-medium-diagnostics.d.ts.map +1 -0
- package/dist/scripts/test-medium-diagnostics.js +129 -0
- package/dist/scripts/test-medium-diagnostics.js.map +1 -0
- package/dist/scripts/typecheck-cli.d.ts +3 -0
- package/dist/scripts/typecheck-cli.d.ts.map +1 -0
- package/dist/scripts/typecheck-cli.js +104 -0
- package/dist/scripts/typecheck-cli.js.map +1 -0
- package/dist/scripts/update-eff-violation-expected.d.ts +3 -0
- package/dist/scripts/update-eff-violation-expected.d.ts.map +1 -0
- package/dist/scripts/update-eff-violation-expected.js +57 -0
- package/dist/scripts/update-eff-violation-expected.js.map +1 -0
- package/dist/scripts/update-golden-ast.d.ts +3 -0
- package/dist/scripts/update-golden-ast.d.ts.map +1 -0
- package/dist/scripts/update-golden-ast.js +61 -0
- package/dist/scripts/update-golden-ast.js.map +1 -0
- package/dist/scripts/validate_error_codes.d.ts +12 -0
- package/dist/scripts/validate_error_codes.d.ts.map +1 -0
- package/dist/scripts/validate_error_codes.js +114 -0
- package/dist/scripts/validate_error_codes.js.map +1 -0
- package/dist/scripts/verify-capabilities.d.ts +3 -0
- package/dist/scripts/verify-capabilities.d.ts.map +1 -0
- package/dist/scripts/verify-capabilities.js +23 -0
- package/dist/scripts/verify-capabilities.js.map +1 -0
- package/dist/scripts/verify-classes.d.ts +3 -0
- package/dist/scripts/verify-classes.d.ts.map +1 -0
- package/dist/scripts/verify-classes.js +32 -0
- package/dist/scripts/verify-classes.js.map +1 -0
- package/dist/scripts/verify-examples.d.ts +3 -0
- package/dist/scripts/verify-examples.d.ts.map +1 -0
- package/dist/scripts/verify-examples.js +79 -0
- package/dist/scripts/verify-examples.js.map +1 -0
- package/dist/scripts/verify-fuzz.d.ts +3 -0
- package/dist/scripts/verify-fuzz.d.ts.map +1 -0
- package/dist/scripts/verify-fuzz.js +88 -0
- package/dist/scripts/verify-fuzz.js.map +1 -0
- package/dist/scripts/verify-jar-checksum.d.ts +3 -0
- package/dist/scripts/verify-jar-checksum.d.ts.map +1 -0
- package/dist/scripts/verify-jar-checksum.js +63 -0
- package/dist/scripts/verify-jar-checksum.js.map +1 -0
- package/dist/scripts/verify-nullstrict.d.ts +3 -0
- package/dist/scripts/verify-nullstrict.d.ts.map +1 -0
- package/dist/scripts/verify-nullstrict.js +20 -0
- package/dist/scripts/verify-nullstrict.js.map +1 -0
- package/dist/src/ai/generation-cache.d.ts +36 -0
- package/dist/src/ai/generation-cache.d.ts.map +1 -0
- package/dist/src/ai/generation-cache.js +91 -0
- package/dist/src/ai/generation-cache.js.map +1 -0
- package/dist/src/ai/generator.d.ts +105 -0
- package/dist/src/ai/generator.d.ts.map +1 -0
- package/dist/src/ai/generator.js +103 -0
- package/dist/src/ai/generator.js.map +1 -0
- package/dist/src/ai/llm-provider.d.ts +31 -0
- package/dist/src/ai/llm-provider.d.ts.map +1 -0
- package/dist/src/ai/llm-provider.js +17 -0
- package/dist/src/ai/llm-provider.js.map +1 -0
- package/dist/src/ai/prompt-manager.d.ts +48 -0
- package/dist/src/ai/prompt-manager.d.ts.map +1 -0
- package/dist/src/ai/prompt-manager.js +70 -0
- package/dist/src/ai/prompt-manager.js.map +1 -0
- package/dist/src/ai/provenance.d.ts +70 -0
- package/dist/src/ai/provenance.d.ts.map +1 -0
- package/dist/src/ai/provenance.js +95 -0
- package/dist/src/ai/provenance.js.map +1 -0
- package/dist/src/ai/providers/anthropic.d.ts +14 -0
- package/dist/src/ai/providers/anthropic.d.ts.map +1 -0
- package/dist/src/ai/providers/anthropic.js +56 -0
- package/dist/src/ai/providers/anthropic.js.map +1 -0
- package/dist/src/ai/providers/openai.d.ts +15 -0
- package/dist/src/ai/providers/openai.d.ts.map +1 -0
- package/dist/src/ai/providers/openai.js +58 -0
- package/dist/src/ai/providers/openai.js.map +1 -0
- package/dist/src/ai/validator.d.ts +68 -0
- package/dist/src/ai/validator.d.ts.map +1 -0
- package/dist/src/ai/validator.js +108 -0
- package/dist/src/ai/validator.js.map +1 -0
- package/dist/src/ast/ast.d.ts +49 -0
- package/dist/src/ast/ast.d.ts.map +1 -0
- package/dist/src/ast/ast.js +191 -0
- package/dist/src/ast/ast.js.map +1 -0
- package/dist/src/ast/ast_visitor.d.ts +66 -0
- package/dist/src/ast/ast_visitor.d.ts.map +1 -0
- package/dist/src/ast/ast_visitor.js +176 -0
- package/dist/src/ast/ast_visitor.js.map +1 -0
- package/dist/src/ast/index.d.ts +13 -0
- package/dist/src/ast/index.d.ts.map +1 -0
- package/dist/src/ast/index.js +12 -0
- package/dist/src/ast/index.js.map +1 -0
- package/dist/src/cli/commands/ai-generate.d.ts +39 -0
- package/dist/src/cli/commands/ai-generate.d.ts.map +1 -0
- package/dist/src/cli/commands/ai-generate.js +146 -0
- package/dist/src/cli/commands/ai-generate.js.map +1 -0
- package/dist/src/cli/commands/install.d.ts +7 -0
- package/dist/src/cli/commands/install.d.ts.map +1 -0
- package/dist/src/cli/commands/install.js +146 -0
- package/dist/src/cli/commands/install.js.map +1 -0
- package/dist/src/cli/commands/list.d.ts +6 -0
- package/dist/src/cli/commands/list.d.ts.map +1 -0
- package/dist/src/cli/commands/list.js +158 -0
- package/dist/src/cli/commands/list.js.map +1 -0
- package/dist/src/cli/commands/search.d.ts +2 -0
- package/dist/src/cli/commands/search.d.ts.map +1 -0
- package/dist/src/cli/commands/search.js +174 -0
- package/dist/src/cli/commands/search.js.map +1 -0
- package/dist/src/cli/commands/update.d.ts +2 -0
- package/dist/src/cli/commands/update.d.ts.map +1 -0
- package/dist/src/cli/commands/update.js +244 -0
- package/dist/src/cli/commands/update.js.map +1 -0
- package/dist/src/cli/policy-converter.d.ts +10 -0
- package/dist/src/cli/policy-converter.d.ts.map +1 -0
- package/dist/src/cli/policy-converter.js +188 -0
- package/dist/src/cli/policy-converter.js.map +1 -0
- package/dist/src/cli/utils/error-handler.d.ts +4 -0
- package/dist/src/cli/utils/error-handler.d.ts.map +1 -0
- package/dist/src/cli/utils/error-handler.js +91 -0
- package/dist/src/cli/utils/error-handler.js.map +1 -0
- package/dist/src/cli/utils/logger.d.ts +8 -0
- package/dist/src/cli/utils/logger.d.ts.map +1 -0
- package/dist/src/cli/utils/logger.js +20 -0
- package/dist/src/cli/utils/logger.js.map +1 -0
- package/dist/src/config/config-service.d.ts +79 -0
- package/dist/src/config/config-service.d.ts.map +1 -0
- package/dist/src/config/config-service.js +112 -0
- package/dist/src/config/config-service.js.map +1 -0
- package/dist/src/config/effect_config.d.ts +111 -0
- package/dist/src/config/effect_config.d.ts.map +1 -0
- package/dist/src/config/effect_config.js +248 -0
- package/dist/src/config/effect_config.js.map +1 -0
- package/dist/src/config/effects.d.ts +33 -0
- package/dist/src/config/effects.d.ts.map +1 -0
- package/dist/src/config/effects.js +34 -0
- package/dist/src/config/effects.js.map +1 -0
- package/dist/src/config/lexicons/de-DE.d.ts +12 -0
- package/dist/src/config/lexicons/de-DE.d.ts.map +1 -0
- package/dist/src/config/lexicons/de-DE.js +129 -0
- package/dist/src/config/lexicons/de-DE.js.map +1 -0
- package/dist/src/config/lexicons/en-US.d.ts +15 -0
- package/dist/src/config/lexicons/en-US.d.ts.map +1 -0
- package/dist/src/config/lexicons/en-US.js +136 -0
- package/dist/src/config/lexicons/en-US.js.map +1 -0
- package/dist/src/config/lexicons/identifiers/domains/finance.loan.zh-CN.d.ts +13 -0
- package/dist/src/config/lexicons/identifiers/domains/finance.loan.zh-CN.d.ts.map +1 -0
- package/dist/src/config/lexicons/identifiers/domains/finance.loan.zh-CN.js +307 -0
- package/dist/src/config/lexicons/identifiers/domains/finance.loan.zh-CN.js.map +1 -0
- package/dist/src/config/lexicons/identifiers/domains/insurance.auto.zh-CN.d.ts +25 -0
- package/dist/src/config/lexicons/identifiers/domains/insurance.auto.zh-CN.d.ts.map +1 -0
- package/dist/src/config/lexicons/identifiers/domains/insurance.auto.zh-CN.js +355 -0
- package/dist/src/config/lexicons/identifiers/domains/insurance.auto.zh-CN.js.map +1 -0
- package/dist/src/config/lexicons/identifiers/examples/canonicalizer-integration.d.ts +47 -0
- package/dist/src/config/lexicons/identifiers/examples/canonicalizer-integration.d.ts.map +1 -0
- package/dist/src/config/lexicons/identifiers/examples/canonicalizer-integration.js +142 -0
- package/dist/src/config/lexicons/identifiers/examples/canonicalizer-integration.js.map +1 -0
- package/dist/src/config/lexicons/identifiers/index.d.ts +34 -0
- package/dist/src/config/lexicons/identifiers/index.d.ts.map +1 -0
- package/dist/src/config/lexicons/identifiers/index.js +37 -0
- package/dist/src/config/lexicons/identifiers/index.js.map +1 -0
- package/dist/src/config/lexicons/identifiers/registry.d.ts +112 -0
- package/dist/src/config/lexicons/identifiers/registry.d.ts.map +1 -0
- package/dist/src/config/lexicons/identifiers/registry.js +188 -0
- package/dist/src/config/lexicons/identifiers/registry.js.map +1 -0
- package/dist/src/config/lexicons/identifiers/types.d.ts +129 -0
- package/dist/src/config/lexicons/identifiers/types.d.ts.map +1 -0
- package/dist/src/config/lexicons/identifiers/types.js +146 -0
- package/dist/src/config/lexicons/identifiers/types.js.map +1 -0
- package/dist/src/config/lexicons/index.d.ts +33 -0
- package/dist/src/config/lexicons/index.d.ts.map +1 -0
- package/dist/src/config/lexicons/index.js +50 -0
- package/dist/src/config/lexicons/index.js.map +1 -0
- package/dist/src/config/lexicons/registry.d.ts +41 -0
- package/dist/src/config/lexicons/registry.d.ts.map +1 -0
- package/dist/src/config/lexicons/registry.js +205 -0
- package/dist/src/config/lexicons/registry.js.map +1 -0
- package/dist/src/config/lexicons/template.d.ts +67 -0
- package/dist/src/config/lexicons/template.d.ts.map +1 -0
- package/dist/src/config/lexicons/template.js +442 -0
- package/dist/src/config/lexicons/template.js.map +1 -0
- package/dist/src/config/lexicons/types.d.ts +169 -0
- package/dist/src/config/lexicons/types.d.ts.map +1 -0
- package/dist/src/config/lexicons/types.js +62 -0
- package/dist/src/config/lexicons/types.js.map +1 -0
- package/dist/src/config/lexicons/zh-CN.d.ts +21 -0
- package/dist/src/config/lexicons/zh-CN.d.ts.map +1 -0
- package/dist/src/config/lexicons/zh-CN.js +139 -0
- package/dist/src/config/lexicons/zh-CN.js.map +1 -0
- package/dist/src/config/runtime.d.ts +2 -0
- package/dist/src/config/runtime.d.ts.map +1 -0
- package/dist/src/config/runtime.js +13 -0
- package/dist/src/config/runtime.js.map +1 -0
- package/dist/src/config/semantic.d.ts +262 -0
- package/dist/src/config/semantic.d.ts.map +1 -0
- package/dist/src/config/semantic.js +394 -0
- package/dist/src/config/semantic.js.map +1 -0
- package/dist/src/config/token-kind.d.ts +177 -0
- package/dist/src/config/token-kind.d.ts.map +1 -0
- package/dist/src/config/token-kind.js +298 -0
- package/dist/src/config/token-kind.js.map +1 -0
- package/dist/src/core/core_ir.d.ts +50 -0
- package/dist/src/core/core_ir.d.ts.map +1 -0
- package/dist/src/core/core_ir.js +139 -0
- package/dist/src/core/core_ir.js.map +1 -0
- package/dist/src/core/core_ir_json.d.ts +62 -0
- package/dist/src/core/core_ir_json.d.ts.map +1 -0
- package/dist/src/core/core_ir_json.js +81 -0
- package/dist/src/core/core_ir_json.js.map +1 -0
- package/dist/src/core/index.d.ts +18 -0
- package/dist/src/core/index.d.ts.map +1 -0
- package/dist/src/core/index.js +16 -0
- package/dist/src/core/index.js.map +1 -0
- package/dist/src/core/pretty_core.d.ts +3 -0
- package/dist/src/core/pretty_core.d.ts.map +1 -0
- package/dist/src/core/pretty_core.js +177 -0
- package/dist/src/core/pretty_core.js.map +1 -0
- package/dist/src/core/visitor.d.ts +51 -0
- package/dist/src/core/visitor.d.ts.map +1 -0
- package/dist/src/core/visitor.js +117 -0
- package/dist/src/core/visitor.js.map +1 -0
- package/dist/src/cst/cst.d.ts +32 -0
- package/dist/src/cst/cst.d.ts.map +1 -0
- package/dist/src/cst/cst.js +2 -0
- package/dist/src/cst/cst.js.map +1 -0
- package/dist/src/cst/cst_builder.d.ts +5 -0
- package/dist/src/cst/cst_builder.d.ts.map +1 -0
- package/dist/src/cst/cst_builder.js +101 -0
- package/dist/src/cst/cst_builder.js.map +1 -0
- package/dist/src/cst/cst_printer.d.ts +8 -0
- package/dist/src/cst/cst_printer.d.ts.map +1 -0
- package/dist/src/cst/cst_printer.js +47 -0
- package/dist/src/cst/cst_printer.js.map +1 -0
- package/dist/src/cst/index.d.ts +14 -0
- package/dist/src/cst/index.d.ts.map +1 -0
- package/dist/src/cst/index.js +13 -0
- package/dist/src/cst/index.js.map +1 -0
- package/dist/src/diagnostics/diagnostics.d.ts +138 -0
- package/dist/src/diagnostics/diagnostics.d.ts.map +1 -0
- package/dist/src/diagnostics/diagnostics.js +249 -0
- package/dist/src/diagnostics/diagnostics.js.map +1 -0
- package/dist/src/diagnostics/error_codes.d.ts +88 -0
- package/dist/src/diagnostics/error_codes.d.ts.map +1 -0
- package/dist/src/diagnostics/error_codes.js +551 -0
- package/dist/src/diagnostics/error_codes.js.map +1 -0
- package/dist/src/diagnostics/index.d.ts +14 -0
- package/dist/src/diagnostics/index.d.ts.map +1 -0
- package/dist/src/diagnostics/index.js +14 -0
- package/dist/src/diagnostics/index.js.map +1 -0
- package/dist/src/effects/capabilities.d.ts +18 -0
- package/dist/src/effects/capabilities.d.ts.map +1 -0
- package/dist/src/effects/capabilities.js +101 -0
- package/dist/src/effects/capabilities.js.map +1 -0
- package/dist/src/effects/effect_inference.d.ts +17 -0
- package/dist/src/effects/effect_inference.d.ts.map +1 -0
- package/dist/src/effects/effect_inference.js +557 -0
- package/dist/src/effects/effect_inference.js.map +1 -0
- package/dist/src/effects/effect_signature.d.ts +13 -0
- package/dist/src/effects/effect_signature.d.ts.map +1 -0
- package/dist/src/effects/effect_signature.js +2 -0
- package/dist/src/effects/effect_signature.js.map +1 -0
- package/dist/src/effects/index.d.ts +14 -0
- package/dist/src/effects/index.d.ts.map +1 -0
- package/dist/src/effects/index.js +13 -0
- package/dist/src/effects/index.js.map +1 -0
- package/dist/src/formatter.d.ts +7 -0
- package/dist/src/formatter.d.ts.map +1 -0
- package/dist/src/formatter.js +383 -0
- package/dist/src/formatter.js.map +1 -0
- package/dist/src/frontend/canonicalizer.d.ts +55 -0
- package/dist/src/frontend/canonicalizer.d.ts.map +1 -0
- package/dist/src/frontend/canonicalizer.js +348 -0
- package/dist/src/frontend/canonicalizer.js.map +1 -0
- package/dist/src/frontend/index.d.ts +17 -0
- package/dist/src/frontend/index.d.ts.map +1 -0
- package/dist/src/frontend/index.js +16 -0
- package/dist/src/frontend/index.js.map +1 -0
- package/dist/src/frontend/keyword-translator.d.ts +134 -0
- package/dist/src/frontend/keyword-translator.d.ts.map +1 -0
- package/dist/src/frontend/keyword-translator.js +188 -0
- package/dist/src/frontend/keyword-translator.js.map +1 -0
- package/dist/src/frontend/lexer.d.ts +59 -0
- package/dist/src/frontend/lexer.d.ts.map +1 -0
- package/dist/src/frontend/lexer.js +536 -0
- package/dist/src/frontend/lexer.js.map +1 -0
- package/dist/src/frontend/tokens.d.ts +12 -0
- package/dist/src/frontend/tokens.d.ts.map +1 -0
- package/dist/src/frontend/tokens.js +12 -0
- package/dist/src/frontend/tokens.js.map +1 -0
- package/dist/src/index.d.ts +36 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +37 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/jvm/emitter.d.ts +3 -0
- package/dist/src/jvm/emitter.d.ts.map +1 -0
- package/dist/src/jvm/emitter.js +609 -0
- package/dist/src/jvm/emitter.js.map +1 -0
- package/dist/src/lower_to_core.d.ts +53 -0
- package/dist/src/lower_to_core.d.ts.map +1 -0
- package/dist/src/lower_to_core.js +528 -0
- package/dist/src/lower_to_core.js.map +1 -0
- package/dist/src/lsp/analysis.d.ts +50 -0
- package/dist/src/lsp/analysis.d.ts.map +1 -0
- package/dist/src/lsp/analysis.js +399 -0
- package/dist/src/lsp/analysis.js.map +1 -0
- package/dist/src/lsp/codeaction.d.ts +21 -0
- package/dist/src/lsp/codeaction.d.ts.map +1 -0
- package/dist/src/lsp/codeaction.js +531 -0
- package/dist/src/lsp/codeaction.js.map +1 -0
- package/dist/src/lsp/completion.d.ts +81 -0
- package/dist/src/lsp/completion.d.ts.map +1 -0
- package/dist/src/lsp/completion.js +345 -0
- package/dist/src/lsp/completion.js.map +1 -0
- package/dist/src/lsp/config.d.ts +34 -0
- package/dist/src/lsp/config.d.ts.map +1 -0
- package/dist/src/lsp/config.js +23 -0
- package/dist/src/lsp/config.js.map +1 -0
- package/dist/src/lsp/diagnostics.d.ts +87 -0
- package/dist/src/lsp/diagnostics.d.ts.map +1 -0
- package/dist/src/lsp/diagnostics.js +474 -0
- package/dist/src/lsp/diagnostics.js.map +1 -0
- package/dist/src/lsp/formatting.d.ts +16 -0
- package/dist/src/lsp/formatting.d.ts.map +1 -0
- package/dist/src/lsp/formatting.js +75 -0
- package/dist/src/lsp/formatting.js.map +1 -0
- package/dist/src/lsp/health.d.ts +74 -0
- package/dist/src/lsp/health.d.ts.map +1 -0
- package/dist/src/lsp/health.js +106 -0
- package/dist/src/lsp/health.js.map +1 -0
- package/dist/src/lsp/index.d.ts +14 -0
- package/dist/src/lsp/index.d.ts.map +1 -0
- package/dist/src/lsp/index.js +17 -0
- package/dist/src/lsp/index.js.map +1 -0
- package/dist/src/lsp/module_cache.d.ts +39 -0
- package/dist/src/lsp/module_cache.d.ts.map +1 -0
- package/dist/src/lsp/module_cache.js +308 -0
- package/dist/src/lsp/module_cache.js.map +1 -0
- package/dist/src/lsp/navigation/definition.d.ts +20 -0
- package/dist/src/lsp/navigation/definition.d.ts.map +1 -0
- package/dist/src/lsp/navigation/definition.js +96 -0
- package/dist/src/lsp/navigation/definition.js.map +1 -0
- package/dist/src/lsp/navigation/document-symbol.d.ts +20 -0
- package/dist/src/lsp/navigation/document-symbol.d.ts.map +1 -0
- package/dist/src/lsp/navigation/document-symbol.js +196 -0
- package/dist/src/lsp/navigation/document-symbol.js.map +1 -0
- package/dist/src/lsp/navigation/hover.d.ts +20 -0
- package/dist/src/lsp/navigation/hover.d.ts.map +1 -0
- package/dist/src/lsp/navigation/hover.js +147 -0
- package/dist/src/lsp/navigation/hover.js.map +1 -0
- package/dist/src/lsp/navigation/references.d.ts +17 -0
- package/dist/src/lsp/navigation/references.d.ts.map +1 -0
- package/dist/src/lsp/navigation/references.js +104 -0
- package/dist/src/lsp/navigation/references.js.map +1 -0
- package/dist/src/lsp/navigation/rename.d.ts +22 -0
- package/dist/src/lsp/navigation/rename.d.ts.map +1 -0
- package/dist/src/lsp/navigation/rename.js +161 -0
- package/dist/src/lsp/navigation/rename.js.map +1 -0
- package/dist/src/lsp/navigation/shared.d.ts +175 -0
- package/dist/src/lsp/navigation/shared.d.ts.map +1 -0
- package/dist/src/lsp/navigation/shared.js +470 -0
- package/dist/src/lsp/navigation/shared.js.map +1 -0
- package/dist/src/lsp/navigation.d.ts +23 -0
- package/dist/src/lsp/navigation.d.ts.map +1 -0
- package/dist/src/lsp/navigation.js +28 -0
- package/dist/src/lsp/navigation.js.map +1 -0
- package/dist/src/lsp/pii_diagnostics.d.ts +15 -0
- package/dist/src/lsp/pii_diagnostics.d.ts.map +1 -0
- package/dist/src/lsp/pii_diagnostics.js +624 -0
- package/dist/src/lsp/pii_diagnostics.js.map +1 -0
- package/dist/src/lsp/server.d.ts +3 -0
- package/dist/src/lsp/server.d.ts.map +1 -0
- package/dist/src/lsp/server.js +406 -0
- package/dist/src/lsp/server.js.map +1 -0
- package/dist/src/lsp/shared-state.d.ts +15 -0
- package/dist/src/lsp/shared-state.d.ts.map +1 -0
- package/dist/src/lsp/shared-state.js +21 -0
- package/dist/src/lsp/shared-state.js.map +1 -0
- package/dist/src/lsp/symbols.d.ts +35 -0
- package/dist/src/lsp/symbols.d.ts.map +1 -0
- package/dist/src/lsp/symbols.js +124 -0
- package/dist/src/lsp/symbols.js.map +1 -0
- package/dist/src/lsp/task-queue.d.ts +172 -0
- package/dist/src/lsp/task-queue.d.ts.map +1 -0
- package/dist/src/lsp/task-queue.js +310 -0
- package/dist/src/lsp/task-queue.js.map +1 -0
- package/dist/src/lsp/token-index.d.ts +45 -0
- package/dist/src/lsp/token-index.d.ts.map +1 -0
- package/dist/src/lsp/token-index.js +114 -0
- package/dist/src/lsp/token-index.js.map +1 -0
- package/dist/src/lsp/tokens.d.ts +33 -0
- package/dist/src/lsp/tokens.d.ts.map +1 -0
- package/dist/src/lsp/tokens.js +259 -0
- package/dist/src/lsp/tokens.js.map +1 -0
- package/dist/src/lsp/type-guards.d.ts +80 -0
- package/dist/src/lsp/type-guards.d.ts.map +1 -0
- package/dist/src/lsp/type-guards.js +132 -0
- package/dist/src/lsp/type-guards.js.map +1 -0
- package/dist/src/lsp/utils.d.ts +4 -0
- package/dist/src/lsp/utils.d.ts.map +1 -0
- package/dist/src/lsp/utils.js +52 -0
- package/dist/src/lsp/utils.js.map +1 -0
- package/dist/src/lsp/workspace/document-indexer.d.ts +14 -0
- package/dist/src/lsp/workspace/document-indexer.d.ts.map +1 -0
- package/dist/src/lsp/workspace/document-indexer.js +88 -0
- package/dist/src/lsp/workspace/document-indexer.js.map +1 -0
- package/dist/src/lsp/workspace/file-watcher.d.ts +137 -0
- package/dist/src/lsp/workspace/file-watcher.d.ts.map +1 -0
- package/dist/src/lsp/workspace/file-watcher.js +307 -0
- package/dist/src/lsp/workspace/file-watcher.js.map +1 -0
- package/dist/src/lsp/workspace/index-manager.d.ts +48 -0
- package/dist/src/lsp/workspace/index-manager.d.ts.map +1 -0
- package/dist/src/lsp/workspace/index-manager.js +131 -0
- package/dist/src/lsp/workspace/index-manager.js.map +1 -0
- package/dist/src/lsp/workspace/symbol-finder.d.ts +13 -0
- package/dist/src/lsp/workspace/symbol-finder.d.ts.map +1 -0
- package/dist/src/lsp/workspace/symbol-finder.js +69 -0
- package/dist/src/lsp/workspace/symbol-finder.js.map +1 -0
- package/dist/src/lsp/workspace/types.d.ts +77 -0
- package/dist/src/lsp/workspace/types.d.ts.map +1 -0
- package/dist/src/lsp/workspace/types.js +6 -0
- package/dist/src/lsp/workspace/types.js.map +1 -0
- package/dist/src/lsp/workspace/workspace-scanner.d.ts +11 -0
- package/dist/src/lsp/workspace/workspace-scanner.d.ts.map +1 -0
- package/dist/src/lsp/workspace/workspace-scanner.js +115 -0
- package/dist/src/lsp/workspace/workspace-scanner.js.map +1 -0
- package/dist/src/manifest.d.ts +48 -0
- package/dist/src/manifest.d.ts.map +1 -0
- package/dist/src/manifest.js +10 -0
- package/dist/src/manifest.js.map +1 -0
- package/dist/src/package/config.d.ts +28 -0
- package/dist/src/package/config.d.ts.map +1 -0
- package/dist/src/package/config.js +59 -0
- package/dist/src/package/config.js.map +1 -0
- package/dist/src/package/dependency-graph.d.ts +42 -0
- package/dist/src/package/dependency-graph.d.ts.map +1 -0
- package/dist/src/package/dependency-graph.js +144 -0
- package/dist/src/package/dependency-graph.js.map +1 -0
- package/dist/src/package/lockfile.d.ts +20 -0
- package/dist/src/package/lockfile.d.ts.map +1 -0
- package/dist/src/package/lockfile.js +146 -0
- package/dist/src/package/lockfile.js.map +1 -0
- package/dist/src/package/manifest-parser.d.ts +22 -0
- package/dist/src/package/manifest-parser.d.ts.map +1 -0
- package/dist/src/package/manifest-parser.js +275 -0
- package/dist/src/package/manifest-parser.js.map +1 -0
- package/dist/src/package/package-cache.d.ts +56 -0
- package/dist/src/package/package-cache.d.ts.map +1 -0
- package/dist/src/package/package-cache.js +166 -0
- package/dist/src/package/package-cache.js.map +1 -0
- package/dist/src/package/package-installer.d.ts +67 -0
- package/dist/src/package/package-installer.d.ts.map +1 -0
- package/dist/src/package/package-installer.js +310 -0
- package/dist/src/package/package-installer.js.map +1 -0
- package/dist/src/package/package-registry.d.ts +70 -0
- package/dist/src/package/package-registry.d.ts.map +1 -0
- package/dist/src/package/package-registry.js +480 -0
- package/dist/src/package/package-registry.js.map +1 -0
- package/dist/src/package/resolver.d.ts +50 -0
- package/dist/src/package/resolver.d.ts.map +1 -0
- package/dist/src/package/resolver.js +236 -0
- package/dist/src/package/resolver.js.map +1 -0
- package/dist/src/package/version-utils.d.ts +53 -0
- package/dist/src/package/version-utils.d.ts.map +1 -0
- package/dist/src/package/version-utils.js +61 -0
- package/dist/src/package/version-utils.js.map +1 -0
- package/dist/src/parser/constraint-parser.d.ts +42 -0
- package/dist/src/parser/constraint-parser.d.ts.map +1 -0
- package/dist/src/parser/constraint-parser.js +192 -0
- package/dist/src/parser/constraint-parser.js.map +1 -0
- package/dist/src/parser/context.d.ts +56 -0
- package/dist/src/parser/context.d.ts.map +1 -0
- package/dist/src/parser/context.js +177 -0
- package/dist/src/parser/context.js.map +1 -0
- package/dist/src/parser/decl-parser.d.ts +52 -0
- package/dist/src/parser/decl-parser.d.ts.map +1 -0
- package/dist/src/parser/decl-parser.js +461 -0
- package/dist/src/parser/decl-parser.js.map +1 -0
- package/dist/src/parser/expr-stmt-parser.d.ts +51 -0
- package/dist/src/parser/expr-stmt-parser.d.ts.map +1 -0
- package/dist/src/parser/expr-stmt-parser.js +1317 -0
- package/dist/src/parser/expr-stmt-parser.js.map +1 -0
- package/dist/src/parser/field-variant-parser.d.ts +47 -0
- package/dist/src/parser/field-variant-parser.d.ts.map +1 -0
- package/dist/src/parser/field-variant-parser.js +142 -0
- package/dist/src/parser/field-variant-parser.js.map +1 -0
- package/dist/src/parser/import-parser.d.ts +40 -0
- package/dist/src/parser/import-parser.d.ts.map +1 -0
- package/dist/src/parser/import-parser.js +91 -0
- package/dist/src/parser/import-parser.js.map +1 -0
- package/dist/src/parser/parser-tools.d.ts +52 -0
- package/dist/src/parser/parser-tools.d.ts.map +1 -0
- package/dist/src/parser/parser-tools.js +50 -0
- package/dist/src/parser/parser-tools.js.map +1 -0
- package/dist/src/parser/span-utils.d.ts +16 -0
- package/dist/src/parser/span-utils.d.ts.map +1 -0
- package/dist/src/parser/span-utils.js +90 -0
- package/dist/src/parser/span-utils.js.map +1 -0
- package/dist/src/parser/type-inference.d.ts +90 -0
- package/dist/src/parser/type-inference.d.ts.map +1 -0
- package/dist/src/parser/type-inference.js +287 -0
- package/dist/src/parser/type-inference.js.map +1 -0
- package/dist/src/parser/type-parser.d.ts +24 -0
- package/dist/src/parser/type-parser.d.ts.map +1 -0
- package/dist/src/parser/type-parser.js +338 -0
- package/dist/src/parser/type-parser.js.map +1 -0
- package/dist/src/parser.d.ts +12 -0
- package/dist/src/parser.d.ts.map +1 -0
- package/dist/src/parser.js +25 -0
- package/dist/src/parser.js.map +1 -0
- package/dist/src/typecheck/async.d.ts +57 -0
- package/dist/src/typecheck/async.d.ts.map +1 -0
- package/dist/src/typecheck/async.js +369 -0
- package/dist/src/typecheck/async.js.map +1 -0
- package/dist/src/typecheck/capabilities.d.ts +20 -0
- package/dist/src/typecheck/capabilities.d.ts.map +1 -0
- package/dist/src/typecheck/capabilities.js +86 -0
- package/dist/src/typecheck/capabilities.js.map +1 -0
- package/dist/src/typecheck/context.d.ts +31 -0
- package/dist/src/typecheck/context.d.ts.map +1 -0
- package/dist/src/typecheck/context.js +34 -0
- package/dist/src/typecheck/context.js.map +1 -0
- package/dist/src/typecheck/diagnostics.d.ts +15 -0
- package/dist/src/typecheck/diagnostics.d.ts.map +1 -0
- package/dist/src/typecheck/diagnostics.js +92 -0
- package/dist/src/typecheck/diagnostics.js.map +1 -0
- package/dist/src/typecheck/effects.d.ts +16 -0
- package/dist/src/typecheck/effects.d.ts.map +1 -0
- package/dist/src/typecheck/effects.js +122 -0
- package/dist/src/typecheck/effects.js.map +1 -0
- package/dist/src/typecheck/expression.d.ts +12 -0
- package/dist/src/typecheck/expression.d.ts.map +1 -0
- package/dist/src/typecheck/expression.js +306 -0
- package/dist/src/typecheck/expression.js.map +1 -0
- package/dist/src/typecheck/generics.d.ts +6 -0
- package/dist/src/typecheck/generics.d.ts.map +1 -0
- package/dist/src/typecheck/generics.js +131 -0
- package/dist/src/typecheck/generics.js.map +1 -0
- package/dist/src/typecheck/index.d.ts +6 -0
- package/dist/src/typecheck/index.d.ts.map +1 -0
- package/dist/src/typecheck/index.js +3 -0
- package/dist/src/typecheck/index.js.map +1 -0
- package/dist/src/typecheck/module.d.ts +9 -0
- package/dist/src/typecheck/module.d.ts.map +1 -0
- package/dist/src/typecheck/module.js +223 -0
- package/dist/src/typecheck/module.js.map +1 -0
- package/dist/src/typecheck/pattern.d.ts +6 -0
- package/dist/src/typecheck/pattern.d.ts.map +1 -0
- package/dist/src/typecheck/pattern.js +80 -0
- package/dist/src/typecheck/pattern.js.map +1 -0
- package/dist/src/typecheck/statement.d.ts +13 -0
- package/dist/src/typecheck/statement.d.ts.map +1 -0
- package/dist/src/typecheck/statement.js +176 -0
- package/dist/src/typecheck/statement.js.map +1 -0
- package/dist/src/typecheck/symbol_table.d.ts +63 -0
- package/dist/src/typecheck/symbol_table.d.ts.map +1 -0
- package/dist/src/typecheck/symbol_table.js +208 -0
- package/dist/src/typecheck/symbol_table.js.map +1 -0
- package/dist/src/typecheck/type_system.d.ts +30 -0
- package/dist/src/typecheck/type_system.d.ts.map +1 -0
- package/dist/src/typecheck/type_system.js +529 -0
- package/dist/src/typecheck/type_system.js.map +1 -0
- package/dist/src/typecheck/utils.d.ts +45 -0
- package/dist/src/typecheck/utils.d.ts.map +1 -0
- package/dist/src/typecheck/utils.js +110 -0
- package/dist/src/typecheck/utils.js.map +1 -0
- package/dist/src/typecheck/workflow.d.ts +8 -0
- package/dist/src/typecheck/workflow.d.ts.map +1 -0
- package/dist/src/typecheck/workflow.js +247 -0
- package/dist/src/typecheck/workflow.js.map +1 -0
- package/dist/src/typecheck-pii.d.ts +3 -0
- package/dist/src/typecheck-pii.d.ts.map +1 -0
- package/dist/src/typecheck-pii.js +534 -0
- package/dist/src/typecheck-pii.js.map +1 -0
- package/dist/src/typecheck.d.ts +7 -0
- package/dist/src/typecheck.d.ts.map +1 -0
- package/dist/src/typecheck.js +2 -0
- package/dist/src/typecheck.js.map +1 -0
- package/dist/src/types/base.d.ts +423 -0
- package/dist/src/types/base.d.ts.map +1 -0
- package/dist/src/types/base.js +18 -0
- package/dist/src/types/base.js.map +1 -0
- package/dist/src/types.d.ts +531 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +47 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/utils/logger.d.ts +28 -0
- package/dist/src/utils/logger.d.ts.map +1 -0
- package/dist/src/utils/logger.js +60 -0
- package/dist/src/utils/logger.js.map +1 -0
- package/dist/test/benchmark.d.ts +3 -0
- package/dist/test/benchmark.d.ts.map +1 -0
- package/dist/test/benchmark.js +106 -0
- package/dist/test/benchmark.js.map +1 -0
- package/dist/test/cli/commands/install.test.d.ts +2 -0
- package/dist/test/cli/commands/install.test.d.ts.map +1 -0
- package/dist/test/cli/commands/install.test.js +97 -0
- package/dist/test/cli/commands/install.test.js.map +1 -0
- package/dist/test/cli/commands/list.test.d.ts +2 -0
- package/dist/test/cli/commands/list.test.d.ts.map +1 -0
- package/dist/test/cli/commands/list.test.js +98 -0
- package/dist/test/cli/commands/list.test.js.map +1 -0
- package/dist/test/cli/commands/search.test.d.ts +2 -0
- package/dist/test/cli/commands/search.test.d.ts.map +1 -0
- package/dist/test/cli/commands/search.test.js +133 -0
- package/dist/test/cli/commands/search.test.js.map +1 -0
- package/dist/test/cli/commands/update.test.d.ts +2 -0
- package/dist/test/cli/commands/update.test.d.ts.map +1 -0
- package/dist/test/cli/commands/update.test.js +205 -0
- package/dist/test/cli/commands/update.test.js.map +1 -0
- package/dist/test/cli/integration.test.d.ts +2 -0
- package/dist/test/cli/integration.test.d.ts.map +1 -0
- package/dist/test/cli/integration.test.js +51 -0
- package/dist/test/cli/integration.test.js.map +1 -0
- package/dist/test/cli/registry-utils.d.ts +6 -0
- package/dist/test/cli/registry-utils.d.ts.map +1 -0
- package/dist/test/cli/registry-utils.js +35 -0
- package/dist/test/cli/registry-utils.js.map +1 -0
- package/dist/test/cli/utils/error-handler.test.d.ts +2 -0
- package/dist/test/cli/utils/error-handler.test.d.ts.map +1 -0
- package/dist/test/cli/utils/error-handler.test.js +108 -0
- package/dist/test/cli/utils/error-handler.test.js.map +1 -0
- package/dist/test/compiler/depends-on.test.d.ts +2 -0
- package/dist/test/compiler/depends-on.test.d.ts.map +1 -0
- package/dist/test/compiler/depends-on.test.js +184 -0
- package/dist/test/compiler/depends-on.test.js.map +1 -0
- package/dist/test/compiler/inventory-capability.test.d.ts +2 -0
- package/dist/test/compiler/inventory-capability.test.d.ts.map +1 -0
- package/dist/test/compiler/inventory-capability.test.js +22 -0
- package/dist/test/compiler/inventory-capability.test.js.map +1 -0
- package/dist/test/compiler/payment-capability.test.d.ts +2 -0
- package/dist/test/compiler/payment-capability.test.d.ts.map +1 -0
- package/dist/test/compiler/payment-capability.test.js +22 -0
- package/dist/test/compiler/payment-capability.test.js.map +1 -0
- package/dist/test/compiler/workflow-emitter-helpers.d.ts +3 -0
- package/dist/test/compiler/workflow-emitter-helpers.d.ts.map +1 -0
- package/dist/test/compiler/workflow-emitter-helpers.js +44 -0
- package/dist/test/compiler/workflow-emitter-helpers.js.map +1 -0
- package/dist/test/e2e/package-management.test.d.ts +2 -0
- package/dist/test/e2e/package-management.test.d.ts.map +1 -0
- package/dist/test/e2e/package-management.test.js +51 -0
- package/dist/test/e2e/package-management.test.js.map +1 -0
- package/dist/test/e2e/runner/golden-runner.d.ts +3 -0
- package/dist/test/e2e/runner/golden-runner.d.ts.map +1 -0
- package/dist/test/e2e/runner/golden-runner.js +212 -0
- package/dist/test/e2e/runner/golden-runner.js.map +1 -0
- package/dist/test/fuzz/formatter-fuzz.test.d.ts +3 -0
- package/dist/test/fuzz/formatter-fuzz.test.d.ts.map +1 -0
- package/dist/test/fuzz/formatter-fuzz.test.js +44 -0
- package/dist/test/fuzz/formatter-fuzz.test.js.map +1 -0
- package/dist/test/fuzz/fuzz.test.d.ts +3 -0
- package/dist/test/fuzz/fuzz.test.d.ts.map +1 -0
- package/dist/test/fuzz/fuzz.test.js +141 -0
- package/dist/test/fuzz/fuzz.test.js.map +1 -0
- package/dist/test/fuzz/lossless-fuzz.test.d.ts +3 -0
- package/dist/test/fuzz/lossless-fuzz.test.d.ts.map +1 -0
- package/dist/test/fuzz/lossless-fuzz.test.js +116 -0
- package/dist/test/fuzz/lossless-fuzz.test.js.map +1 -0
- package/dist/test/generators.d.ts +53 -0
- package/dist/test/generators.d.ts.map +1 -0
- package/dist/test/generators.js +253 -0
- package/dist/test/generators.js.map +1 -0
- package/dist/test/helpers/test-factories.d.ts +24 -0
- package/dist/test/helpers/test-factories.d.ts.map +1 -0
- package/dist/test/helpers/test-factories.js +30 -0
- package/dist/test/helpers/test-factories.js.map +1 -0
- package/dist/test/helpers/test-utils.d.ts +19 -0
- package/dist/test/helpers/test-utils.d.ts.map +1 -0
- package/dist/test/helpers/test-utils.js +30 -0
- package/dist/test/helpers/test-utils.js.map +1 -0
- package/dist/test/integration/capabilities/capabilities.test.d.ts +3 -0
- package/dist/test/integration/capabilities/capabilities.test.d.ts.map +1 -0
- package/dist/test/integration/capabilities/capabilities.test.js +63 -0
- package/dist/test/integration/capabilities/capabilities.test.js.map +1 -0
- package/dist/test/integration/capabilities/config-service.test.d.ts +11 -0
- package/dist/test/integration/capabilities/config-service.test.d.ts.map +1 -0
- package/dist/test/integration/capabilities/config-service.test.js +125 -0
- package/dist/test/integration/capabilities/config-service.test.js.map +1 -0
- package/dist/test/integration/capabilities/effect-config.test.d.ts +3 -0
- package/dist/test/integration/capabilities/effect-config.test.d.ts.map +1 -0
- package/dist/test/integration/capabilities/effect-config.test.js +196 -0
- package/dist/test/integration/capabilities/effect-config.test.js.map +1 -0
- package/dist/test/integration/compliance/compliance-smoke.test.d.ts +14 -0
- package/dist/test/integration/compliance/compliance-smoke.test.d.ts.map +1 -0
- package/dist/test/integration/compliance/compliance-smoke.test.js +222 -0
- package/dist/test/integration/compliance/compliance-smoke.test.js.map +1 -0
- package/dist/test/integration/lsp/lsp-client-helper.test.d.ts +7 -0
- package/dist/test/integration/lsp/lsp-client-helper.test.d.ts.map +1 -0
- package/dist/test/integration/lsp/lsp-client-helper.test.js +45 -0
- package/dist/test/integration/lsp/lsp-client-helper.test.js.map +1 -0
- package/dist/test/integration/lsp/lsp-completion.test.d.ts +7 -0
- package/dist/test/integration/lsp/lsp-completion.test.d.ts.map +1 -0
- package/dist/test/integration/lsp/lsp-completion.test.js +178 -0
- package/dist/test/integration/lsp/lsp-completion.test.js.map +1 -0
- package/dist/test/integration/lsp/lsp-diagnostics.test.d.ts +7 -0
- package/dist/test/integration/lsp/lsp-diagnostics.test.d.ts.map +1 -0
- package/dist/test/integration/lsp/lsp-diagnostics.test.js +105 -0
- package/dist/test/integration/lsp/lsp-diagnostics.test.js.map +1 -0
- package/dist/test/integration/lsp/lsp-file-watcher.test.d.ts +7 -0
- package/dist/test/integration/lsp/lsp-file-watcher.test.d.ts.map +1 -0
- package/dist/test/integration/lsp/lsp-file-watcher.test.js +401 -0
- package/dist/test/integration/lsp/lsp-file-watcher.test.js.map +1 -0
- package/dist/test/integration/lsp/lsp-health-metrics.test.d.ts +7 -0
- package/dist/test/integration/lsp/lsp-health-metrics.test.d.ts.map +1 -0
- package/dist/test/integration/lsp/lsp-health-metrics.test.js +285 -0
- package/dist/test/integration/lsp/lsp-health-metrics.test.js.map +1 -0
- package/dist/test/integration/lsp/lsp-modules.test.d.ts +7 -0
- package/dist/test/integration/lsp/lsp-modules.test.d.ts.map +1 -0
- package/dist/test/integration/lsp/lsp-modules.test.js +193 -0
- package/dist/test/integration/lsp/lsp-modules.test.js.map +1 -0
- package/dist/test/integration/lsp/lsp-multi-rename.test.d.ts +3 -0
- package/dist/test/integration/lsp/lsp-multi-rename.test.d.ts.map +1 -0
- package/dist/test/integration/lsp/lsp-multi-rename.test.js +81 -0
- package/dist/test/integration/lsp/lsp-multi-rename.test.js.map +1 -0
- package/dist/test/integration/lsp/lsp-navigation.test.d.ts +7 -0
- package/dist/test/integration/lsp/lsp-navigation.test.d.ts.map +1 -0
- package/dist/test/integration/lsp/lsp-navigation.test.js +332 -0
- package/dist/test/integration/lsp/lsp-navigation.test.js.map +1 -0
- package/dist/test/integration/lsp/lsp-process-lifecycle.test.d.ts +7 -0
- package/dist/test/integration/lsp/lsp-process-lifecycle.test.d.ts.map +1 -0
- package/dist/test/integration/lsp/lsp-process-lifecycle.test.js +257 -0
- package/dist/test/integration/lsp/lsp-process-lifecycle.test.js.map +1 -0
- package/dist/test/integration/lsp/lsp-task-queue.test.d.ts +7 -0
- package/dist/test/integration/lsp/lsp-task-queue.test.d.ts.map +1 -0
- package/dist/test/integration/lsp/lsp-task-queue.test.js +267 -0
- package/dist/test/integration/lsp/lsp-task-queue.test.js.map +1 -0
- package/dist/test/integration/pipeline/pipeline.test.d.ts +13 -0
- package/dist/test/integration/pipeline/pipeline.test.d.ts.map +1 -0
- package/dist/test/integration/pipeline/pipeline.test.js +310 -0
- package/dist/test/integration/pipeline/pipeline.test.js.map +1 -0
- package/dist/test/perf/perf-utils.test.d.ts +3 -0
- package/dist/test/perf/perf-utils.test.d.ts.map +1 -0
- package/dist/test/perf/perf-utils.test.js +144 -0
- package/dist/test/perf/perf-utils.test.js.map +1 -0
- package/dist/test/performance/package-installer.perf.test.d.ts +9 -0
- package/dist/test/performance/package-installer.perf.test.d.ts.map +1 -0
- package/dist/test/performance/package-installer.perf.test.js +80 -0
- package/dist/test/performance/package-installer.perf.test.js.map +1 -0
- package/dist/test/policy-converter/round-trip.test.d.ts +2 -0
- package/dist/test/policy-converter/round-trip.test.d.ts.map +1 -0
- package/dist/test/policy-converter/round-trip.test.js +83 -0
- package/dist/test/policy-converter/round-trip.test.js.map +1 -0
- package/dist/test/property/lsp-props.test.d.ts +3 -0
- package/dist/test/property/lsp-props.test.d.ts.map +1 -0
- package/dist/test/property/lsp-props.test.js +43 -0
- package/dist/test/property/lsp-props.test.js.map +1 -0
- package/dist/test/property/property.test.d.ts +3 -0
- package/dist/test/property/property.test.d.ts.map +1 -0
- package/dist/test/property/property.test.js +456 -0
- package/dist/test/property/property.test.js.map +1 -0
- package/dist/test/regression/type-checker-golden.test.d.ts +8 -0
- package/dist/test/regression/type-checker-golden.test.d.ts.map +1 -0
- package/dist/test/regression/type-checker-golden.test.js +172 -0
- package/dist/test/regression/type-checker-golden.test.js.map +1 -0
- package/dist/test/type-checker/cross-module-packages.test.d.ts +2 -0
- package/dist/test/type-checker/cross-module-packages.test.d.ts.map +1 -0
- package/dist/test/type-checker/cross-module-packages.test.js +51 -0
- package/dist/test/type-checker/cross-module-packages.test.js.map +1 -0
- package/dist/test/type-checker/pii-propagation.test.d.ts +2 -0
- package/dist/test/type-checker/pii-propagation.test.d.ts.map +1 -0
- package/dist/test/type-checker/pii-propagation.test.js +656 -0
- package/dist/test/type-checker/pii-propagation.test.js.map +1 -0
- package/dist/test/unit/async/async-discipline.test.d.ts +12 -0
- package/dist/test/unit/async/async-discipline.test.d.ts.map +1 -0
- package/dist/test/unit/async/async-discipline.test.js +492 -0
- package/dist/test/unit/async/async-discipline.test.js.map +1 -0
- package/dist/test/unit/async/async-schedule.test.d.ts +7 -0
- package/dist/test/unit/async/async-schedule.test.d.ts.map +1 -0
- package/dist/test/unit/async/async-schedule.test.js +154 -0
- package/dist/test/unit/async/async-schedule.test.js.map +1 -0
- package/dist/test/unit/canonicalizer/canonicalizer.test.d.ts +2 -0
- package/dist/test/unit/canonicalizer/canonicalizer.test.d.ts.map +1 -0
- package/dist/test/unit/canonicalizer/canonicalizer.test.js +195 -0
- package/dist/test/unit/canonicalizer/canonicalizer.test.js.map +1 -0
- package/dist/test/unit/config/config-service.test.d.ts +2 -0
- package/dist/test/unit/config/config-service.test.d.ts.map +1 -0
- package/dist/test/unit/config/config-service.test.js +235 -0
- package/dist/test/unit/config/config-service.test.js.map +1 -0
- package/dist/test/unit/config/effect-config-cache.test.d.ts +2 -0
- package/dist/test/unit/config/effect-config-cache.test.d.ts.map +1 -0
- package/dist/test/unit/config/effect-config-cache.test.js +135 -0
- package/dist/test/unit/config/effect-config-cache.test.js.map +1 -0
- package/dist/test/unit/config/lexicons/i18n.test.d.ts +15 -0
- package/dist/test/unit/config/lexicons/i18n.test.d.ts.map +1 -0
- package/dist/test/unit/config/lexicons/i18n.test.js +318 -0
- package/dist/test/unit/config/lexicons/i18n.test.js.map +1 -0
- package/dist/test/unit/config/lexicons/identifiers/identifier-mapping.test.d.ts +7 -0
- package/dist/test/unit/config/lexicons/identifiers/identifier-mapping.test.d.ts.map +1 -0
- package/dist/test/unit/config/lexicons/identifiers/identifier-mapping.test.js +180 -0
- package/dist/test/unit/config/lexicons/identifiers/identifier-mapping.test.js.map +1 -0
- package/dist/test/unit/config/lexicons/zh-CN.test.d.ts +7 -0
- package/dist/test/unit/config/lexicons/zh-CN.test.d.ts.map +1 -0
- package/dist/test/unit/config/lexicons/zh-CN.test.js +922 -0
- package/dist/test/unit/config/lexicons/zh-CN.test.js.map +1 -0
- package/dist/test/unit/core_ir_json/core_ir_json.test.d.ts +2 -0
- package/dist/test/unit/core_ir_json/core_ir_json.test.d.ts.map +1 -0
- package/dist/test/unit/core_ir_json/core_ir_json.test.js +218 -0
- package/dist/test/unit/core_ir_json/core_ir_json.test.js.map +1 -0
- package/dist/test/unit/dependency-graph.test.d.ts +5 -0
- package/dist/test/unit/dependency-graph.test.d.ts.map +1 -0
- package/dist/test/unit/dependency-graph.test.js +105 -0
- package/dist/test/unit/dependency-graph.test.js.map +1 -0
- package/dist/test/unit/effect/effect-inference.test.d.ts +2 -0
- package/dist/test/unit/effect/effect-inference.test.d.ts.map +1 -0
- package/dist/test/unit/effect/effect-inference.test.js +480 -0
- package/dist/test/unit/effect/effect-inference.test.js.map +1 -0
- package/dist/test/unit/emitter/emitter.test.d.ts +2 -0
- package/dist/test/unit/emitter/emitter.test.d.ts.map +1 -0
- package/dist/test/unit/emitter/emitter.test.js +825 -0
- package/dist/test/unit/emitter/emitter.test.js.map +1 -0
- package/dist/test/unit/generator.test.d.ts +2 -0
- package/dist/test/unit/generator.test.d.ts.map +1 -0
- package/dist/test/unit/generator.test.js +322 -0
- package/dist/test/unit/generator.test.js.map +1 -0
- package/dist/test/unit/keyword-translator.test.d.ts +10 -0
- package/dist/test/unit/keyword-translator.test.d.ts.map +1 -0
- package/dist/test/unit/keyword-translator.test.js +251 -0
- package/dist/test/unit/keyword-translator.test.js.map +1 -0
- package/dist/test/unit/lexer/lexer.test.d.ts +2 -0
- package/dist/test/unit/lexer/lexer.test.d.ts.map +1 -0
- package/dist/test/unit/lexer/lexer.test.js +136 -0
- package/dist/test/unit/lexer/lexer.test.js.map +1 -0
- package/dist/test/unit/lexer/newline-handling.test.d.ts +12 -0
- package/dist/test/unit/lexer/newline-handling.test.d.ts.map +1 -0
- package/dist/test/unit/lexer/newline-handling.test.js +379 -0
- package/dist/test/unit/lexer/newline-handling.test.js.map +1 -0
- package/dist/test/unit/llm-providers.test.d.ts +2 -0
- package/dist/test/unit/llm-providers.test.d.ts.map +1 -0
- package/dist/test/unit/llm-providers.test.js +341 -0
- package/dist/test/unit/llm-providers.test.js.map +1 -0
- package/dist/test/unit/lockfile.test.d.ts +5 -0
- package/dist/test/unit/lockfile.test.d.ts.map +1 -0
- package/dist/test/unit/lockfile.test.js +116 -0
- package/dist/test/unit/lockfile.test.js.map +1 -0
- package/dist/test/unit/lowering/lowering.test.d.ts +2 -0
- package/dist/test/unit/lowering/lowering.test.d.ts.map +1 -0
- package/dist/test/unit/lowering/lowering.test.js +625 -0
- package/dist/test/unit/lowering/lowering.test.js.map +1 -0
- package/dist/test/unit/lsp/analysis.test.d.ts +2 -0
- package/dist/test/unit/lsp/analysis.test.d.ts.map +1 -0
- package/dist/test/unit/lsp/analysis.test.js +401 -0
- package/dist/test/unit/lsp/analysis.test.js.map +1 -0
- package/dist/test/unit/lsp/codeaction.test.d.ts +2 -0
- package/dist/test/unit/lsp/codeaction.test.d.ts.map +1 -0
- package/dist/test/unit/lsp/codeaction.test.js +542 -0
- package/dist/test/unit/lsp/codeaction.test.js.map +1 -0
- package/dist/test/unit/lsp/pii-diagnostics.test.d.ts +2 -0
- package/dist/test/unit/lsp/pii-diagnostics.test.d.ts.map +1 -0
- package/dist/test/unit/lsp/pii-diagnostics.test.js +222 -0
- package/dist/test/unit/lsp/pii-diagnostics.test.js.map +1 -0
- package/dist/test/unit/lsp/symbols.test.d.ts +2 -0
- package/dist/test/unit/lsp/symbols.test.d.ts.map +1 -0
- package/dist/test/unit/lsp/symbols.test.js +160 -0
- package/dist/test/unit/lsp/symbols.test.js.map +1 -0
- package/dist/test/unit/lsp/utils.test.d.ts +2 -0
- package/dist/test/unit/lsp/utils.test.d.ts.map +1 -0
- package/dist/test/unit/lsp/utils.test.js +182 -0
- package/dist/test/unit/lsp/utils.test.js.map +1 -0
- package/dist/test/unit/manifest-parser.test.d.ts +12 -0
- package/dist/test/unit/manifest-parser.test.d.ts.map +1 -0
- package/dist/test/unit/manifest-parser.test.js +285 -0
- package/dist/test/unit/manifest-parser.test.js.map +1 -0
- package/dist/test/unit/manifest-schema.test.d.ts +11 -0
- package/dist/test/unit/manifest-schema.test.d.ts.map +1 -0
- package/dist/test/unit/manifest-schema.test.js +171 -0
- package/dist/test/unit/manifest-schema.test.js.map +1 -0
- package/dist/test/unit/module-cache-packages.test.d.ts +2 -0
- package/dist/test/unit/module-cache-packages.test.d.ts.map +1 -0
- package/dist/test/unit/module-cache-packages.test.js +114 -0
- package/dist/test/unit/module-cache-packages.test.js.map +1 -0
- package/dist/test/unit/package-cache.test.d.ts +7 -0
- package/dist/test/unit/package-cache.test.d.ts.map +1 -0
- package/dist/test/unit/package-cache.test.js +192 -0
- package/dist/test/unit/package-cache.test.js.map +1 -0
- package/dist/test/unit/package-installer.test.d.ts +2 -0
- package/dist/test/unit/package-installer.test.d.ts.map +1 -0
- package/dist/test/unit/package-installer.test.js +263 -0
- package/dist/test/unit/package-installer.test.js.map +1 -0
- package/dist/test/unit/package-registry.test.d.ts +7 -0
- package/dist/test/unit/package-registry.test.d.ts.map +1 -0
- package/dist/test/unit/package-registry.test.js +198 -0
- package/dist/test/unit/package-registry.test.js.map +1 -0
- package/dist/test/unit/parser/parser.test.d.ts +2 -0
- package/dist/test/unit/parser/parser.test.d.ts.map +1 -0
- package/dist/test/unit/parser/parser.test.js +1117 -0
- package/dist/test/unit/parser/parser.test.js.map +1 -0
- package/dist/test/unit/parser/type-inference.test.d.ts +5 -0
- package/dist/test/unit/parser/type-inference.test.d.ts.map +1 -0
- package/dist/test/unit/parser/type-inference.test.js +262 -0
- package/dist/test/unit/parser/type-inference.test.js.map +1 -0
- package/dist/test/unit/prompt-manager.test.d.ts +2 -0
- package/dist/test/unit/prompt-manager.test.d.ts.map +1 -0
- package/dist/test/unit/prompt-manager.test.js +137 -0
- package/dist/test/unit/prompt-manager.test.js.map +1 -0
- package/dist/test/unit/provenance-integration.test.d.ts +2 -0
- package/dist/test/unit/provenance-integration.test.d.ts.map +1 -0
- package/dist/test/unit/provenance-integration.test.js +181 -0
- package/dist/test/unit/provenance-integration.test.js.map +1 -0
- package/dist/test/unit/provenance.test.d.ts +2 -0
- package/dist/test/unit/provenance.test.d.ts.map +1 -0
- package/dist/test/unit/provenance.test.js +170 -0
- package/dist/test/unit/provenance.test.js.map +1 -0
- package/dist/test/unit/resolver.test.d.ts +5 -0
- package/dist/test/unit/resolver.test.d.ts.map +1 -0
- package/dist/test/unit/resolver.test.js +48 -0
- package/dist/test/unit/resolver.test.js.map +1 -0
- package/dist/test/unit/typecheck/async-discipline-extended.test.d.ts +2 -0
- package/dist/test/unit/typecheck/async-discipline-extended.test.d.ts.map +1 -0
- package/dist/test/unit/typecheck/async-discipline-extended.test.js +69 -0
- package/dist/test/unit/typecheck/async-discipline-extended.test.js.map +1 -0
- package/dist/test/unit/typecheck/effects-and-capabilities.test.d.ts +2 -0
- package/dist/test/unit/typecheck/effects-and-capabilities.test.d.ts.map +1 -0
- package/dist/test/unit/typecheck/effects-and-capabilities.test.js +191 -0
- package/dist/test/unit/typecheck/effects-and-capabilities.test.js.map +1 -0
- package/dist/test/unit/typecheck/regression-fixes.test.d.ts +11 -0
- package/dist/test/unit/typecheck/regression-fixes.test.d.ts.map +1 -0
- package/dist/test/unit/typecheck/regression-fixes.test.js +456 -0
- package/dist/test/unit/typecheck/regression-fixes.test.js.map +1 -0
- package/dist/test/unit/typecheck/should-enforce-pii.test.d.ts +2 -0
- package/dist/test/unit/typecheck/should-enforce-pii.test.d.ts.map +1 -0
- package/dist/test/unit/typecheck/should-enforce-pii.test.js +167 -0
- package/dist/test/unit/typecheck/should-enforce-pii.test.js.map +1 -0
- package/dist/test/unit/typecheck/symbol-table.test.d.ts +7 -0
- package/dist/test/unit/typecheck/symbol-table.test.d.ts.map +1 -0
- package/dist/test/unit/typecheck/symbol-table.test.js +145 -0
- package/dist/test/unit/typecheck/symbol-table.test.js.map +1 -0
- package/dist/test/unit/typecheck/type-inference.test.d.ts +2 -0
- package/dist/test/unit/typecheck/type-inference.test.d.ts.map +1 -0
- package/dist/test/unit/typecheck/type-inference.test.js +122 -0
- package/dist/test/unit/typecheck/type-inference.test.js.map +1 -0
- package/dist/test/unit/typecheck/type-system-extended.test.d.ts +8 -0
- package/dist/test/unit/typecheck/type-system-extended.test.d.ts.map +1 -0
- package/dist/test/unit/typecheck/type-system-extended.test.js +131 -0
- package/dist/test/unit/typecheck/type-system-extended.test.js.map +1 -0
- package/dist/test/unit/typecheck/type-system.test.d.ts +9 -0
- package/dist/test/unit/typecheck/type-system.test.d.ts.map +1 -0
- package/dist/test/unit/typecheck/type-system.test.js +617 -0
- package/dist/test/unit/typecheck/type-system.test.js.map +1 -0
- package/dist/test/unit/typecheck/typecheck-advanced.test.d.ts +2 -0
- package/dist/test/unit/typecheck/typecheck-advanced.test.d.ts.map +1 -0
- package/dist/test/unit/typecheck/typecheck-advanced.test.js +125 -0
- package/dist/test/unit/typecheck/typecheck-advanced.test.js.map +1 -0
- package/dist/test/unit/validator.test.d.ts +2 -0
- package/dist/test/unit/validator.test.d.ts.map +1 -0
- package/dist/test/unit/validator.test.js +154 -0
- package/dist/test/unit/validator.test.js.map +1 -0
- package/dist/test/unit/version-utils.test.d.ts +12 -0
- package/dist/test/unit/version-utils.test.d.ts.map +1 -0
- package/dist/test/unit/version-utils.test.js +112 -0
- package/dist/test/unit/version-utils.test.js.map +1 -0
- package/package.json +153 -0
|
@@ -0,0 +1,922 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module tests/unit/lexicons/zh-CN.test
|
|
3
|
+
*
|
|
4
|
+
* 中文词法表测试 - 验证端到端中文 CNL 处理。
|
|
5
|
+
*/
|
|
6
|
+
import { describe, it } from 'node:test';
|
|
7
|
+
import assert from 'node:assert';
|
|
8
|
+
import fs from 'node:fs';
|
|
9
|
+
import path from 'node:path';
|
|
10
|
+
import { canonicalize } from '../../../../src/frontend/canonicalizer.js';
|
|
11
|
+
import { lex } from '../../../../src/frontend/lexer.js';
|
|
12
|
+
import { ZH_CN } from '../../../../src/config/lexicons/zh-CN.js';
|
|
13
|
+
import { EN_US } from '../../../../src/config/lexicons/en-US.js';
|
|
14
|
+
import { LexiconRegistry, initializeDefaultLexicons } from '../../../../src/config/lexicons/index.js';
|
|
15
|
+
import { SemanticTokenKind } from '../../../../src/config/token-kind.js';
|
|
16
|
+
import { TokenKind } from '../../../../src/frontend/tokens.js';
|
|
17
|
+
// ============================================================================
|
|
18
|
+
// 文件级辅助函数(Codex 审查建议:消除重复定义)
|
|
19
|
+
// ============================================================================
|
|
20
|
+
/**
|
|
21
|
+
* 查找具有指定值的标识符 token。
|
|
22
|
+
*
|
|
23
|
+
* 注意:Aster lexer 将关键词输出为 IDENT,在 parser 阶段才识别为关键词。
|
|
24
|
+
*/
|
|
25
|
+
const findIdent = (tokens, value) => tokens.find((t) => t.kind === TokenKind.IDENT && t.value === value);
|
|
26
|
+
/**
|
|
27
|
+
* 统计具有指定值的标识符 token 数量。
|
|
28
|
+
*/
|
|
29
|
+
const countIdent = (tokens, value) => tokens.filter((t) => t.kind === TokenKind.IDENT && t.value === value).length;
|
|
30
|
+
/**
|
|
31
|
+
* 统计指定类型的 token 数量。
|
|
32
|
+
*/
|
|
33
|
+
const countTokenKind = (tokens, kind) => tokens.filter((t) => t.kind === kind).length;
|
|
34
|
+
/**
|
|
35
|
+
* 跨语言 token 类型分布比较的容差值。
|
|
36
|
+
*
|
|
37
|
+
* 允许较大差异,因为:
|
|
38
|
+
* 1. 中文使用【】标记增加了额外 token
|
|
39
|
+
* 2. 中文语法结构与英文有差异(如「入参」「产出」vs「to...with...produce」)
|
|
40
|
+
* 3. 中文标点处理方式不同
|
|
41
|
+
*/
|
|
42
|
+
const CROSS_LANG_IDENT_TOLERANCE = 15;
|
|
43
|
+
describe('ZH_CN Lexicon 测试套件', () => {
|
|
44
|
+
// 初始化注册表
|
|
45
|
+
initializeDefaultLexicons();
|
|
46
|
+
describe('Lexicon 注册与获取', () => {
|
|
47
|
+
it('应成功注册中文词法表', () => {
|
|
48
|
+
assert.ok(LexiconRegistry.has('zh-CN'));
|
|
49
|
+
const lexicon = LexiconRegistry.get('zh-CN');
|
|
50
|
+
assert.ok(lexicon);
|
|
51
|
+
assert.strictEqual(lexicon.id, 'zh-CN');
|
|
52
|
+
assert.strictEqual(lexicon.name, '简体中文');
|
|
53
|
+
});
|
|
54
|
+
it('应成功注册英文词法表', () => {
|
|
55
|
+
assert.ok(LexiconRegistry.has('en-US'));
|
|
56
|
+
const lexicon = LexiconRegistry.get('en-US');
|
|
57
|
+
assert.ok(lexicon);
|
|
58
|
+
assert.strictEqual(lexicon.id, 'en-US');
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
describe('中文关键字映射', () => {
|
|
62
|
+
it('应正确映射控制流关键字', () => {
|
|
63
|
+
assert.strictEqual(ZH_CN.keywords[SemanticTokenKind.IF], '若');
|
|
64
|
+
assert.strictEqual(ZH_CN.keywords[SemanticTokenKind.OTHERWISE], '否则');
|
|
65
|
+
assert.strictEqual(ZH_CN.keywords[SemanticTokenKind.RETURN], '返回');
|
|
66
|
+
assert.strictEqual(ZH_CN.keywords[SemanticTokenKind.MATCH], '把');
|
|
67
|
+
assert.strictEqual(ZH_CN.keywords[SemanticTokenKind.WHEN], '当');
|
|
68
|
+
});
|
|
69
|
+
it('应正确映射类型定义关键字', () => {
|
|
70
|
+
assert.strictEqual(ZH_CN.keywords[SemanticTokenKind.TYPE_DEF], '【定义】');
|
|
71
|
+
assert.strictEqual(ZH_CN.keywords[SemanticTokenKind.TYPE_WITH], '包含');
|
|
72
|
+
assert.strictEqual(ZH_CN.keywords[SemanticTokenKind.TYPE_ONE_OF], '为以下之一');
|
|
73
|
+
});
|
|
74
|
+
it('应正确映射变量操作关键字', () => {
|
|
75
|
+
assert.strictEqual(ZH_CN.keywords[SemanticTokenKind.LET], '令');
|
|
76
|
+
assert.strictEqual(ZH_CN.keywords[SemanticTokenKind.BE], '为');
|
|
77
|
+
assert.strictEqual(ZH_CN.keywords[SemanticTokenKind.SET], '将');
|
|
78
|
+
});
|
|
79
|
+
it('应正确映射布尔和null字面量', () => {
|
|
80
|
+
assert.strictEqual(ZH_CN.keywords[SemanticTokenKind.TRUE], '真');
|
|
81
|
+
assert.strictEqual(ZH_CN.keywords[SemanticTokenKind.FALSE], '假');
|
|
82
|
+
assert.strictEqual(ZH_CN.keywords[SemanticTokenKind.NULL], '空');
|
|
83
|
+
});
|
|
84
|
+
it('应正确映射基础类型', () => {
|
|
85
|
+
assert.strictEqual(ZH_CN.keywords[SemanticTokenKind.TEXT], '文本');
|
|
86
|
+
assert.strictEqual(ZH_CN.keywords[SemanticTokenKind.INT_TYPE], '整数');
|
|
87
|
+
assert.strictEqual(ZH_CN.keywords[SemanticTokenKind.FLOAT_TYPE], '小数');
|
|
88
|
+
assert.strictEqual(ZH_CN.keywords[SemanticTokenKind.BOOL_TYPE], '布尔');
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
describe('中文标点配置', () => {
|
|
92
|
+
it('应使用中文句号作为语句结尾', () => {
|
|
93
|
+
assert.strictEqual(ZH_CN.punctuation.statementEnd, '。');
|
|
94
|
+
});
|
|
95
|
+
it('应使用中文逗号作为列表分隔符', () => {
|
|
96
|
+
assert.strictEqual(ZH_CN.punctuation.listSeparator, ',');
|
|
97
|
+
});
|
|
98
|
+
it('应使用直角引号作为字符串引号', () => {
|
|
99
|
+
assert.strictEqual(ZH_CN.punctuation.stringQuotes.open, '「');
|
|
100
|
+
assert.strictEqual(ZH_CN.punctuation.stringQuotes.close, '」');
|
|
101
|
+
});
|
|
102
|
+
it('应使用方括号作为标记', () => {
|
|
103
|
+
assert.strictEqual(ZH_CN.punctuation.markers?.open, '【');
|
|
104
|
+
assert.strictEqual(ZH_CN.punctuation.markers?.close, '】');
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
describe('规范化配置', () => {
|
|
108
|
+
it('应启用全角转半角', () => {
|
|
109
|
+
assert.strictEqual(ZH_CN.canonicalization.fullWidthToHalf, true);
|
|
110
|
+
});
|
|
111
|
+
it('应使用中文空白模式', () => {
|
|
112
|
+
assert.strictEqual(ZH_CN.canonicalization.whitespaceMode, 'chinese');
|
|
113
|
+
});
|
|
114
|
+
it('应禁用冠词移除', () => {
|
|
115
|
+
assert.strictEqual(ZH_CN.canonicalization.removeArticles, false);
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
describe('Canonicalizer 中文支持', () => {
|
|
119
|
+
it('应保留中文标点', () => {
|
|
120
|
+
const input = '令 变量 为 42。';
|
|
121
|
+
const result = canonicalize(input, ZH_CN);
|
|
122
|
+
assert.ok(result.includes('。'));
|
|
123
|
+
});
|
|
124
|
+
it('应全角数字转半角', () => {
|
|
125
|
+
const input = '123';
|
|
126
|
+
const result = canonicalize(input, ZH_CN);
|
|
127
|
+
assert.ok(result.includes('123'));
|
|
128
|
+
});
|
|
129
|
+
it('应全角字母转半角', () => {
|
|
130
|
+
const input = 'ABC';
|
|
131
|
+
const result = canonicalize(input, ZH_CN);
|
|
132
|
+
assert.ok(result.includes('ABC'));
|
|
133
|
+
});
|
|
134
|
+
it('应全角运算符转半角', () => {
|
|
135
|
+
const input = '1 + 2';
|
|
136
|
+
const result = canonicalize(input, ZH_CN);
|
|
137
|
+
assert.ok(result.includes('+'));
|
|
138
|
+
});
|
|
139
|
+
it('应全角括号转半角', () => {
|
|
140
|
+
const input = '函数(参数)';
|
|
141
|
+
const result = canonicalize(input, ZH_CN);
|
|
142
|
+
assert.ok(result.includes('('));
|
|
143
|
+
assert.ok(result.includes(')'));
|
|
144
|
+
assert.ok(!result.includes('('));
|
|
145
|
+
assert.ok(!result.includes(')'));
|
|
146
|
+
});
|
|
147
|
+
it('应全角方括号转半角', () => {
|
|
148
|
+
const input = '数组[索引]';
|
|
149
|
+
const result = canonicalize(input, ZH_CN);
|
|
150
|
+
// 验证半角方括号存在
|
|
151
|
+
assert.ok(result.includes('['), '应含半角左方括号');
|
|
152
|
+
assert.ok(result.includes(']'), '应含半角右方括号');
|
|
153
|
+
// Codex Round 6 建议:验证全角方括号被移除
|
|
154
|
+
assert.ok(!result.includes('['), '全角左方括号应被移除');
|
|
155
|
+
assert.ok(!result.includes(']'), '全角右方括号应被移除');
|
|
156
|
+
});
|
|
157
|
+
it('应移除英文冠词但保留中文', () => {
|
|
158
|
+
// 英文模式移除冠词
|
|
159
|
+
const enInput = 'define the User with a name.';
|
|
160
|
+
const enResult = canonicalize(enInput, EN_US);
|
|
161
|
+
assert.ok(!enResult.includes(' the '));
|
|
162
|
+
assert.ok(!enResult.includes(' a '));
|
|
163
|
+
// 中文模式不移除冠词(中文没有冠词)
|
|
164
|
+
const zhInput = '【定义】 用户 包含 名字。';
|
|
165
|
+
const zhResult = canonicalize(zhInput, ZH_CN);
|
|
166
|
+
assert.strictEqual(zhResult, zhInput);
|
|
167
|
+
});
|
|
168
|
+
it('应将智能引号转换为直角引号', () => {
|
|
169
|
+
// 左右智能引号 → 直角引号
|
|
170
|
+
const input = '"你好世界"';
|
|
171
|
+
const result = canonicalize(input, ZH_CN);
|
|
172
|
+
assert.strictEqual(result, '「你好世界」');
|
|
173
|
+
});
|
|
174
|
+
it('应将直引号成对转换为直角引号', () => {
|
|
175
|
+
// 直引号按奇偶位置交替转换
|
|
176
|
+
const input = '"hello" "world"';
|
|
177
|
+
const result = canonicalize(input, ZH_CN);
|
|
178
|
+
assert.strictEqual(result, '「hello」 「world」');
|
|
179
|
+
});
|
|
180
|
+
it('应正确处理混合引号', () => {
|
|
181
|
+
// 智能引号和直引号混合
|
|
182
|
+
const input = '"智能" and "直接"';
|
|
183
|
+
const result = canonicalize(input, ZH_CN);
|
|
184
|
+
assert.strictEqual(result, '「智能」 and 「直接」');
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
describe('Lexer 中文支持', () => {
|
|
188
|
+
it('应识别中文标识符', () => {
|
|
189
|
+
const input = '变量名';
|
|
190
|
+
const result = canonicalize(input, ZH_CN);
|
|
191
|
+
const tokens = lex(result, ZH_CN);
|
|
192
|
+
// 过滤掉 EOF
|
|
193
|
+
const nonEofTokens = tokens.filter((t) => t.kind !== TokenKind.EOF);
|
|
194
|
+
assert.strictEqual(nonEofTokens.length, 1);
|
|
195
|
+
assert.strictEqual(nonEofTokens[0].kind, TokenKind.IDENT);
|
|
196
|
+
assert.strictEqual(nonEofTokens[0].value, '变量名');
|
|
197
|
+
});
|
|
198
|
+
it('应识别中文布尔值', () => {
|
|
199
|
+
const tokens = lex('真', ZH_CN);
|
|
200
|
+
const nonEofTokens = tokens.filter((t) => t.kind !== TokenKind.EOF);
|
|
201
|
+
assert.strictEqual(nonEofTokens.length, 1);
|
|
202
|
+
assert.strictEqual(nonEofTokens[0].kind, TokenKind.BOOL);
|
|
203
|
+
assert.strictEqual(nonEofTokens[0].value, true);
|
|
204
|
+
});
|
|
205
|
+
it('应识别中文 false', () => {
|
|
206
|
+
const tokens = lex('假', ZH_CN);
|
|
207
|
+
const nonEofTokens = tokens.filter((t) => t.kind !== TokenKind.EOF);
|
|
208
|
+
assert.strictEqual(nonEofTokens.length, 1);
|
|
209
|
+
assert.strictEqual(nonEofTokens[0].kind, TokenKind.BOOL);
|
|
210
|
+
assert.strictEqual(nonEofTokens[0].value, false);
|
|
211
|
+
});
|
|
212
|
+
it('应识别中文 null', () => {
|
|
213
|
+
const tokens = lex('空', ZH_CN);
|
|
214
|
+
const nonEofTokens = tokens.filter((t) => t.kind !== TokenKind.EOF);
|
|
215
|
+
assert.strictEqual(nonEofTokens.length, 1);
|
|
216
|
+
assert.strictEqual(nonEofTokens[0].kind, TokenKind.NULL);
|
|
217
|
+
assert.strictEqual(nonEofTokens[0].value, null);
|
|
218
|
+
});
|
|
219
|
+
it('应识别直角引号字符串', () => {
|
|
220
|
+
const tokens = lex('「你好世界」', ZH_CN);
|
|
221
|
+
const nonEofTokens = tokens.filter((t) => t.kind !== TokenKind.EOF);
|
|
222
|
+
assert.strictEqual(nonEofTokens.length, 1);
|
|
223
|
+
assert.strictEqual(nonEofTokens[0].kind, TokenKind.STRING);
|
|
224
|
+
assert.strictEqual(nonEofTokens[0].value, '你好世界');
|
|
225
|
+
});
|
|
226
|
+
it('应识别中文句号', () => {
|
|
227
|
+
const tokens = lex('变量。', ZH_CN);
|
|
228
|
+
const hasZhPeriod = tokens.some((t) => t.kind === TokenKind.DOT);
|
|
229
|
+
assert.ok(hasZhPeriod);
|
|
230
|
+
});
|
|
231
|
+
it('应识别中文冒号', () => {
|
|
232
|
+
const tokens = lex('定义:', ZH_CN);
|
|
233
|
+
const hasZhColon = tokens.some((t) => t.kind === TokenKind.COLON);
|
|
234
|
+
assert.ok(hasZhColon);
|
|
235
|
+
});
|
|
236
|
+
it('应识别混合中英文标识符', () => {
|
|
237
|
+
const tokens = lex('User用户', ZH_CN);
|
|
238
|
+
const nonEofTokens = tokens.filter((t) => t.kind !== TokenKind.EOF);
|
|
239
|
+
assert.strictEqual(nonEofTokens.length, 1);
|
|
240
|
+
assert.strictEqual(nonEofTokens[0].kind, TokenKind.TYPE_IDENT);
|
|
241
|
+
assert.strictEqual(nonEofTokens[0].value, 'User用户');
|
|
242
|
+
});
|
|
243
|
+
});
|
|
244
|
+
describe('英文兼容性(默认行为)', () => {
|
|
245
|
+
it('无 lexicon 参数时应使用英文默认行为', () => {
|
|
246
|
+
const input = 'define User with name.';
|
|
247
|
+
const result = canonicalize(input);
|
|
248
|
+
// 应移除冠词
|
|
249
|
+
assert.ok(!result.includes(' the '));
|
|
250
|
+
const tokens = lex(result);
|
|
251
|
+
// 应正确词法分析
|
|
252
|
+
assert.ok(tokens.length > 0);
|
|
253
|
+
});
|
|
254
|
+
it('显式传递 EN_US 应与默认行为一致', () => {
|
|
255
|
+
const input = 'define User with name.';
|
|
256
|
+
const defaultResult = canonicalize(input);
|
|
257
|
+
const explicitResult = canonicalize(input, EN_US);
|
|
258
|
+
assert.strictEqual(defaultResult, explicitResult);
|
|
259
|
+
});
|
|
260
|
+
});
|
|
261
|
+
describe('标点符号数据驱动处理', () => {
|
|
262
|
+
it('应识别中文逗号为列表分隔符', () => {
|
|
263
|
+
const tokens = lex('甲,乙,丙', ZH_CN);
|
|
264
|
+
const commaTokens = tokens.filter((t) => t.kind === TokenKind.COMMA);
|
|
265
|
+
assert.strictEqual(commaTokens.length, 2);
|
|
266
|
+
});
|
|
267
|
+
it('应识别中文顿号为枚举分隔符', () => {
|
|
268
|
+
const tokens = lex('甲、乙、丙', ZH_CN);
|
|
269
|
+
const commaTokens = tokens.filter((t) => t.kind === TokenKind.COMMA);
|
|
270
|
+
assert.strictEqual(commaTokens.length, 2);
|
|
271
|
+
});
|
|
272
|
+
it('应识别方括号标记', () => {
|
|
273
|
+
const tokens = lex('【模块】', ZH_CN);
|
|
274
|
+
const hasOpen = tokens.some((t) => t.kind === TokenKind.LBRACKET);
|
|
275
|
+
const hasClose = tokens.some((t) => t.kind === TokenKind.RBRACKET);
|
|
276
|
+
assert.ok(hasOpen, '应有左方括号');
|
|
277
|
+
assert.ok(hasClose, '应有右方括号');
|
|
278
|
+
});
|
|
279
|
+
it('英文模式应使用英文标点', () => {
|
|
280
|
+
const tokens = lex('a, b, c.', EN_US);
|
|
281
|
+
const commaTokens = tokens.filter((t) => t.kind === TokenKind.COMMA);
|
|
282
|
+
const dotTokens = tokens.filter((t) => t.kind === TokenKind.DOT);
|
|
283
|
+
assert.strictEqual(commaTokens.length, 2);
|
|
284
|
+
assert.strictEqual(dotTokens.length, 1);
|
|
285
|
+
});
|
|
286
|
+
});
|
|
287
|
+
describe('中文控制流语法', () => {
|
|
288
|
+
it('应正确词法分析 若/否则 二分支条件', () => {
|
|
289
|
+
const input = '若 年龄 >= 18:\n 返回 「成年」。\n否则:\n 返回 「未成年」。';
|
|
290
|
+
const result = canonicalize(input, ZH_CN);
|
|
291
|
+
const tokens = lex(result, ZH_CN);
|
|
292
|
+
// 验证控制流关键词(在 lexer 阶段为 IDENT)
|
|
293
|
+
assert.ok(findIdent(tokens, '若'), '应识别「若」标识符');
|
|
294
|
+
assert.ok(findIdent(tokens, '否则'), '应识别「否则」标识符');
|
|
295
|
+
assert.strictEqual(countIdent(tokens, '返回'), 2, '应有两个「返回」标识符');
|
|
296
|
+
});
|
|
297
|
+
it('应正确词法分析 把/当 模式匹配', () => {
|
|
298
|
+
const input = '把 用户 当:\n 当 空,返回 「访客」。\n 当 用户(编号, 名字),返回 名字。';
|
|
299
|
+
const result = canonicalize(input, ZH_CN);
|
|
300
|
+
const tokens = lex(result, ZH_CN);
|
|
301
|
+
// 验证模式匹配关键词
|
|
302
|
+
assert.ok(findIdent(tokens, '把'), '应识别「把」标识符');
|
|
303
|
+
assert.strictEqual(countIdent(tokens, '当'), 3, '应有三个「当」标识符(含 把...当)');
|
|
304
|
+
});
|
|
305
|
+
it('应正确词法分析嵌套条件', () => {
|
|
306
|
+
const input = '若 甲:\n 若 乙:\n 返回 「甲乙」。\n 否则:\n 返回 「仅甲」。\n否则:\n 返回 「无」。';
|
|
307
|
+
const result = canonicalize(input, ZH_CN);
|
|
308
|
+
const tokens = lex(result, ZH_CN);
|
|
309
|
+
assert.strictEqual(countIdent(tokens, '若'), 2, '应有两个「若」标识符');
|
|
310
|
+
assert.strictEqual(countIdent(tokens, '否则'), 2, '应有两个「否则」标识符');
|
|
311
|
+
assert.strictEqual(countIdent(tokens, '返回'), 3, '应有三个「返回」标识符');
|
|
312
|
+
});
|
|
313
|
+
});
|
|
314
|
+
// ============================================================================
|
|
315
|
+
// 补充语法测试(Codex 审查建议:覆盖导入、布尔/算术、循环、工作流语法)
|
|
316
|
+
// ============================================================================
|
|
317
|
+
describe('中文导入语法', () => {
|
|
318
|
+
it('应正确词法分析简单导入', () => {
|
|
319
|
+
const input = '引用 数学。';
|
|
320
|
+
const result = canonicalize(input, ZH_CN);
|
|
321
|
+
const tokens = lex(result, ZH_CN);
|
|
322
|
+
// 关键词验证
|
|
323
|
+
assert.ok(findIdent(tokens, '引用'), '应识别「引用」标识符');
|
|
324
|
+
assert.ok(findIdent(tokens, '数学'), '应识别「数学」标识符');
|
|
325
|
+
// Token 结构验证(Codex 审查建议)
|
|
326
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.DOT), 1, '应有1个句号');
|
|
327
|
+
});
|
|
328
|
+
it('应正确词法分析带别名的导入', () => {
|
|
329
|
+
const input = '引用 外部模块 作为 本地名。';
|
|
330
|
+
const result = canonicalize(input, ZH_CN);
|
|
331
|
+
const tokens = lex(result, ZH_CN);
|
|
332
|
+
// 关键词验证
|
|
333
|
+
assert.ok(findIdent(tokens, '引用'), '应识别「引用」标识符');
|
|
334
|
+
assert.ok(findIdent(tokens, '作为'), '应识别「作为」标识符');
|
|
335
|
+
assert.ok(findIdent(tokens, '外部模块'), '应识别模块名标识符');
|
|
336
|
+
assert.ok(findIdent(tokens, '本地名'), '应识别别名标识符');
|
|
337
|
+
// Token 结构验证
|
|
338
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.DOT), 1, '应有1个句号');
|
|
339
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.IDENT), 4, '应有4个标识符');
|
|
340
|
+
});
|
|
341
|
+
it('应正确词法分析多个导入', () => {
|
|
342
|
+
const input = '引用 模块甲。\n引用 模块乙 作为 乙。';
|
|
343
|
+
const result = canonicalize(input, ZH_CN);
|
|
344
|
+
const tokens = lex(result, ZH_CN);
|
|
345
|
+
assert.strictEqual(countIdent(tokens, '引用'), 2, '应有2个「引用」');
|
|
346
|
+
assert.strictEqual(countIdent(tokens, '作为'), 1, '应有1个「作为」');
|
|
347
|
+
// Token 结构验证
|
|
348
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.DOT), 2, '应有2个句号');
|
|
349
|
+
});
|
|
350
|
+
});
|
|
351
|
+
describe('中文布尔运算语法', () => {
|
|
352
|
+
it('应正确词法分析「或」运算', () => {
|
|
353
|
+
const input = '甲 或 乙。';
|
|
354
|
+
const result = canonicalize(input, ZH_CN);
|
|
355
|
+
const tokens = lex(result, ZH_CN);
|
|
356
|
+
assert.ok(findIdent(tokens, '或'), '应识别「或」标识符');
|
|
357
|
+
// Token 结构验证
|
|
358
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.IDENT), 3, '应有3个标识符');
|
|
359
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.DOT), 1, '应有1个句号');
|
|
360
|
+
});
|
|
361
|
+
it('应正确词法分析「且」运算', () => {
|
|
362
|
+
const input = '甲 且 乙。';
|
|
363
|
+
const result = canonicalize(input, ZH_CN);
|
|
364
|
+
const tokens = lex(result, ZH_CN);
|
|
365
|
+
assert.ok(findIdent(tokens, '且'), '应识别「且」标识符');
|
|
366
|
+
// Token 结构验证
|
|
367
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.IDENT), 3, '应有3个标识符');
|
|
368
|
+
});
|
|
369
|
+
it('应正确词法分析「非」运算', () => {
|
|
370
|
+
const input = '非 甲。';
|
|
371
|
+
const result = canonicalize(input, ZH_CN);
|
|
372
|
+
const tokens = lex(result, ZH_CN);
|
|
373
|
+
assert.ok(findIdent(tokens, '非'), '应识别「非」标识符');
|
|
374
|
+
// Token 结构验证
|
|
375
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.IDENT), 2, '应有2个标识符');
|
|
376
|
+
});
|
|
377
|
+
it('应正确词法分析复合布尔表达式', () => {
|
|
378
|
+
const input = '(甲 且 乙) 或 (非 丙)。';
|
|
379
|
+
const result = canonicalize(input, ZH_CN);
|
|
380
|
+
const tokens = lex(result, ZH_CN);
|
|
381
|
+
assert.strictEqual(countIdent(tokens, '且'), 1, '应有1个「且」');
|
|
382
|
+
assert.strictEqual(countIdent(tokens, '或'), 1, '应有1个「或」');
|
|
383
|
+
assert.strictEqual(countIdent(tokens, '非'), 1, '应有1个「非」');
|
|
384
|
+
// Token 结构验证:括号
|
|
385
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.LPAREN), 2, '应有2个左括号');
|
|
386
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.RPAREN), 2, '应有2个右括号');
|
|
387
|
+
});
|
|
388
|
+
});
|
|
389
|
+
describe('中文算术运算语法', () => {
|
|
390
|
+
it('应正确词法分析「加」运算', () => {
|
|
391
|
+
const input = '1 加 2。';
|
|
392
|
+
const result = canonicalize(input, ZH_CN);
|
|
393
|
+
const tokens = lex(result, ZH_CN);
|
|
394
|
+
assert.ok(findIdent(tokens, '加'), '应识别「加」标识符');
|
|
395
|
+
// Token 结构验证:数字
|
|
396
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.INT), 2, '应有2个整数');
|
|
397
|
+
});
|
|
398
|
+
it('应正确词法分析「减」运算', () => {
|
|
399
|
+
const input = '5 减 3。';
|
|
400
|
+
const result = canonicalize(input, ZH_CN);
|
|
401
|
+
const tokens = lex(result, ZH_CN);
|
|
402
|
+
assert.ok(findIdent(tokens, '减'), '应识别「减」标识符');
|
|
403
|
+
// Token 结构验证
|
|
404
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.INT), 2, '应有2个整数');
|
|
405
|
+
});
|
|
406
|
+
it('应正确词法分析「乘」运算', () => {
|
|
407
|
+
const input = '4 乘 2。';
|
|
408
|
+
const result = canonicalize(input, ZH_CN);
|
|
409
|
+
const tokens = lex(result, ZH_CN);
|
|
410
|
+
assert.ok(findIdent(tokens, '乘'), '应识别「乘」标识符');
|
|
411
|
+
// Token 结构验证
|
|
412
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.INT), 2, '应有2个整数');
|
|
413
|
+
});
|
|
414
|
+
it('应正确词法分析「除以」运算', () => {
|
|
415
|
+
const input = '10 除以 2。';
|
|
416
|
+
const result = canonicalize(input, ZH_CN);
|
|
417
|
+
const tokens = lex(result, ZH_CN);
|
|
418
|
+
assert.ok(findIdent(tokens, '除以'), '应识别「除以」标识符');
|
|
419
|
+
// Token 结构验证
|
|
420
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.INT), 2, '应有2个整数');
|
|
421
|
+
});
|
|
422
|
+
it('应正确词法分析复合算术表达式', () => {
|
|
423
|
+
const input = '(1 加 2) 乘 (10 除以 5)。';
|
|
424
|
+
const result = canonicalize(input, ZH_CN);
|
|
425
|
+
const tokens = lex(result, ZH_CN);
|
|
426
|
+
assert.strictEqual(countIdent(tokens, '加'), 1, '应有1个「加」');
|
|
427
|
+
assert.strictEqual(countIdent(tokens, '乘'), 1, '应有1个「乘」');
|
|
428
|
+
assert.strictEqual(countIdent(tokens, '除以'), 1, '应有1个「除以」');
|
|
429
|
+
// Token 结构验证
|
|
430
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.INT), 4, '应有4个整数');
|
|
431
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.LPAREN), 2, '应有2个左括号');
|
|
432
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.RPAREN), 2, '应有2个右括号');
|
|
433
|
+
});
|
|
434
|
+
// Codex Round 3 建议:新增 FLOAT 和 LONG 测试用例
|
|
435
|
+
it('应正确词法分析浮点数运算', () => {
|
|
436
|
+
const input = '1.5 加 2.5。';
|
|
437
|
+
const result = canonicalize(input, ZH_CN);
|
|
438
|
+
const tokens = lex(result, ZH_CN);
|
|
439
|
+
assert.ok(findIdent(tokens, '加'), '应识别「加」标识符');
|
|
440
|
+
// Token 结构验证:浮点数
|
|
441
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.FLOAT), 2, '应有2个浮点数');
|
|
442
|
+
// 验证无整数(避免误解析)
|
|
443
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.INT), 0, '不应有整数');
|
|
444
|
+
});
|
|
445
|
+
it('应正确词法分析全角数字浮点数运算', () => {
|
|
446
|
+
// 全角数字应被规范化为半角(注意:小数点为半角,全角句点未被规范化)
|
|
447
|
+
const input = '3.14 乘 2.0。';
|
|
448
|
+
const result = canonicalize(input, ZH_CN);
|
|
449
|
+
const tokens = lex(result, ZH_CN);
|
|
450
|
+
assert.ok(findIdent(tokens, '乘'), '应识别「乘」标识符');
|
|
451
|
+
// Token 结构验证:全角数字转半角后产生浮点数
|
|
452
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.FLOAT), 2, '应有2个浮点数');
|
|
453
|
+
// 验证规范化后的文本
|
|
454
|
+
assert.ok(result.includes('3.14'), '全角3.14应规范化为半角3.14');
|
|
455
|
+
});
|
|
456
|
+
it('应正确词法分析长整数运算(大写 L)', () => {
|
|
457
|
+
const input = '1000000000000L 加 500000000000L。';
|
|
458
|
+
const result = canonicalize(input, ZH_CN);
|
|
459
|
+
const tokens = lex(result, ZH_CN);
|
|
460
|
+
assert.ok(findIdent(tokens, '加'), '应识别「加」标识符');
|
|
461
|
+
// Token 结构验证:长整数
|
|
462
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.LONG), 2, '应有2个长整数');
|
|
463
|
+
// 验证无普通整数
|
|
464
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.INT), 0, '不应有普通整数');
|
|
465
|
+
});
|
|
466
|
+
// Codex Round 4 建议:补充小写 l 和全角 l 测试
|
|
467
|
+
it('应正确词法分析长整数运算(小写 l)', () => {
|
|
468
|
+
const input = '100l 减 50l。';
|
|
469
|
+
const result = canonicalize(input, ZH_CN);
|
|
470
|
+
const tokens = lex(result, ZH_CN);
|
|
471
|
+
assert.ok(findIdent(tokens, '减'), '应识别「减」标识符');
|
|
472
|
+
// Token 结构验证:小写 l 应被识别为长整数
|
|
473
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.LONG), 2, '应有2个长整数(小写l)');
|
|
474
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.INT), 0, '不应有普通整数');
|
|
475
|
+
});
|
|
476
|
+
it('应正确词法分析长整数运算(全角 l)', () => {
|
|
477
|
+
// 全角字母 l (U+FF4C) 应被规范化为半角 l
|
|
478
|
+
const input = '100l 乘 2l。';
|
|
479
|
+
const result = canonicalize(input, ZH_CN);
|
|
480
|
+
const tokens = lex(result, ZH_CN);
|
|
481
|
+
assert.ok(findIdent(tokens, '乘'), '应识别「乘」标识符');
|
|
482
|
+
// Token 结构验证:全角 l 应被规范化后识别为长整数
|
|
483
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.LONG), 2, '应有2个长整数(全角l转半角后)');
|
|
484
|
+
// Codex Round 5 建议:验证规范化输出(确保 canonicalizer 工作正常)
|
|
485
|
+
assert.ok(result.includes('100l'), '全角 100l 应规范化为半角 100l');
|
|
486
|
+
assert.ok(!result.includes('l'), '规范化后不应再含全角 l');
|
|
487
|
+
});
|
|
488
|
+
it('应正确词法分析混合数值类型表达式', () => {
|
|
489
|
+
const input = '(1 加 1.5) 乘 100L。';
|
|
490
|
+
const result = canonicalize(input, ZH_CN);
|
|
491
|
+
const tokens = lex(result, ZH_CN);
|
|
492
|
+
// Token 结构验证:三种数值类型共存
|
|
493
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.INT), 1, '应有1个整数');
|
|
494
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.FLOAT), 1, '应有1个浮点数');
|
|
495
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.LONG), 1, '应有1个长整数');
|
|
496
|
+
});
|
|
497
|
+
});
|
|
498
|
+
describe('中文循环语法', () => {
|
|
499
|
+
it('应正确词法分析「对每个/在」循环', () => {
|
|
500
|
+
const input = '对每个 项目 在 列表:\n 处理 项目。';
|
|
501
|
+
const result = canonicalize(input, ZH_CN);
|
|
502
|
+
const tokens = lex(result, ZH_CN);
|
|
503
|
+
assert.ok(findIdent(tokens, '对每个'), '应识别「对每个」标识符');
|
|
504
|
+
assert.ok(findIdent(tokens, '在'), '应识别「在」标识符');
|
|
505
|
+
// Token 结构验证(Codex 审查建议)
|
|
506
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.COLON), 1, '应有1个冒号');
|
|
507
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.DOT), 1, '应有1个句号');
|
|
508
|
+
});
|
|
509
|
+
it('应正确词法分析嵌套循环', () => {
|
|
510
|
+
const input = '对每个 行 在 表格:\n 对每个 列 在 行:\n 处理 列。';
|
|
511
|
+
const result = canonicalize(input, ZH_CN);
|
|
512
|
+
const tokens = lex(result, ZH_CN);
|
|
513
|
+
assert.strictEqual(countIdent(tokens, '对每个'), 2, '应有2个「对每个」');
|
|
514
|
+
assert.strictEqual(countIdent(tokens, '在'), 2, '应有2个「在」');
|
|
515
|
+
// Token 结构验证
|
|
516
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.COLON), 2, '应有2个冒号');
|
|
517
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.DOT), 1, '应有1个句号');
|
|
518
|
+
});
|
|
519
|
+
it('应正确词法分析带条件的循环', () => {
|
|
520
|
+
const input = '对每个 数字 在 数列:\n 若 数字 大于 0:\n 累加 数字。';
|
|
521
|
+
const result = canonicalize(input, ZH_CN);
|
|
522
|
+
const tokens = lex(result, ZH_CN);
|
|
523
|
+
assert.ok(findIdent(tokens, '对每个'), '应识别「对每个」标识符');
|
|
524
|
+
assert.ok(findIdent(tokens, '在'), '应识别「在」标识符');
|
|
525
|
+
assert.ok(findIdent(tokens, '若'), '应识别「若」标识符');
|
|
526
|
+
assert.ok(findIdent(tokens, '大于'), '应识别「大于」标识符');
|
|
527
|
+
// Token 结构验证
|
|
528
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.COLON), 2, '应有2个冒号(循环体+条件体)');
|
|
529
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.DOT), 1, '应有1个句号');
|
|
530
|
+
});
|
|
531
|
+
});
|
|
532
|
+
describe('中文工作流语法', () => {
|
|
533
|
+
it('应正确词法分析流程声明', () => {
|
|
534
|
+
const input = '【流程】订单处理:\n 【步骤】验证订单。\n 【步骤】处理支付。';
|
|
535
|
+
const result = canonicalize(input, ZH_CN);
|
|
536
|
+
const tokens = lex(result, ZH_CN);
|
|
537
|
+
// 【流程】和【步骤】被解析为 [ 流程 ] 和 [ 步骤 ]
|
|
538
|
+
assert.ok(findIdent(tokens, '流程'), '应识别「流程」标识符');
|
|
539
|
+
assert.strictEqual(countIdent(tokens, '步骤'), 2, '应有2个「步骤」');
|
|
540
|
+
// Token 结构验证(Codex 审查建议)
|
|
541
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.LBRACKET), 3, '应有3个左方括号');
|
|
542
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.RBRACKET), 3, '应有3个右方括号');
|
|
543
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.COLON), 1, '应有1个冒号');
|
|
544
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.DOT), 2, '应有2个句号');
|
|
545
|
+
});
|
|
546
|
+
it('应正确词法分析带依赖的步骤', () => {
|
|
547
|
+
const input = '【流程】构建:\n 【步骤】编译 依赖 于 下载。\n 【步骤】下载。';
|
|
548
|
+
const result = canonicalize(input, ZH_CN);
|
|
549
|
+
const tokens = lex(result, ZH_CN);
|
|
550
|
+
assert.ok(findIdent(tokens, '依赖'), '应识别「依赖」标识符');
|
|
551
|
+
assert.ok(findIdent(tokens, '于'), '应识别「于」标识符');
|
|
552
|
+
// Token 结构验证
|
|
553
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.LBRACKET), 3, '应有3个左方括号');
|
|
554
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.RBRACKET), 3, '应有3个右方括号');
|
|
555
|
+
});
|
|
556
|
+
it('应正确词法分析带补偿的步骤', () => {
|
|
557
|
+
const input = '【步骤】扣款 补偿 退款。';
|
|
558
|
+
const result = canonicalize(input, ZH_CN);
|
|
559
|
+
const tokens = lex(result, ZH_CN);
|
|
560
|
+
assert.ok(findIdent(tokens, '步骤'), '应识别「步骤」标识符');
|
|
561
|
+
assert.ok(findIdent(tokens, '补偿'), '应识别「补偿」标识符');
|
|
562
|
+
// Token 结构验证
|
|
563
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.LBRACKET), 1, '应有1个左方括号');
|
|
564
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.RBRACKET), 1, '应有1个右方括号');
|
|
565
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.DOT), 1, '应有1个句号');
|
|
566
|
+
});
|
|
567
|
+
it('应正确词法分析带重试策略的步骤', () => {
|
|
568
|
+
const input = '【步骤】调用服务 重试 最多尝试 3 退避 指数。';
|
|
569
|
+
const result = canonicalize(input, ZH_CN);
|
|
570
|
+
const tokens = lex(result, ZH_CN);
|
|
571
|
+
assert.ok(findIdent(tokens, '重试'), '应识别「重试」标识符');
|
|
572
|
+
assert.ok(findIdent(tokens, '最多尝试'), '应识别「最多尝试」标识符');
|
|
573
|
+
assert.ok(findIdent(tokens, '退避'), '应识别「退避」标识符');
|
|
574
|
+
// Token 结构验证
|
|
575
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.INT), 1, '应有1个整数(重试次数)');
|
|
576
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.LBRACKET), 1, '应有1个左方括号');
|
|
577
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.RBRACKET), 1, '应有1个右方括号');
|
|
578
|
+
});
|
|
579
|
+
it('应正确词法分析带超时的步骤', () => {
|
|
580
|
+
const input = '【步骤】长时间操作 超时 30。';
|
|
581
|
+
const result = canonicalize(input, ZH_CN);
|
|
582
|
+
const tokens = lex(result, ZH_CN);
|
|
583
|
+
assert.ok(findIdent(tokens, '超时'), '应识别「超时」标识符');
|
|
584
|
+
// Token 结构验证
|
|
585
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.INT), 1, '应有1个整数(超时值)');
|
|
586
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.LBRACKET), 1, '应有1个左方括号');
|
|
587
|
+
assert.strictEqual(countTokenKind(tokens, TokenKind.RBRACKET), 1, '应有1个右方括号');
|
|
588
|
+
});
|
|
589
|
+
});
|
|
590
|
+
describe('中文 CNL 完整语法', () => {
|
|
591
|
+
it('应正确词法分析模块声明', () => {
|
|
592
|
+
const input = '【模块】应用。';
|
|
593
|
+
const result = canonicalize(input, ZH_CN);
|
|
594
|
+
const tokens = lex(result, ZH_CN);
|
|
595
|
+
// 【模块】被解析为 [ 模块 ] 三个 token
|
|
596
|
+
const hasModule = tokens.some((t) => t.kind === TokenKind.IDENT && t.value === '模块');
|
|
597
|
+
const hasLBracket = tokens.some((t) => t.kind === TokenKind.LBRACKET);
|
|
598
|
+
const hasRBracket = tokens.some((t) => t.kind === TokenKind.RBRACKET);
|
|
599
|
+
assert.ok(hasModule, '应识别「模块」标识符');
|
|
600
|
+
assert.ok(hasLBracket, '应识别左方括号');
|
|
601
|
+
assert.ok(hasRBracket, '应识别右方括号');
|
|
602
|
+
});
|
|
603
|
+
it('应正确词法分析类型定义', () => {
|
|
604
|
+
const input = '【定义】用户 包含 编号:文本,名字:文本。';
|
|
605
|
+
const result = canonicalize(input, ZH_CN);
|
|
606
|
+
const tokens = lex(result, ZH_CN);
|
|
607
|
+
assert.ok(findIdent(tokens, '包含'), '应识别「包含」标识符');
|
|
608
|
+
assert.strictEqual(countIdent(tokens, '文本'), 2, '应有两个「文本」类型');
|
|
609
|
+
});
|
|
610
|
+
it('应正确词法分析函数定义', () => {
|
|
611
|
+
const input = '问候 入参 用户:用户,产出 文本:\n 返回 「你好」。';
|
|
612
|
+
const result = canonicalize(input, ZH_CN);
|
|
613
|
+
const tokens = lex(result, ZH_CN);
|
|
614
|
+
assert.ok(findIdent(tokens, '入参'), '应识别「入参」标识符');
|
|
615
|
+
assert.ok(findIdent(tokens, '产出'), '应识别「产出」标识符');
|
|
616
|
+
assert.ok(findIdent(tokens, '返回'), '应识别「返回」标识符');
|
|
617
|
+
});
|
|
618
|
+
it('应正确词法分析变量绑定', () => {
|
|
619
|
+
const input = '令 结果 为 计算(42)。';
|
|
620
|
+
const result = canonicalize(input, ZH_CN);
|
|
621
|
+
const tokens = lex(result, ZH_CN);
|
|
622
|
+
assert.ok(findIdent(tokens, '令'), '应识别「令」标识符');
|
|
623
|
+
assert.ok(findIdent(tokens, '为'), '应识别「为」标识符');
|
|
624
|
+
});
|
|
625
|
+
it('应正确词法分析完整中文程序', () => {
|
|
626
|
+
const program = `【模块】应用。
|
|
627
|
+
|
|
628
|
+
【定义】用户 包含 编号:文本,名字:文本。
|
|
629
|
+
|
|
630
|
+
问候 入参 用户:可选 用户,产出 文本:
|
|
631
|
+
把 用户 当:
|
|
632
|
+
当 空,返回 「你好,访客」。
|
|
633
|
+
当 用户(编号, 名字),返回 「欢迎,」加 名字。`;
|
|
634
|
+
const result = canonicalize(program, ZH_CN);
|
|
635
|
+
const tokens = lex(result, ZH_CN);
|
|
636
|
+
// 验证关键词精确出现次数(在 lexer 阶段为 IDENT)
|
|
637
|
+
// Codex 审查建议:使用精确断言替代宽松的 >= 判断
|
|
638
|
+
assert.strictEqual(countIdent(tokens, '包含'), 1, '应有1个「包含」');
|
|
639
|
+
assert.strictEqual(countIdent(tokens, '入参'), 1, '应有1个「入参」');
|
|
640
|
+
assert.strictEqual(countIdent(tokens, '产出'), 1, '应有1个「产出」');
|
|
641
|
+
assert.strictEqual(countIdent(tokens, '把'), 1, '应有1个「把」');
|
|
642
|
+
assert.strictEqual(countIdent(tokens, '当'), 3, '应有3个「当」(把...当 + 2个分支)');
|
|
643
|
+
assert.strictEqual(countIdent(tokens, '返回'), 2, '应有2个「返回」');
|
|
644
|
+
assert.strictEqual(countIdent(tokens, '可选'), 1, '应有1个「可选」');
|
|
645
|
+
});
|
|
646
|
+
});
|
|
647
|
+
describe('中英文对照验证', () => {
|
|
648
|
+
it('中英文程序应产生相似的 token 结构', () => {
|
|
649
|
+
// 英文程序(Codex Round 6 建议:添加数字字面量以验证 INT 统计)
|
|
650
|
+
const enProgram = `This module is app.
|
|
651
|
+
|
|
652
|
+
Define User with id: Text, name: Text, age: Int.
|
|
653
|
+
|
|
654
|
+
To greet with user: User?, produce Text:
|
|
655
|
+
Match user:
|
|
656
|
+
When null, Return "Hi, guest".
|
|
657
|
+
When User(id, name, 42), Return "Welcome, " plus name.`;
|
|
658
|
+
// 对应的中文程序(Codex Round 6 建议:添加数字字面量以验证 INT 统计)
|
|
659
|
+
const zhProgram = `【模块】应用。
|
|
660
|
+
|
|
661
|
+
【定义】用户 包含 编号:文本,名字:文本,年龄:整数。
|
|
662
|
+
|
|
663
|
+
问候 入参 用户:可选 用户,产出 文本:
|
|
664
|
+
把 用户 当:
|
|
665
|
+
当 空,返回 「你好,访客」。
|
|
666
|
+
当 用户(编号, 名字, 42),返回 「欢迎,」加 名字。`;
|
|
667
|
+
const enTokens = lex(canonicalize(enProgram, EN_US), EN_US);
|
|
668
|
+
const zhTokens = lex(canonicalize(zhProgram, ZH_CN), ZH_CN);
|
|
669
|
+
// 获取 token 类型分布(Codex 审查建议:拆分更多 Token 类型以细化比较)
|
|
670
|
+
const getTokenDistribution = (tokens) => ({
|
|
671
|
+
// 基础类型
|
|
672
|
+
ident: countTokenKind(tokens, TokenKind.IDENT),
|
|
673
|
+
typeIdent: countTokenKind(tokens, TokenKind.TYPE_IDENT),
|
|
674
|
+
string: countTokenKind(tokens, TokenKind.STRING),
|
|
675
|
+
number: countTokenKind(tokens, TokenKind.INT),
|
|
676
|
+
// 字面量类型
|
|
677
|
+
bool: countTokenKind(tokens, TokenKind.BOOL),
|
|
678
|
+
null: countTokenKind(tokens, TokenKind.NULL),
|
|
679
|
+
// 标点符号(拆分)
|
|
680
|
+
dot: countTokenKind(tokens, TokenKind.DOT),
|
|
681
|
+
colon: countTokenKind(tokens, TokenKind.COLON),
|
|
682
|
+
comma: countTokenKind(tokens, TokenKind.COMMA),
|
|
683
|
+
// 括号类型
|
|
684
|
+
lparen: countTokenKind(tokens, TokenKind.LPAREN),
|
|
685
|
+
rparen: countTokenKind(tokens, TokenKind.RPAREN),
|
|
686
|
+
lbracket: countTokenKind(tokens, TokenKind.LBRACKET),
|
|
687
|
+
rbracket: countTokenKind(tokens, TokenKind.RBRACKET),
|
|
688
|
+
});
|
|
689
|
+
const enDist = getTokenDistribution(enTokens);
|
|
690
|
+
const zhDist = getTokenDistribution(zhTokens);
|
|
691
|
+
// 验证标识符数量差异在容差范围内
|
|
692
|
+
// 使用文件级常量替代魔法值(Codex 审查建议)
|
|
693
|
+
assert.ok(Math.abs(zhDist.ident - enDist.ident) <= CROSS_LANG_IDENT_TOLERANCE, `中英文标识符数量应相近:中文${zhDist.ident}个,英文${enDist.ident}个(容差${CROSS_LANG_IDENT_TOLERANCE})`);
|
|
694
|
+
// 验证字符串数量相等(都有2个)
|
|
695
|
+
assert.strictEqual(zhDist.string, enDist.string, '中英文字符串数量应相等');
|
|
696
|
+
// 验证括号平衡(左右括号数量应相等)
|
|
697
|
+
assert.strictEqual(zhDist.lparen, zhDist.rparen, '中文左右圆括号应平衡');
|
|
698
|
+
assert.strictEqual(enDist.lparen, enDist.rparen, '英文左右圆括号应平衡');
|
|
699
|
+
// 验证字面量类型数量相等(语义等价)
|
|
700
|
+
assert.strictEqual(zhDist.bool, enDist.bool, '中英文布尔值数量应相等');
|
|
701
|
+
assert.strictEqual(zhDist.null, enDist.null, '中英文 null 数量应相等');
|
|
702
|
+
// Codex Round 3 建议:消费所有收集的分布字段
|
|
703
|
+
// 注意:TYPE_IDENT 是基于首字母大写来区分的,中文没有大小写,
|
|
704
|
+
// 因此所有中文标识符都是 IDENT。这是预期行为,我们验证英文有 TYPE_IDENT 而中文没有。
|
|
705
|
+
assert.ok(enDist.typeIdent > 0, '英文应有类型标识符(首字母大写)');
|
|
706
|
+
assert.strictEqual(zhDist.typeIdent, 0, '中文没有大小写区分,类型标识符应为0');
|
|
707
|
+
// 验证数值类型数量相等(INT 字面量)
|
|
708
|
+
// Codex Round 6 建议:确保数量非零,避免 0===0 恒真失去信号
|
|
709
|
+
assert.ok(zhDist.number > 0, '中文程序应有整数字面量(42)');
|
|
710
|
+
assert.ok(enDist.number > 0, '英文程序应有整数字面量(42)');
|
|
711
|
+
assert.strictEqual(zhDist.number, enDist.number, '中英文整数数量应相等');
|
|
712
|
+
// 验证标点符号数量相等(句号、冒号、逗号应语义等价)
|
|
713
|
+
assert.strictEqual(zhDist.dot, enDist.dot, '中英文句号数量应相等');
|
|
714
|
+
assert.strictEqual(zhDist.colon, enDist.colon, '中英文冒号数量应相等');
|
|
715
|
+
assert.strictEqual(zhDist.comma, enDist.comma, '中英文逗号数量应相等');
|
|
716
|
+
// 验证圆括号数量相等(函数调用等)
|
|
717
|
+
assert.strictEqual(zhDist.lparen, enDist.lparen, '中英文左圆括号数量应相等');
|
|
718
|
+
assert.strictEqual(zhDist.rparen, enDist.rparen, '中英文右圆括号数量应相等');
|
|
719
|
+
// Codex Round 4 & 5 建议:验证方括号(中文【】被解析为[])
|
|
720
|
+
// 中文使用【】标记增加了额外的方括号
|
|
721
|
+
assert.strictEqual(zhDist.lbracket, zhDist.rbracket, '中文左右方括号应平衡');
|
|
722
|
+
// Codex Round 5 建议:英文程序无方括号,应显式断言为 0
|
|
723
|
+
assert.strictEqual(enDist.lbracket, 0, '英文程序不含方括号,应为0');
|
|
724
|
+
assert.strictEqual(enDist.rbracket, 0, '英文程序不含方括号,应为0');
|
|
725
|
+
// 中文程序使用【定义】【模块】标记,有方括号
|
|
726
|
+
assert.ok(zhDist.lbracket > 0, '中文程序应有方括号(【】标记)');
|
|
727
|
+
});
|
|
728
|
+
it('若/if 和 否则/otherwise 应正确识别为标识符', () => {
|
|
729
|
+
const enTokens = lex(canonicalize('if true: return 1. otherwise: return 0.', EN_US), EN_US);
|
|
730
|
+
const zhTokens = lex(canonicalize('若 真:返回 1。否则:返回 0。', ZH_CN), ZH_CN);
|
|
731
|
+
// 英文验证(关键词在 lexer 阶段为 IDENT)
|
|
732
|
+
const hasEnIf = enTokens.some((t) => t.kind === TokenKind.IDENT && t.value === 'if');
|
|
733
|
+
const hasEnOtherwise = enTokens.some((t) => t.kind === TokenKind.IDENT && t.value === 'otherwise');
|
|
734
|
+
assert.ok(hasEnIf, '英文应有 if 标识符');
|
|
735
|
+
assert.ok(hasEnOtherwise, '英文应有 otherwise 标识符');
|
|
736
|
+
// 中文验证
|
|
737
|
+
const hasZhIf = zhTokens.some((t) => t.kind === TokenKind.IDENT && t.value === '若');
|
|
738
|
+
const hasZhOtherwise = zhTokens.some((t) => t.kind === TokenKind.IDENT && t.value === '否则');
|
|
739
|
+
assert.ok(hasZhIf, '中文应有 若 标识符');
|
|
740
|
+
assert.ok(hasZhOtherwise, '中文应有 否则 标识符');
|
|
741
|
+
});
|
|
742
|
+
it('中英文布尔值应正确识别', () => {
|
|
743
|
+
// 英文
|
|
744
|
+
const enTrueTokens = lex('true', EN_US);
|
|
745
|
+
const enFalseTokens = lex('false', EN_US);
|
|
746
|
+
assert.ok(enTrueTokens.some((t) => t.kind === TokenKind.BOOL && t.value === true));
|
|
747
|
+
assert.ok(enFalseTokens.some((t) => t.kind === TokenKind.BOOL && t.value === false));
|
|
748
|
+
// 中文
|
|
749
|
+
const zhTrueTokens = lex('真', ZH_CN);
|
|
750
|
+
const zhFalseTokens = lex('假', ZH_CN);
|
|
751
|
+
assert.ok(zhTrueTokens.some((t) => t.kind === TokenKind.BOOL && t.value === true));
|
|
752
|
+
assert.ok(zhFalseTokens.some((t) => t.kind === TokenKind.BOOL && t.value === false));
|
|
753
|
+
});
|
|
754
|
+
it('中英文 null 应正确识别', () => {
|
|
755
|
+
// 英文
|
|
756
|
+
const enNullTokens = lex('null', EN_US);
|
|
757
|
+
assert.ok(enNullTokens.some((t) => t.kind === TokenKind.NULL && t.value === null));
|
|
758
|
+
// 中文
|
|
759
|
+
const zhNullTokens = lex('空', ZH_CN);
|
|
760
|
+
assert.ok(zhNullTokens.some((t) => t.kind === TokenKind.NULL && t.value === null));
|
|
761
|
+
});
|
|
762
|
+
});
|
|
763
|
+
describe('LexiconRegistry 默认切换', () => {
|
|
764
|
+
// Codex 审查建议:使用 try/finally 确保状态复位,避免测试串扰
|
|
765
|
+
it('setDefault 应切换默认词法表', () => {
|
|
766
|
+
const originalDefault = LexiconRegistry.getDefault();
|
|
767
|
+
try {
|
|
768
|
+
// 切换到中文
|
|
769
|
+
LexiconRegistry.setDefault('zh-CN');
|
|
770
|
+
const zhDefault = LexiconRegistry.getDefault();
|
|
771
|
+
assert.strictEqual(zhDefault.id, 'zh-CN');
|
|
772
|
+
// 切换回英文
|
|
773
|
+
LexiconRegistry.setDefault('en-US');
|
|
774
|
+
const enDefault = LexiconRegistry.getDefault();
|
|
775
|
+
assert.strictEqual(enDefault.id, 'en-US');
|
|
776
|
+
}
|
|
777
|
+
finally {
|
|
778
|
+
// 无论断言成功与否都恢复原默认
|
|
779
|
+
LexiconRegistry.setDefault(originalDefault.id);
|
|
780
|
+
}
|
|
781
|
+
});
|
|
782
|
+
it('切换默认后 lex 应使用新默认', () => {
|
|
783
|
+
const originalDefault = LexiconRegistry.getDefault();
|
|
784
|
+
try {
|
|
785
|
+
// 切换到中文并测试中文布尔值
|
|
786
|
+
LexiconRegistry.setDefault('zh-CN');
|
|
787
|
+
const zhTokens = lex('真');
|
|
788
|
+
const zhBool = zhTokens.find((t) => t.kind === TokenKind.BOOL);
|
|
789
|
+
assert.ok(zhBool, '应识别中文布尔值');
|
|
790
|
+
assert.strictEqual(zhBool?.value, true);
|
|
791
|
+
}
|
|
792
|
+
finally {
|
|
793
|
+
// 无论断言成功与否都恢复原默认
|
|
794
|
+
LexiconRegistry.setDefault(originalDefault.id);
|
|
795
|
+
}
|
|
796
|
+
});
|
|
797
|
+
});
|
|
798
|
+
// ============================================================================
|
|
799
|
+
// 中文 CNL 文件解析测试
|
|
800
|
+
// ============================================================================
|
|
801
|
+
describe('中文 CNL 文件解析', () => {
|
|
802
|
+
// 使用项目根目录解析,因为 .aster 文件不会被编译到 dist
|
|
803
|
+
const zhCNDir = path.resolve(process.cwd(), 'test/cnl/programs/zh-CN');
|
|
804
|
+
/**
|
|
805
|
+
* 读取中文 CNL 文件并进行规范化和词法分析
|
|
806
|
+
*/
|
|
807
|
+
const parseZhCNFile = (filename) => {
|
|
808
|
+
const filePath = path.join(zhCNDir, filename);
|
|
809
|
+
const source = fs.readFileSync(filePath, 'utf-8');
|
|
810
|
+
const canonical = canonicalize(source, ZH_CN);
|
|
811
|
+
const tokens = lex(canonical, ZH_CN);
|
|
812
|
+
return { source, canonical, tokens };
|
|
813
|
+
};
|
|
814
|
+
it('hello.aster 应正确解析', () => {
|
|
815
|
+
const { tokens } = parseZhCNFile('hello.aster');
|
|
816
|
+
// 验证模块声明关键词(【模块】被分词为 LBRACKET + IDENT(模块) + RBRACKET)
|
|
817
|
+
assert.ok(findIdent(tokens, '模块'), '应有 模块 关键词');
|
|
818
|
+
// 验证方括号标记存在
|
|
819
|
+
assert.ok(tokens.some((t) => t.kind === TokenKind.LBRACKET), '应有【标记');
|
|
820
|
+
// 验证函数关键词
|
|
821
|
+
assert.ok(findIdent(tokens, '入参'), '应有 入参 关键词');
|
|
822
|
+
assert.ok(findIdent(tokens, '产出'), '应有 产出 关键词');
|
|
823
|
+
assert.ok(findIdent(tokens, '返回'), '应有 返回 关键词');
|
|
824
|
+
// 验证字符串
|
|
825
|
+
const stringTokens = tokens.filter((t) => t.kind === TokenKind.STRING);
|
|
826
|
+
assert.ok(stringTokens.length > 0, '应有字符串 token');
|
|
827
|
+
});
|
|
828
|
+
it('loan_decision.aster 应正确解析', () => {
|
|
829
|
+
const { tokens } = parseZhCNFile('loan_decision.aster');
|
|
830
|
+
// 验证类型定义关键词(【定义】被分词为 LBRACKET + IDENT(定义) + RBRACKET)
|
|
831
|
+
assert.ok(findIdent(tokens, '定义'), '应有 定义 关键词');
|
|
832
|
+
assert.ok(findIdent(tokens, '包含'), '应有 包含 关键词');
|
|
833
|
+
// 验证控制流关键词
|
|
834
|
+
assert.ok(findIdent(tokens, '若'), '应有 若 关键词');
|
|
835
|
+
assert.ok(findIdent(tokens, '返回'), '应有 返回 关键词');
|
|
836
|
+
// 验证变量绑定
|
|
837
|
+
assert.ok(findIdent(tokens, '令'), '应有 令 关键词');
|
|
838
|
+
assert.ok(findIdent(tokens, '为'), '应有 为 关键词');
|
|
839
|
+
// 验证布尔值
|
|
840
|
+
const boolTokens = tokens.filter((t) => t.kind === TokenKind.BOOL);
|
|
841
|
+
assert.ok(boolTokens.length >= 2, '应有多个布尔值(真/假)');
|
|
842
|
+
// 验证整数
|
|
843
|
+
const intTokens = tokens.filter((t) => t.kind === TokenKind.INT);
|
|
844
|
+
assert.ok(intTokens.length >= 2, '应有整数字面量(18, 100000)');
|
|
845
|
+
// Codex 审查建议:验证特殊标点 token
|
|
846
|
+
// 验证方括号标记(【定义】【模块】)
|
|
847
|
+
const lbracketCount = countTokenKind(tokens, TokenKind.LBRACKET);
|
|
848
|
+
const rbracketCount = countTokenKind(tokens, TokenKind.RBRACKET);
|
|
849
|
+
assert.ok(lbracketCount >= 2, '应有【标记(模块、定义)');
|
|
850
|
+
assert.strictEqual(lbracketCount, rbracketCount, '左右方括号应平衡');
|
|
851
|
+
// 验证中文冒号(类型声明和条件语句)
|
|
852
|
+
const colonCount = countTokenKind(tokens, TokenKind.COLON);
|
|
853
|
+
assert.ok(colonCount >= 5, '应有中文冒号(类型声明、条件语句)');
|
|
854
|
+
// 验证中文逗号(字段分隔和参数分隔)
|
|
855
|
+
const commaCount = countTokenKind(tokens, TokenKind.COMMA);
|
|
856
|
+
assert.ok(commaCount >= 3, '应有中文逗号(字段分隔、参数分隔)');
|
|
857
|
+
// 验证直角引号字符串(「」)
|
|
858
|
+
const stringTokens = tokens.filter((t) => t.kind === TokenKind.STRING);
|
|
859
|
+
assert.ok(stringTokens.length >= 3, '应有字符串(「申请人未满18岁」等)');
|
|
860
|
+
});
|
|
861
|
+
it('user_greeting.aster 应正确解析', () => {
|
|
862
|
+
const { tokens } = parseZhCNFile('user_greeting.aster');
|
|
863
|
+
// 验证模式匹配关键词
|
|
864
|
+
assert.ok(findIdent(tokens, '把'), '应有 把 关键词');
|
|
865
|
+
assert.ok(findIdent(tokens, '当'), '应有 当 关键词');
|
|
866
|
+
// 可选类型已改为推断,应不再显式出现
|
|
867
|
+
assert.ok(!findIdent(tokens, '可选'), '不应显式出现 可选 关键词');
|
|
868
|
+
// 验证 null 值
|
|
869
|
+
const nullTokens = tokens.filter((t) => t.kind === TokenKind.NULL);
|
|
870
|
+
assert.ok(nullTokens.length > 0, '应有 空 token');
|
|
871
|
+
});
|
|
872
|
+
it('arithmetic.aster 应正确解析', () => {
|
|
873
|
+
const { tokens } = parseZhCNFile('arithmetic.aster');
|
|
874
|
+
// 验证算术运算关键词
|
|
875
|
+
assert.ok(findIdent(tokens, '加'), '应有 加 关键词');
|
|
876
|
+
assert.ok(findIdent(tokens, '减'), '应有 减 关键词');
|
|
877
|
+
assert.ok(findIdent(tokens, '乘'), '应有 乘 关键词');
|
|
878
|
+
assert.ok(findIdent(tokens, '除以'), '应有 除以 关键词');
|
|
879
|
+
// 验证变量绑定
|
|
880
|
+
const letCount = countIdent(tokens, '令');
|
|
881
|
+
const beCount = countIdent(tokens, '为');
|
|
882
|
+
assert.ok(letCount >= 2, '应有多个 令 关键词');
|
|
883
|
+
assert.ok(beCount >= 2, '应有多个 为 关键词');
|
|
884
|
+
});
|
|
885
|
+
it('所有中文 CNL 文件应成功规范化', () => {
|
|
886
|
+
const files = fs.readdirSync(zhCNDir).filter((f) => f.endsWith('.aster'));
|
|
887
|
+
assert.ok(files.length >= 4, '应有至少 4 个 .aster 文件');
|
|
888
|
+
for (const file of files) {
|
|
889
|
+
const { canonical } = parseZhCNFile(file);
|
|
890
|
+
// 验证规范化后不包含智能引号
|
|
891
|
+
assert.ok(!canonical.includes('"'), `${file} 不应包含左智能引号`);
|
|
892
|
+
assert.ok(!canonical.includes('"'), `${file} 不应包含右智能引号`);
|
|
893
|
+
// 验证规范化后包含中文标点
|
|
894
|
+
assert.ok(canonical.includes('。'), `${file} 应包含中文句号`);
|
|
895
|
+
}
|
|
896
|
+
});
|
|
897
|
+
it('中文 CNL 文件的 token 分布应合理', () => {
|
|
898
|
+
const { tokens: helloTokens } = parseZhCNFile('hello.aster');
|
|
899
|
+
const { tokens: loanTokens } = parseZhCNFile('loan_decision.aster');
|
|
900
|
+
// hello.aster 应较短(Codex 审查建议:使用相对比较替代硬编码阈值)
|
|
901
|
+
const helloNonEof = helloTokens.filter((t) => t.kind !== TokenKind.EOF);
|
|
902
|
+
const loanNonEof = loanTokens.filter((t) => t.kind !== TokenKind.EOF);
|
|
903
|
+
// 结构化验证:loan_decision 应比 hello 复杂(至少 2 倍 token 数量)
|
|
904
|
+
assert.ok(loanNonEof.length > helloNonEof.length * 2, `loan_decision(${loanNonEof.length} tokens)应比hello(${helloNonEof.length} tokens)复杂至少2倍`);
|
|
905
|
+
// 验证左右括号平衡
|
|
906
|
+
const helloLparen = countTokenKind(helloTokens, TokenKind.LPAREN);
|
|
907
|
+
const helloRparen = countTokenKind(helloTokens, TokenKind.RPAREN);
|
|
908
|
+
assert.strictEqual(helloLparen, helloRparen, 'hello程序的左右圆括号应平衡');
|
|
909
|
+
const loanLparen = countTokenKind(loanTokens, TokenKind.LPAREN);
|
|
910
|
+
const loanRparen = countTokenKind(loanTokens, TokenKind.RPAREN);
|
|
911
|
+
assert.strictEqual(loanLparen, loanRparen, '贷款程序的左右圆括号应平衡');
|
|
912
|
+
const loanLbracket = countTokenKind(loanTokens, TokenKind.LBRACKET);
|
|
913
|
+
const loanRbracket = countTokenKind(loanTokens, TokenKind.RBRACKET);
|
|
914
|
+
assert.strictEqual(loanLbracket, loanRbracket, '贷款程序的左右方括号应平衡');
|
|
915
|
+
// 验证 hello.aster 结构完整性
|
|
916
|
+
const helloLbracket = countTokenKind(helloTokens, TokenKind.LBRACKET);
|
|
917
|
+
const helloRbracket = countTokenKind(helloTokens, TokenKind.RBRACKET);
|
|
918
|
+
assert.strictEqual(helloLbracket, helloRbracket, 'hello程序的左右方括号应平衡');
|
|
919
|
+
});
|
|
920
|
+
});
|
|
921
|
+
});
|
|
922
|
+
//# sourceMappingURL=zh-CN.test.js.map
|