@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,1117 @@
|
|
|
1
|
+
import { describe, test, it } from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { canonicalize } from '../../../src/frontend/canonicalizer.js';
|
|
4
|
+
import { lex } from '../../../src/frontend/lexer.js';
|
|
5
|
+
import { parse } from '../../../src/parser.js';
|
|
6
|
+
import { CapabilityKind } from '../../../src/config/semantic.js';
|
|
7
|
+
function parseSource(source) {
|
|
8
|
+
const canonical = canonicalize(source);
|
|
9
|
+
const tokens = lex(canonical);
|
|
10
|
+
return parse(tokens);
|
|
11
|
+
}
|
|
12
|
+
function findDecl(module, kind) {
|
|
13
|
+
const decl = module.decls.find((candidate) => candidate.kind === kind);
|
|
14
|
+
assert.ok(decl, `应该找到 ${kind} 声明`);
|
|
15
|
+
return decl;
|
|
16
|
+
}
|
|
17
|
+
function findFunc(module, name) {
|
|
18
|
+
const func = module.decls.find((decl) => decl.kind === 'Func' && decl.name === name);
|
|
19
|
+
assert.ok(func, `应该找到函数 ${name}`);
|
|
20
|
+
return func;
|
|
21
|
+
}
|
|
22
|
+
describe('语法分析器', () => {
|
|
23
|
+
test('应该解析模块名称', () => {
|
|
24
|
+
const module = parseSource(`
|
|
25
|
+
This module is test.parser.module_name.
|
|
26
|
+
|
|
27
|
+
To ping, produce Text:
|
|
28
|
+
Return "pong".
|
|
29
|
+
`);
|
|
30
|
+
assert.equal(module.name, 'test.parser.module_name');
|
|
31
|
+
});
|
|
32
|
+
test('应该解析数据类型字段', () => {
|
|
33
|
+
const module = parseSource(`
|
|
34
|
+
This module is test.parser.data_decl.
|
|
35
|
+
|
|
36
|
+
Define User with id: Text, name: Text, age: Int.
|
|
37
|
+
`);
|
|
38
|
+
const data = findDecl(module, 'Data');
|
|
39
|
+
assert.equal(data.fields.length, 3);
|
|
40
|
+
assert.equal(data.fields[0].name, 'id');
|
|
41
|
+
assert.equal(data.fields[0].type.kind, 'TypeName');
|
|
42
|
+
assert.equal(data.fields[2].type.kind, 'TypeName');
|
|
43
|
+
});
|
|
44
|
+
test('应该解析枚举变体列表', () => {
|
|
45
|
+
const module = parseSource(`
|
|
46
|
+
This module is test.parser.enum_decl.
|
|
47
|
+
|
|
48
|
+
Define Status as one of Pending, Success, Failure.
|
|
49
|
+
`);
|
|
50
|
+
const en = findDecl(module, 'Enum');
|
|
51
|
+
assert.deepEqual(en.variants, ['Pending', 'Success', 'Failure']);
|
|
52
|
+
});
|
|
53
|
+
test('应该解析函数的参数与返回类型', () => {
|
|
54
|
+
const module = parseSource(`
|
|
55
|
+
This module is test.parser.func_signature.
|
|
56
|
+
|
|
57
|
+
To format with name: Text and times: Int, produce Text:
|
|
58
|
+
Return Text.concat(name, Text.toString(times)).
|
|
59
|
+
`);
|
|
60
|
+
const func = findDecl(module, 'Func');
|
|
61
|
+
assert.equal(func.name, 'format');
|
|
62
|
+
assert.equal(func.params.length, 2);
|
|
63
|
+
assert.equal(func.params[0].name, 'name');
|
|
64
|
+
assert.equal(func.retType.kind, 'TypeName');
|
|
65
|
+
});
|
|
66
|
+
test('应该解析函数体中的 Return 语句', () => {
|
|
67
|
+
const module = parseSource(`
|
|
68
|
+
This module is test.parser.return_stmt.
|
|
69
|
+
|
|
70
|
+
To identity with value: Text, produce Text:
|
|
71
|
+
Return value.
|
|
72
|
+
`);
|
|
73
|
+
const func = findDecl(module, 'Func');
|
|
74
|
+
const statements = func.body?.statements ?? [];
|
|
75
|
+
assert.equal(statements.length, 1);
|
|
76
|
+
assert.equal(statements[0].kind, 'Return');
|
|
77
|
+
});
|
|
78
|
+
test('应该解析 Let 语句并构建调用表达式', () => {
|
|
79
|
+
const module = parseSource(`
|
|
80
|
+
This module is test.parser.let_stmt.
|
|
81
|
+
|
|
82
|
+
To greet with name: Text, produce Text:
|
|
83
|
+
Let trimmed be Text.trim(name).
|
|
84
|
+
Return Text.concat("Hi, ", trimmed).
|
|
85
|
+
`);
|
|
86
|
+
const func = findDecl(module, 'Func');
|
|
87
|
+
const letStmt = func.body?.statements[0];
|
|
88
|
+
assert.equal(letStmt.kind, 'Let');
|
|
89
|
+
assert.equal(letStmt.name, 'trimmed');
|
|
90
|
+
assert.equal(letStmt.expr.kind, 'Call');
|
|
91
|
+
});
|
|
92
|
+
test('应该解析 If 语句并生成 then/else 分支', () => {
|
|
93
|
+
const module = parseSource(`
|
|
94
|
+
This module is test.parser.if_stmt.
|
|
95
|
+
|
|
96
|
+
To classify with score: Int, produce Text:
|
|
97
|
+
If score at least 800:
|
|
98
|
+
Return "Top".
|
|
99
|
+
Otherwise:
|
|
100
|
+
Return "Regular".
|
|
101
|
+
`);
|
|
102
|
+
const func = findDecl(module, 'Func');
|
|
103
|
+
const statements = func.body?.statements ?? [];
|
|
104
|
+
const ifStmt = statements.find((statement) => statement.kind === 'If');
|
|
105
|
+
assert.ok(ifStmt, '应该找到 If 语句');
|
|
106
|
+
assert.equal(ifStmt.thenBlock.statements[0].kind, 'Return');
|
|
107
|
+
assert.equal(ifStmt.elseBlock?.statements[0].kind, 'Return');
|
|
108
|
+
});
|
|
109
|
+
test('应该解析 Match 表达式及其分支', () => {
|
|
110
|
+
const module = parseSource(`
|
|
111
|
+
This module is test.parser.match_stmt.
|
|
112
|
+
|
|
113
|
+
Define User with id: Text, name: Text.
|
|
114
|
+
|
|
115
|
+
To welcome with user: User?, produce Text:
|
|
116
|
+
Match user:
|
|
117
|
+
When null, Return "Guest".
|
|
118
|
+
When User(id, name), Return Text.concat("Hi ", name).
|
|
119
|
+
`);
|
|
120
|
+
const func = findDecl(module, 'Func');
|
|
121
|
+
const matchStmt = func.body?.statements[0];
|
|
122
|
+
assert.equal(matchStmt.kind, 'Match');
|
|
123
|
+
const matchExpr = matchStmt;
|
|
124
|
+
assert.equal(matchExpr.cases.length, 2);
|
|
125
|
+
assert.equal(matchExpr.cases[1].pattern.kind, 'PatternCtor');
|
|
126
|
+
});
|
|
127
|
+
test('应该解析 Start/Wait 异步语句', () => {
|
|
128
|
+
const module = parseSource(`
|
|
129
|
+
This module is test.parser.async_stmt.
|
|
130
|
+
|
|
131
|
+
To runTasks, produce Text. It performs io:
|
|
132
|
+
Start task as async fetch().
|
|
133
|
+
Wait for task.
|
|
134
|
+
Return "done".
|
|
135
|
+
|
|
136
|
+
To fetch, produce Text:
|
|
137
|
+
Return "ok".
|
|
138
|
+
`);
|
|
139
|
+
const func = findDecl(module, 'Func');
|
|
140
|
+
const statements = func.body?.statements ?? [];
|
|
141
|
+
assert.equal(statements[0].kind, 'Start');
|
|
142
|
+
assert.equal(statements[1].kind, 'Wait');
|
|
143
|
+
});
|
|
144
|
+
test('应该在语法错误时抛出诊断', () => {
|
|
145
|
+
assert.throws(() => parseSource(`
|
|
146
|
+
This module is test.parser.error.
|
|
147
|
+
|
|
148
|
+
Define Broken with x: Int
|
|
149
|
+
`), /expected '.'/i);
|
|
150
|
+
});
|
|
151
|
+
describe('边界场景', () => {
|
|
152
|
+
it('应该解析 import 别名并保持调用目标一致', () => {
|
|
153
|
+
const module = parseSource(`
|
|
154
|
+
This module is test.parser.import_alias.
|
|
155
|
+
|
|
156
|
+
Use Http as H.
|
|
157
|
+
|
|
158
|
+
To call, produce Text:
|
|
159
|
+
Return H.get().
|
|
160
|
+
`);
|
|
161
|
+
const importDecl = findDecl(module, 'Import');
|
|
162
|
+
assert.equal(importDecl.name, 'Http');
|
|
163
|
+
assert.equal(importDecl.asName, 'H');
|
|
164
|
+
const func = findFunc(module, 'call');
|
|
165
|
+
assert.ok(func.body, '函数体不能为空');
|
|
166
|
+
if (!func.body) {
|
|
167
|
+
assert.fail('缺少函数体');
|
|
168
|
+
}
|
|
169
|
+
const statement = func.body.statements[0];
|
|
170
|
+
assert.ok(statement, '应该存在函数体语句');
|
|
171
|
+
if (!statement || statement.kind !== 'Return') {
|
|
172
|
+
assert.fail('第一条语句应为 Return');
|
|
173
|
+
}
|
|
174
|
+
const callExpr = statement.expr;
|
|
175
|
+
if (callExpr.kind !== 'Call') {
|
|
176
|
+
assert.fail('Return 表达式应为函数调用');
|
|
177
|
+
}
|
|
178
|
+
assert.equal(callExpr.target.kind, 'Name');
|
|
179
|
+
assert.equal(callExpr.target.name, 'H.get');
|
|
180
|
+
});
|
|
181
|
+
it('应该解析空效果列表与多基础效果组合', () => {
|
|
182
|
+
const module = parseSource(`
|
|
183
|
+
This module is test.parser.effects_basic.
|
|
184
|
+
|
|
185
|
+
To audit, produce Int. It performs [].
|
|
186
|
+
|
|
187
|
+
To compute with value: Int, produce Int. It performs io and cpu.
|
|
188
|
+
`);
|
|
189
|
+
const audit = findFunc(module, 'audit');
|
|
190
|
+
assert.deepEqual(audit.effects, []);
|
|
191
|
+
assert.equal(audit.effectCaps.length, 0);
|
|
192
|
+
assert.equal(audit.effectCapsExplicit, false);
|
|
193
|
+
const compute = findFunc(module, 'compute');
|
|
194
|
+
assert.deepEqual(compute.effects, ['io', 'cpu']);
|
|
195
|
+
assert.deepEqual(compute.effectCaps, [
|
|
196
|
+
CapabilityKind.HTTP,
|
|
197
|
+
CapabilityKind.SQL,
|
|
198
|
+
CapabilityKind.TIME,
|
|
199
|
+
CapabilityKind.FILES,
|
|
200
|
+
CapabilityKind.SECRETS,
|
|
201
|
+
CapabilityKind.AI_MODEL,
|
|
202
|
+
CapabilityKind.CPU,
|
|
203
|
+
]);
|
|
204
|
+
assert.equal(compute.effectCapsExplicit, false);
|
|
205
|
+
});
|
|
206
|
+
it('应该解析显式 capability 列表并保留效果体', () => {
|
|
207
|
+
const module = parseSource(`
|
|
208
|
+
This module is test.parser.effects_explicit.
|
|
209
|
+
|
|
210
|
+
To fetch, produce Text. It performs io with Http and Sql:
|
|
211
|
+
Return "ok".
|
|
212
|
+
`);
|
|
213
|
+
const func = findFunc(module, 'fetch');
|
|
214
|
+
assert.deepEqual(func.effects, ['io']);
|
|
215
|
+
assert.deepEqual(func.effectCaps, [CapabilityKind.HTTP, CapabilityKind.SQL]);
|
|
216
|
+
assert.equal(func.effectCapsExplicit, true);
|
|
217
|
+
assert.ok(func.body, '显式 capability 应允许生成函数体');
|
|
218
|
+
});
|
|
219
|
+
it('应该解析 CNL 约束并保留参数信息', () => {
|
|
220
|
+
const module = parseSource(`
|
|
221
|
+
This module is test.parser.constraints.
|
|
222
|
+
|
|
223
|
+
Define User with
|
|
224
|
+
id: Text required,
|
|
225
|
+
age: Int between 0 and 120 matching "^[0-9]+$".
|
|
226
|
+
|
|
227
|
+
To validate with input: Text required, produce Bool:
|
|
228
|
+
Return true.
|
|
229
|
+
`);
|
|
230
|
+
const data = findDecl(module, 'Data');
|
|
231
|
+
const idField = data.fields[0];
|
|
232
|
+
assert.ok(idField, '应该存在第一个字段');
|
|
233
|
+
if (!idField) {
|
|
234
|
+
assert.fail('缺少第一个字段');
|
|
235
|
+
}
|
|
236
|
+
assert.ok(idField.constraints && idField.constraints.length === 1);
|
|
237
|
+
assert.equal(idField.constraints[0].kind, 'Required');
|
|
238
|
+
const ageField = data.fields[1];
|
|
239
|
+
assert.ok(ageField, '应该存在第二个字段');
|
|
240
|
+
if (!ageField) {
|
|
241
|
+
assert.fail('缺少第二个字段');
|
|
242
|
+
}
|
|
243
|
+
assert.ok(ageField.constraints && ageField.constraints.length === 2);
|
|
244
|
+
assert.deepEqual(ageField.constraints.map(c => c.kind), ['Range', 'Pattern']);
|
|
245
|
+
const rangeConstraint = ageField.constraints[0];
|
|
246
|
+
const patternConstraint = ageField.constraints[1];
|
|
247
|
+
assert.equal(rangeConstraint.kind, 'Range');
|
|
248
|
+
if (rangeConstraint.kind === 'Range') {
|
|
249
|
+
assert.equal(rangeConstraint.min, 0);
|
|
250
|
+
assert.equal(rangeConstraint.max, 120);
|
|
251
|
+
}
|
|
252
|
+
if (patternConstraint.kind === 'Pattern') {
|
|
253
|
+
assert.equal(patternConstraint.regexp, '^[0-9]+$');
|
|
254
|
+
}
|
|
255
|
+
const func = findFunc(module, 'validate');
|
|
256
|
+
const param = func.params[0];
|
|
257
|
+
assert.ok(param, '函数参数应该存在');
|
|
258
|
+
if (!param) {
|
|
259
|
+
assert.fail('缺少函数参数');
|
|
260
|
+
}
|
|
261
|
+
assert.ok(param.constraints && param.constraints.length === 1);
|
|
262
|
+
assert.equal(param.constraints[0].kind, 'Required');
|
|
263
|
+
});
|
|
264
|
+
it('应该在缺失参数分隔符时报告诊断', () => {
|
|
265
|
+
assert.throws(() => parseSource(`
|
|
266
|
+
This module is test.parser.error.missing_separator.
|
|
267
|
+
|
|
268
|
+
To broken with first: Int second: Int, produce Int:
|
|
269
|
+
Return first.
|
|
270
|
+
`), error => {
|
|
271
|
+
assert.match(String(error), /Expected 'produce' and return type/i);
|
|
272
|
+
return true;
|
|
273
|
+
});
|
|
274
|
+
});
|
|
275
|
+
it('应该在括号不匹配时报告诊断', () => {
|
|
276
|
+
assert.throws(() => parseSource(`
|
|
277
|
+
This module is test.parser.error.parentheses.
|
|
278
|
+
|
|
279
|
+
To fail with value: Text, produce Text:
|
|
280
|
+
Return (value.
|
|
281
|
+
`), error => {
|
|
282
|
+
assert.ok(String(error).includes("Expected ')' after expression"), '诊断信息应该指出括号缺失');
|
|
283
|
+
return true;
|
|
284
|
+
});
|
|
285
|
+
});
|
|
286
|
+
});
|
|
287
|
+
describe('函数类型参数解析', () => {
|
|
288
|
+
test('应该解析单一显式类型参数并绑定到参数类型', () => {
|
|
289
|
+
const module = parseSource(`
|
|
290
|
+
This module is test.parser.func_type_params.single.
|
|
291
|
+
|
|
292
|
+
To wrap of T with value: T, produce List of T:
|
|
293
|
+
Return List.build(value).
|
|
294
|
+
`);
|
|
295
|
+
const func = findFunc(module, 'wrap');
|
|
296
|
+
assert.deepEqual(func.typeParams, ['T']);
|
|
297
|
+
const param = func.params[0];
|
|
298
|
+
assert.ok(param, '应该存在第一个参数');
|
|
299
|
+
if (!param) {
|
|
300
|
+
assert.fail('缺少第一个参数');
|
|
301
|
+
}
|
|
302
|
+
assert.equal(param.type.kind, 'TypeVar');
|
|
303
|
+
assert.equal(param.type.name, 'T');
|
|
304
|
+
if (func.retType.kind !== 'List') {
|
|
305
|
+
assert.fail('返回类型应该是 List');
|
|
306
|
+
}
|
|
307
|
+
assert.equal(func.retType.type.kind, 'TypeVar');
|
|
308
|
+
assert.equal(func.retType.type.name, 'T');
|
|
309
|
+
});
|
|
310
|
+
test('应该解析多个显式类型参数并保持顺序', () => {
|
|
311
|
+
const module = parseSource(`
|
|
312
|
+
This module is test.parser.func_type_params.multi.
|
|
313
|
+
|
|
314
|
+
To pair of Left and Right with left: Left and right: Right, produce Result of Left or Right:
|
|
315
|
+
Return Result.ok(left).
|
|
316
|
+
`);
|
|
317
|
+
const func = findFunc(module, 'pair');
|
|
318
|
+
assert.deepEqual(func.typeParams, ['Left', 'Right']);
|
|
319
|
+
assert.equal(func.params.length, 2);
|
|
320
|
+
const [leftParam, rightParam] = func.params;
|
|
321
|
+
assert.ok(leftParam, '应该存在第一个参数');
|
|
322
|
+
assert.ok(rightParam, '应该存在第二个参数');
|
|
323
|
+
if (!leftParam || !rightParam) {
|
|
324
|
+
assert.fail('缺少函数参数');
|
|
325
|
+
}
|
|
326
|
+
assert.equal(leftParam.type.kind, 'TypeVar');
|
|
327
|
+
assert.equal(leftParam.type.name, 'Left');
|
|
328
|
+
assert.equal(rightParam.type.kind, 'TypeVar');
|
|
329
|
+
assert.equal(rightParam.type.name, 'Right');
|
|
330
|
+
if (func.retType.kind !== 'Result') {
|
|
331
|
+
assert.fail('返回类型应该是 Result');
|
|
332
|
+
}
|
|
333
|
+
assert.equal(func.retType.ok.kind, 'TypeVar');
|
|
334
|
+
assert.equal(func.retType.ok.name, 'Left');
|
|
335
|
+
assert.equal(func.retType.err.kind, 'TypeVar');
|
|
336
|
+
assert.equal(func.retType.err.name, 'Right');
|
|
337
|
+
});
|
|
338
|
+
test('应该支持逗号与 and 混合的类型参数列表', () => {
|
|
339
|
+
const module = parseSource(`
|
|
340
|
+
This module is test.parser.func_type_params.mixed.
|
|
341
|
+
|
|
342
|
+
To compose of Input, Middle and Output with first: Input, second: Middle, produce Output:
|
|
343
|
+
Return second.
|
|
344
|
+
`);
|
|
345
|
+
const func = findFunc(module, 'compose');
|
|
346
|
+
assert.deepEqual(func.typeParams, ['Input', 'Middle', 'Output']);
|
|
347
|
+
const firstParam = func.params[0];
|
|
348
|
+
assert.ok(firstParam, '应该存在第一个参数');
|
|
349
|
+
if (!firstParam) {
|
|
350
|
+
assert.fail('缺少第一个参数');
|
|
351
|
+
}
|
|
352
|
+
assert.equal(firstParam.type.kind, 'TypeVar');
|
|
353
|
+
assert.equal(firstParam.type.name, 'Input');
|
|
354
|
+
});
|
|
355
|
+
test('应该允许类型参数参与复杂返回类型', () => {
|
|
356
|
+
const module = parseSource(`
|
|
357
|
+
This module is test.parser.func_type_params.complex.
|
|
358
|
+
|
|
359
|
+
To pipeline of Source and Target with items: List of Source, produce Result of Map Source to Target or Text:
|
|
360
|
+
Return Result.err("empty").
|
|
361
|
+
`);
|
|
362
|
+
const func = findFunc(module, 'pipeline');
|
|
363
|
+
assert.deepEqual(func.typeParams, ['Source', 'Target']);
|
|
364
|
+
const param = func.params[0];
|
|
365
|
+
assert.ok(param, '应该存在 items 参数');
|
|
366
|
+
if (!param) {
|
|
367
|
+
assert.fail('缺少 items 参数');
|
|
368
|
+
}
|
|
369
|
+
if (param.type.kind !== 'List') {
|
|
370
|
+
assert.fail('参数类型应该是 List');
|
|
371
|
+
}
|
|
372
|
+
assert.equal(param.type.type.kind, 'TypeVar');
|
|
373
|
+
assert.equal(param.type.type.name, 'Source');
|
|
374
|
+
if (func.retType.kind !== 'Result') {
|
|
375
|
+
assert.fail('返回类型应该是 Result');
|
|
376
|
+
}
|
|
377
|
+
const okType = func.retType.ok;
|
|
378
|
+
if (okType.kind !== 'Map') {
|
|
379
|
+
assert.fail('Result 成功分支应该是 Map');
|
|
380
|
+
}
|
|
381
|
+
assert.equal(okType.key.kind, 'TypeVar');
|
|
382
|
+
assert.equal(okType.key.name, 'Source');
|
|
383
|
+
assert.equal(okType.val.kind, 'TypeVar');
|
|
384
|
+
assert.equal(okType.val.name, 'Target');
|
|
385
|
+
assert.equal(func.retType.err.kind, 'TypeName');
|
|
386
|
+
assert.equal(func.retType.err.name, 'Text');
|
|
387
|
+
});
|
|
388
|
+
});
|
|
389
|
+
describe('多行参数列表与缩进', () => {
|
|
390
|
+
test('应该解析 with 子句的多行参数', () => {
|
|
391
|
+
const module = parseSource(`
|
|
392
|
+
This module is test.parser.params.multiline_with.
|
|
393
|
+
|
|
394
|
+
To summarize with
|
|
395
|
+
first: Text,
|
|
396
|
+
second: Text,
|
|
397
|
+
third: Text, produce Text:
|
|
398
|
+
Return Text.concat(first, second).
|
|
399
|
+
`);
|
|
400
|
+
const func = findFunc(module, 'summarize');
|
|
401
|
+
assert.equal(func.params.length, 3);
|
|
402
|
+
assert.deepEqual(func.params.map(param => param.name), ['first', 'second', 'third']);
|
|
403
|
+
});
|
|
404
|
+
test('应该在多行参数后继续解析效果声明', () => {
|
|
405
|
+
const module = parseSource(`
|
|
406
|
+
This module is test.parser.params.multiline_effect.
|
|
407
|
+
|
|
408
|
+
To compute with
|
|
409
|
+
value: Int,
|
|
410
|
+
factor: Int, produce Int. It performs cpu:
|
|
411
|
+
Return value times factor.
|
|
412
|
+
`);
|
|
413
|
+
const func = findFunc(module, 'compute');
|
|
414
|
+
assert.equal(func.params.length, 2);
|
|
415
|
+
assert.deepEqual(func.params.map(param => param.name), ['value', 'factor']);
|
|
416
|
+
assert.deepEqual(func.effects, ['cpu']);
|
|
417
|
+
});
|
|
418
|
+
test('应该在多行参数中保留约束', () => {
|
|
419
|
+
const module = parseSource(`
|
|
420
|
+
This module is test.parser.params.multiline_constraints.
|
|
421
|
+
|
|
422
|
+
To filter with
|
|
423
|
+
query: Text required,
|
|
424
|
+
limit: Int, produce List of Text:
|
|
425
|
+
Return List.empty().
|
|
426
|
+
`);
|
|
427
|
+
const func = findFunc(module, 'filter');
|
|
428
|
+
assert.equal(func.params.length, 2);
|
|
429
|
+
const queryParam = func.params[0];
|
|
430
|
+
assert.ok(queryParam, '应该存在 query 参数');
|
|
431
|
+
if (!queryParam) {
|
|
432
|
+
assert.fail('缺少 query 参数');
|
|
433
|
+
}
|
|
434
|
+
assert.ok(queryParam.constraints && queryParam.constraints.length === 1);
|
|
435
|
+
assert.equal(queryParam.constraints[0].kind, 'Required');
|
|
436
|
+
});
|
|
437
|
+
});
|
|
438
|
+
describe('Let 内联 lambda 解析', () => {
|
|
439
|
+
test('应该将内联函数解析为 Lambda 节点', () => {
|
|
440
|
+
const module = parseSource(`
|
|
441
|
+
This module is test.parser.let.lambda.basic.
|
|
442
|
+
|
|
443
|
+
To operate with value: Int, produce Int:
|
|
444
|
+
Let increment be function with input: Int, produce Int:
|
|
445
|
+
Return input plus 1.
|
|
446
|
+
Return increment(value).
|
|
447
|
+
`);
|
|
448
|
+
const func = findFunc(module, 'operate');
|
|
449
|
+
const statements = func.body?.statements ?? [];
|
|
450
|
+
const letStmt = statements[0];
|
|
451
|
+
assert.ok(letStmt && letStmt.kind === 'Let', '第一条语句应该是 Let');
|
|
452
|
+
if (!letStmt || letStmt.kind !== 'Let') {
|
|
453
|
+
assert.fail('缺少 Let 语句');
|
|
454
|
+
}
|
|
455
|
+
assert.equal(letStmt.expr.kind, 'Lambda');
|
|
456
|
+
const lambda = letStmt.expr;
|
|
457
|
+
assert.equal(lambda.params.length, 1);
|
|
458
|
+
assert.equal(lambda.params[0].name, 'input');
|
|
459
|
+
});
|
|
460
|
+
test('应该支持带可选 a function 的写法', () => {
|
|
461
|
+
const module = parseSource(`
|
|
462
|
+
This module is test.parser.let.lambda.article.
|
|
463
|
+
|
|
464
|
+
To demo, produce Int:
|
|
465
|
+
Let noop be a function with value: Int, produce Int:
|
|
466
|
+
Return value.
|
|
467
|
+
Return noop(0).
|
|
468
|
+
`);
|
|
469
|
+
const func = findFunc(module, 'demo');
|
|
470
|
+
const statements = func.body?.statements ?? [];
|
|
471
|
+
const letStmt = statements.find(stmt => stmt.kind === 'Let');
|
|
472
|
+
assert.ok(letStmt && letStmt.kind === 'Let', '应该找到 Let 语句');
|
|
473
|
+
if (!letStmt || letStmt.kind !== 'Let') {
|
|
474
|
+
assert.fail('缺少 Let 语句');
|
|
475
|
+
}
|
|
476
|
+
assert.equal(letStmt.expr.kind, 'Lambda');
|
|
477
|
+
});
|
|
478
|
+
test('应该保留 lambda 内部的语句块', () => {
|
|
479
|
+
const module = parseSource(`
|
|
480
|
+
This module is test.parser.let.lambda.body.
|
|
481
|
+
|
|
482
|
+
To compose, produce Int:
|
|
483
|
+
Let combine be function with left: Int and right: Int, produce Int:
|
|
484
|
+
Let sum be left plus right.
|
|
485
|
+
Return sum.
|
|
486
|
+
Return combine(1, 2).
|
|
487
|
+
`);
|
|
488
|
+
const func = findFunc(module, 'compose');
|
|
489
|
+
const letStmt = func.body?.statements[0];
|
|
490
|
+
assert.ok(letStmt && letStmt.kind === 'Let', '应该找到内联 lambda');
|
|
491
|
+
if (!letStmt || letStmt.kind !== 'Let') {
|
|
492
|
+
assert.fail('缺少内联 lambda');
|
|
493
|
+
}
|
|
494
|
+
if (letStmt.expr.kind !== 'Lambda') {
|
|
495
|
+
assert.fail('Let 表达式应该是 Lambda');
|
|
496
|
+
}
|
|
497
|
+
assert.equal(letStmt.expr.body.statements.length, 2);
|
|
498
|
+
assert.equal(letStmt.expr.body.statements[0].kind, 'Let');
|
|
499
|
+
assert.equal(letStmt.expr.body.statements[1].kind, 'Return');
|
|
500
|
+
});
|
|
501
|
+
});
|
|
502
|
+
describe('Set 语句解析', () => {
|
|
503
|
+
test('应该解析基本的赋值语句', () => {
|
|
504
|
+
const module = parseSource(`
|
|
505
|
+
This module is test.parser.set.basic.
|
|
506
|
+
|
|
507
|
+
To update with value: Int, produce Int:
|
|
508
|
+
Let total be 0.
|
|
509
|
+
Set total to total plus value.
|
|
510
|
+
Return total.
|
|
511
|
+
`);
|
|
512
|
+
const func = findFunc(module, 'update');
|
|
513
|
+
const statements = func.body?.statements ?? [];
|
|
514
|
+
const setStmt = statements.find(stmt => stmt.kind === 'Set');
|
|
515
|
+
assert.ok(setStmt && setStmt.kind === 'Set', '应该找到 Set 语句');
|
|
516
|
+
if (!setStmt || setStmt.kind !== 'Set') {
|
|
517
|
+
assert.fail('缺少 Set 语句');
|
|
518
|
+
}
|
|
519
|
+
assert.equal(setStmt.name, 'total');
|
|
520
|
+
assert.equal(setStmt.expr.kind, 'Call');
|
|
521
|
+
});
|
|
522
|
+
test('应该在嵌套块中解析 Set 语句', () => {
|
|
523
|
+
const module = parseSource(`
|
|
524
|
+
This module is test.parser.set.nested.
|
|
525
|
+
|
|
526
|
+
To configure, produce Text:
|
|
527
|
+
Within scope:
|
|
528
|
+
Let state be "initial".
|
|
529
|
+
Set state to "ready".
|
|
530
|
+
Return state.
|
|
531
|
+
Return "done".
|
|
532
|
+
`);
|
|
533
|
+
const func = findFunc(module, 'configure');
|
|
534
|
+
const statements = func.body?.statements ?? [];
|
|
535
|
+
const blockStmt = statements.find(stmt => stmt.kind === 'Block');
|
|
536
|
+
assert.ok(blockStmt && blockStmt.kind === 'Block', '应该解析 Within scope 块');
|
|
537
|
+
if (!blockStmt || blockStmt.kind !== 'Block') {
|
|
538
|
+
assert.fail('缺少 Within scope 块');
|
|
539
|
+
}
|
|
540
|
+
const innerSet = blockStmt.statements.find(stmt => stmt.kind === 'Set');
|
|
541
|
+
assert.ok(innerSet && innerSet.kind === 'Set', '块内应该包含 Set 语句');
|
|
542
|
+
if (!innerSet || innerSet.kind !== 'Set') {
|
|
543
|
+
assert.fail('缺少块内 Set 语句');
|
|
544
|
+
}
|
|
545
|
+
assert.equal(innerSet.name, 'state');
|
|
546
|
+
});
|
|
547
|
+
test('应该在缺少 to 时抛出诊断', () => {
|
|
548
|
+
assert.throws(() => parseSource(`
|
|
549
|
+
This module is test.parser.set.error_missing_to.
|
|
550
|
+
|
|
551
|
+
To broken, produce Int:
|
|
552
|
+
Set total value.
|
|
553
|
+
Return 0.
|
|
554
|
+
`), error => {
|
|
555
|
+
assert.match(String(error), /Set x to/);
|
|
556
|
+
return true;
|
|
557
|
+
});
|
|
558
|
+
});
|
|
559
|
+
test('应该在缺少结尾句点时抛出诊断', () => {
|
|
560
|
+
assert.throws(() => parseSource(`
|
|
561
|
+
This module is test.parser.set.error_missing_period.
|
|
562
|
+
|
|
563
|
+
To broken, produce Int:
|
|
564
|
+
Set total to 1
|
|
565
|
+
Return total.
|
|
566
|
+
`), error => {
|
|
567
|
+
assert.match(String(error), /Expected '.' at end of statement/);
|
|
568
|
+
return true;
|
|
569
|
+
});
|
|
570
|
+
});
|
|
571
|
+
});
|
|
572
|
+
describe('Return 效果采集', () => {
|
|
573
|
+
test('应该收集 Return 语句后的效果说明', () => {
|
|
574
|
+
const module = parseSource(`
|
|
575
|
+
This module is test.parser.return.effects.inline.
|
|
576
|
+
|
|
577
|
+
To fetch, produce Text:
|
|
578
|
+
Return "ok". It performs io.
|
|
579
|
+
`);
|
|
580
|
+
const func = findFunc(module, 'fetch');
|
|
581
|
+
assert.deepEqual(func.effects, ['io']);
|
|
582
|
+
assert.equal(func.effectCapsExplicit, false);
|
|
583
|
+
assert.deepEqual(func.effectCaps, [
|
|
584
|
+
CapabilityKind.HTTP,
|
|
585
|
+
CapabilityKind.SQL,
|
|
586
|
+
CapabilityKind.TIME,
|
|
587
|
+
CapabilityKind.FILES,
|
|
588
|
+
CapabilityKind.SECRETS,
|
|
589
|
+
CapabilityKind.AI_MODEL,
|
|
590
|
+
]);
|
|
591
|
+
});
|
|
592
|
+
test('应该合并函数体收集的效果', () => {
|
|
593
|
+
const module = parseSource(`
|
|
594
|
+
This module is test.parser.return.effects.merge.
|
|
595
|
+
|
|
596
|
+
To compute, produce Int. It performs cpu:
|
|
597
|
+
Return 1. It performs io.
|
|
598
|
+
`);
|
|
599
|
+
const func = findFunc(module, 'compute');
|
|
600
|
+
assert.deepEqual(func.effects, ['cpu', 'io']);
|
|
601
|
+
assert.equal(func.effectCapsExplicit, false);
|
|
602
|
+
assert.deepEqual(func.effectCaps, [
|
|
603
|
+
CapabilityKind.CPU,
|
|
604
|
+
CapabilityKind.HTTP,
|
|
605
|
+
CapabilityKind.SQL,
|
|
606
|
+
CapabilityKind.TIME,
|
|
607
|
+
CapabilityKind.FILES,
|
|
608
|
+
CapabilityKind.SECRETS,
|
|
609
|
+
CapabilityKind.AI_MODEL,
|
|
610
|
+
]);
|
|
611
|
+
});
|
|
612
|
+
});
|
|
613
|
+
describe('If not 条件', () => {
|
|
614
|
+
test('应该将 If not 条件转换为 not 调用', () => {
|
|
615
|
+
const module = parseSource(`
|
|
616
|
+
This module is test.parser.if.not.basic.
|
|
617
|
+
|
|
618
|
+
To guard with flag: Bool, produce Text:
|
|
619
|
+
If not flag:
|
|
620
|
+
Return "blocked".
|
|
621
|
+
Otherwise:
|
|
622
|
+
Return "ok".
|
|
623
|
+
`);
|
|
624
|
+
const func = findFunc(module, 'guard');
|
|
625
|
+
const statements = func.body?.statements ?? [];
|
|
626
|
+
const ifStmt = statements.find((statement) => statement.kind === 'If');
|
|
627
|
+
assert.ok(ifStmt, '应该找到 If 语句');
|
|
628
|
+
if (!ifStmt) {
|
|
629
|
+
assert.fail('缺少 If 语句');
|
|
630
|
+
}
|
|
631
|
+
assert.equal(ifStmt.cond.kind, 'Call');
|
|
632
|
+
if (ifStmt.cond.kind !== 'Call') {
|
|
633
|
+
assert.fail('If 条件应该是调用');
|
|
634
|
+
}
|
|
635
|
+
assert.equal(ifStmt.cond.target.kind, 'Name');
|
|
636
|
+
assert.equal(ifStmt.cond.target.name, 'not');
|
|
637
|
+
assert.equal(ifStmt.cond.args[0].kind, 'Name');
|
|
638
|
+
assert.equal(ifStmt.cond.args[0].name, 'flag');
|
|
639
|
+
});
|
|
640
|
+
test('应该在复合条件中保持原始表达式', () => {
|
|
641
|
+
const module = parseSource(`
|
|
642
|
+
This module is test.parser.if.not.complex.
|
|
643
|
+
|
|
644
|
+
To score with value: Int, produce Text:
|
|
645
|
+
If not (value at least 600):
|
|
646
|
+
Return "retry".
|
|
647
|
+
Otherwise:
|
|
648
|
+
Return "pass".
|
|
649
|
+
`);
|
|
650
|
+
const func = findFunc(module, 'score');
|
|
651
|
+
const ifStmt = func.body?.statements.find((statement) => statement.kind === 'If');
|
|
652
|
+
assert.ok(ifStmt, '应该找到 If 语句');
|
|
653
|
+
if (!ifStmt) {
|
|
654
|
+
assert.fail('缺少 If 语句');
|
|
655
|
+
}
|
|
656
|
+
if (ifStmt.cond.kind !== 'Call') {
|
|
657
|
+
assert.fail('条件应该是调用');
|
|
658
|
+
}
|
|
659
|
+
const arg = ifStmt.cond.args[0];
|
|
660
|
+
assert.ok(arg, 'not 调用应该包含参数');
|
|
661
|
+
if (!arg || arg.kind !== 'Call') {
|
|
662
|
+
assert.fail('not 参数应该是调用表达式');
|
|
663
|
+
}
|
|
664
|
+
assert.equal(arg.target.kind, 'Name');
|
|
665
|
+
assert.equal(arg.target.name, '>=');
|
|
666
|
+
});
|
|
667
|
+
});
|
|
668
|
+
describe('List/Map/Result 复杂类型', () => {
|
|
669
|
+
test('应该解析问号表示的 Maybe 类型', () => {
|
|
670
|
+
const module = parseSource(`
|
|
671
|
+
This module is test.parser.types.maybe.
|
|
672
|
+
|
|
673
|
+
To handle with token: Text?, produce Bool:
|
|
674
|
+
Return true.
|
|
675
|
+
`);
|
|
676
|
+
const func = findFunc(module, 'handle');
|
|
677
|
+
const param = func.params[0];
|
|
678
|
+
assert.ok(param, '应该存在 token 参数');
|
|
679
|
+
if (!param) {
|
|
680
|
+
assert.fail('缺少 token 参数');
|
|
681
|
+
}
|
|
682
|
+
if (param.type.kind !== 'Maybe') {
|
|
683
|
+
assert.fail('参数类型应该是 Maybe');
|
|
684
|
+
}
|
|
685
|
+
assert.equal(param.type.type.kind, 'TypeName');
|
|
686
|
+
assert.equal(param.type.type.name, 'Text');
|
|
687
|
+
});
|
|
688
|
+
test('应该解析 Option of 与 Maybe 组合', () => {
|
|
689
|
+
const module = parseSource(`
|
|
690
|
+
This module is test.parser.types.option.
|
|
691
|
+
|
|
692
|
+
To parse with payload: Option of Text?, produce Bool:
|
|
693
|
+
Return true.
|
|
694
|
+
`);
|
|
695
|
+
const func = findFunc(module, 'parse');
|
|
696
|
+
const param = func.params[0];
|
|
697
|
+
assert.ok(param, '应该存在 payload 参数');
|
|
698
|
+
if (!param) {
|
|
699
|
+
assert.fail('缺少 payload 参数');
|
|
700
|
+
}
|
|
701
|
+
if (param.type.kind !== 'Option') {
|
|
702
|
+
assert.fail('参数类型应该是 Option');
|
|
703
|
+
}
|
|
704
|
+
const inner = param.type.type;
|
|
705
|
+
if (inner.kind !== 'Maybe') {
|
|
706
|
+
assert.fail('Option 内部应该是 Maybe');
|
|
707
|
+
}
|
|
708
|
+
assert.equal(inner.type.kind, 'TypeName');
|
|
709
|
+
assert.equal(inner.type.name, 'Text');
|
|
710
|
+
});
|
|
711
|
+
test('应该解析 Result of 基本组合', () => {
|
|
712
|
+
const module = parseSource(`
|
|
713
|
+
This module is test.parser.types.result.
|
|
714
|
+
|
|
715
|
+
To convert with input: Result of Int or Text, produce Int:
|
|
716
|
+
Return 0.
|
|
717
|
+
`);
|
|
718
|
+
const func = findFunc(module, 'convert');
|
|
719
|
+
const param = func.params[0];
|
|
720
|
+
assert.ok(param, '应该存在 input 参数');
|
|
721
|
+
if (!param) {
|
|
722
|
+
assert.fail('缺少 input 参数');
|
|
723
|
+
}
|
|
724
|
+
if (param.type.kind !== 'Result') {
|
|
725
|
+
assert.fail('参数类型应该是 Result');
|
|
726
|
+
}
|
|
727
|
+
assert.equal(param.type.ok.kind, 'TypeName');
|
|
728
|
+
assert.equal(param.type.ok.name, 'Int');
|
|
729
|
+
assert.equal(param.type.err.kind, 'TypeName');
|
|
730
|
+
assert.equal(param.type.err.name, 'Text');
|
|
731
|
+
});
|
|
732
|
+
test('应该解析 List of Map 嵌套类型', () => {
|
|
733
|
+
const module = parseSource(`
|
|
734
|
+
This module is test.parser.types.list_map.
|
|
735
|
+
|
|
736
|
+
To collect with rows: List of Map Text to Int, produce Int:
|
|
737
|
+
Return 0.
|
|
738
|
+
`);
|
|
739
|
+
const func = findFunc(module, 'collect');
|
|
740
|
+
const param = func.params[0];
|
|
741
|
+
assert.ok(param, '应该存在 rows 参数');
|
|
742
|
+
if (!param) {
|
|
743
|
+
assert.fail('缺少 rows 参数');
|
|
744
|
+
}
|
|
745
|
+
if (param.type.kind !== 'List') {
|
|
746
|
+
assert.fail('参数类型应该是 List');
|
|
747
|
+
}
|
|
748
|
+
const inner = param.type.type;
|
|
749
|
+
if (inner.kind !== 'Map') {
|
|
750
|
+
assert.fail('List 内部应该是 Map');
|
|
751
|
+
}
|
|
752
|
+
assert.equal(inner.key.kind, 'TypeName');
|
|
753
|
+
assert.equal(inner.key.name, 'Text');
|
|
754
|
+
assert.equal(inner.val.kind, 'TypeName');
|
|
755
|
+
assert.equal(inner.val.name, 'Int');
|
|
756
|
+
});
|
|
757
|
+
test('应该解析自定义类型应用', () => {
|
|
758
|
+
const module = parseSource(`
|
|
759
|
+
This module is test.parser.types.type_app_single.
|
|
760
|
+
|
|
761
|
+
To adapt with response: Text, produce Promise of Text:
|
|
762
|
+
Return Promise.success(response).
|
|
763
|
+
`);
|
|
764
|
+
const func = findFunc(module, 'adapt');
|
|
765
|
+
assert.equal(func.retType.kind, 'TypeApp');
|
|
766
|
+
if (func.retType.kind !== 'TypeApp') {
|
|
767
|
+
assert.fail('返回类型应该是 TypeApp');
|
|
768
|
+
}
|
|
769
|
+
assert.equal(func.retType.base, 'Promise');
|
|
770
|
+
assert.equal(func.retType.args.length, 1);
|
|
771
|
+
assert.equal(func.retType.args[0].kind, 'TypeName');
|
|
772
|
+
assert.equal(func.retType.args[0].name, 'Text');
|
|
773
|
+
});
|
|
774
|
+
test('应该解析多层 List 嵌套', () => {
|
|
775
|
+
const module = parseSource(`
|
|
776
|
+
This module is test.parser.types.list_nested.
|
|
777
|
+
|
|
778
|
+
To flatten with input: List of List of Int, produce List of Int:
|
|
779
|
+
Return input.
|
|
780
|
+
`);
|
|
781
|
+
const func = findFunc(module, 'flatten');
|
|
782
|
+
const param = func.params[0];
|
|
783
|
+
assert.ok(param, '应该存在 input 参数');
|
|
784
|
+
if (!param) {
|
|
785
|
+
assert.fail('缺少 input 参数');
|
|
786
|
+
}
|
|
787
|
+
if (param.type.kind !== 'List') {
|
|
788
|
+
assert.fail('参数类型应该是 List');
|
|
789
|
+
}
|
|
790
|
+
const inner = param.type.type;
|
|
791
|
+
if (inner.kind !== 'List') {
|
|
792
|
+
assert.fail('List 内部应该还是 List');
|
|
793
|
+
}
|
|
794
|
+
assert.equal(inner.type.kind, 'TypeName');
|
|
795
|
+
assert.equal(inner.type.name, 'Int');
|
|
796
|
+
});
|
|
797
|
+
test('应该解析带 @pii 注解的类型', () => {
|
|
798
|
+
const module = parseSource(`
|
|
799
|
+
This module is test.parser.types.pii.
|
|
800
|
+
|
|
801
|
+
To secure with field: @pii(L2, email) Text, produce Text:
|
|
802
|
+
Return field.
|
|
803
|
+
`);
|
|
804
|
+
const func = findFunc(module, 'secure');
|
|
805
|
+
const param = func.params[0];
|
|
806
|
+
assert.ok(param, '应该存在 field 参数');
|
|
807
|
+
if (!param) {
|
|
808
|
+
assert.fail('缺少 field 参数');
|
|
809
|
+
}
|
|
810
|
+
if (param.type.kind !== 'TypePii') {
|
|
811
|
+
assert.fail('参数类型应该是 TypePii');
|
|
812
|
+
}
|
|
813
|
+
assert.equal(param.type.baseType.kind, 'TypeName');
|
|
814
|
+
assert.equal(param.type.baseType.name, 'Text');
|
|
815
|
+
assert.equal(param.type.sensitivity, 'L2');
|
|
816
|
+
assert.equal(param.type.category, 'email');
|
|
817
|
+
});
|
|
818
|
+
test('应该解析 Map 到 Result 的组合', () => {
|
|
819
|
+
const module = parseSource(`
|
|
820
|
+
This module is test.parser.types.map_result.
|
|
821
|
+
|
|
822
|
+
To inspect with entry: Map Text to Result of Int or Text, produce Bool:
|
|
823
|
+
Return true.
|
|
824
|
+
`);
|
|
825
|
+
const func = findFunc(module, 'inspect');
|
|
826
|
+
const param = func.params[0];
|
|
827
|
+
assert.ok(param, '应该存在 entry 参数');
|
|
828
|
+
if (!param) {
|
|
829
|
+
assert.fail('缺少 entry 参数');
|
|
830
|
+
}
|
|
831
|
+
if (param.type.kind !== 'Map') {
|
|
832
|
+
assert.fail('参数类型应该是 Map');
|
|
833
|
+
}
|
|
834
|
+
const valueType = param.type.val;
|
|
835
|
+
if (valueType.kind !== 'Result') {
|
|
836
|
+
assert.fail('Map 值应该是 Result');
|
|
837
|
+
}
|
|
838
|
+
assert.equal(valueType.ok.kind, 'TypeName');
|
|
839
|
+
assert.equal(valueType.ok.name, 'Int');
|
|
840
|
+
assert.equal(valueType.err.kind, 'TypeName');
|
|
841
|
+
assert.equal(valueType.err.name, 'Text');
|
|
842
|
+
});
|
|
843
|
+
test('应该解析 Result of 中嵌套 Option', () => {
|
|
844
|
+
const module = parseSource(`
|
|
845
|
+
This module is test.parser.types.result_option.
|
|
846
|
+
|
|
847
|
+
To decide with payload: Result of Option of Text or List of Text, produce Bool:
|
|
848
|
+
Return true.
|
|
849
|
+
`);
|
|
850
|
+
const func = findFunc(module, 'decide');
|
|
851
|
+
const param = func.params[0];
|
|
852
|
+
assert.ok(param, '应该存在 payload 参数');
|
|
853
|
+
if (!param) {
|
|
854
|
+
assert.fail('缺少 payload 参数');
|
|
855
|
+
}
|
|
856
|
+
if (param.type.kind !== 'Result') {
|
|
857
|
+
assert.fail('参数类型应该是 Result');
|
|
858
|
+
}
|
|
859
|
+
const okType = param.type.ok;
|
|
860
|
+
if (okType.kind !== 'Option') {
|
|
861
|
+
assert.fail('Result 成功分支应该是 Option');
|
|
862
|
+
}
|
|
863
|
+
assert.equal(okType.type.kind, 'TypeName');
|
|
864
|
+
assert.equal(okType.type.name, 'Text');
|
|
865
|
+
const errType = param.type.err;
|
|
866
|
+
if (errType.kind !== 'List') {
|
|
867
|
+
assert.fail('Result 失败分支应该是 List');
|
|
868
|
+
}
|
|
869
|
+
assert.equal(errType.type.kind, 'TypeName');
|
|
870
|
+
assert.equal(errType.type.name, 'Text');
|
|
871
|
+
});
|
|
872
|
+
test('应该解析多个参数的类型应用', () => {
|
|
873
|
+
const module = parseSource(`
|
|
874
|
+
This module is test.parser.types.type_app_multi.
|
|
875
|
+
|
|
876
|
+
To choose with picker: Text, produce Either of Text and Int:
|
|
877
|
+
Return Either.left(picker).
|
|
878
|
+
`);
|
|
879
|
+
const func = findFunc(module, 'choose');
|
|
880
|
+
assert.equal(func.retType.kind, 'TypeApp');
|
|
881
|
+
if (func.retType.kind !== 'TypeApp') {
|
|
882
|
+
assert.fail('返回类型应该是 TypeApp');
|
|
883
|
+
}
|
|
884
|
+
assert.equal(func.retType.base, 'Either');
|
|
885
|
+
assert.equal(func.retType.args.length, 2);
|
|
886
|
+
assert.equal(func.retType.args[0].kind, 'TypeName');
|
|
887
|
+
assert.equal(func.retType.args[0].name, 'Text');
|
|
888
|
+
assert.equal(func.retType.args[1].kind, 'TypeName');
|
|
889
|
+
assert.equal(func.retType.args[1].name, 'Int');
|
|
890
|
+
});
|
|
891
|
+
});
|
|
892
|
+
describe('类型变量作用域', () => {
|
|
893
|
+
test('显式类型参数不会泄漏到后续函数', () => {
|
|
894
|
+
const module = parseSource(`
|
|
895
|
+
This module is test.parser.type_scope.explicit.
|
|
896
|
+
|
|
897
|
+
To first of T with value: T, produce T:
|
|
898
|
+
Return value.
|
|
899
|
+
|
|
900
|
+
To second with value: T, produce T:
|
|
901
|
+
Return value.
|
|
902
|
+
`);
|
|
903
|
+
const firstFunc = findFunc(module, 'first');
|
|
904
|
+
const secondFunc = findFunc(module, 'second');
|
|
905
|
+
assert.deepEqual(firstFunc.typeParams, ['T']);
|
|
906
|
+
assert.deepEqual(Array.from(secondFunc.typeParams).sort(), ['T']);
|
|
907
|
+
const secondParam = secondFunc.params[0];
|
|
908
|
+
assert.ok(secondParam, 'second 应该存在参数');
|
|
909
|
+
if (!secondParam) {
|
|
910
|
+
assert.fail('缺少参数');
|
|
911
|
+
}
|
|
912
|
+
assert.equal(secondParam.type.kind, 'TypeName');
|
|
913
|
+
assert.equal(secondParam.type.name, 'T');
|
|
914
|
+
});
|
|
915
|
+
test('推断不会误将数据类型视为类型变量', () => {
|
|
916
|
+
const module = parseSource(`
|
|
917
|
+
This module is test.parser.type_scope.declared.
|
|
918
|
+
|
|
919
|
+
Define User with id: Text.
|
|
920
|
+
|
|
921
|
+
To fetch with id: User, produce User:
|
|
922
|
+
Return User.new(id).
|
|
923
|
+
`);
|
|
924
|
+
const func = findFunc(module, 'fetch');
|
|
925
|
+
assert.deepEqual(func.typeParams, []);
|
|
926
|
+
const param = func.params[0];
|
|
927
|
+
assert.ok(param, '应该存在 id 参数');
|
|
928
|
+
if (!param) {
|
|
929
|
+
assert.fail('缺少 id 参数');
|
|
930
|
+
}
|
|
931
|
+
assert.equal(param.type.kind, 'TypeName');
|
|
932
|
+
assert.equal(param.type.name, 'User');
|
|
933
|
+
});
|
|
934
|
+
test('推断的类型变量在不同函数间独立', () => {
|
|
935
|
+
const module = parseSource(`
|
|
936
|
+
This module is test.parser.type_scope.independent.
|
|
937
|
+
|
|
938
|
+
To box with value: Alpha, produce Alpha:
|
|
939
|
+
Return value.
|
|
940
|
+
|
|
941
|
+
To unwrap with value: Beta, produce Beta:
|
|
942
|
+
Return value.
|
|
943
|
+
`);
|
|
944
|
+
const box = findFunc(module, 'box');
|
|
945
|
+
const unwrap = findFunc(module, 'unwrap');
|
|
946
|
+
assert.deepEqual(Array.from(box.typeParams).sort(), ['Alpha']);
|
|
947
|
+
assert.deepEqual(Array.from(unwrap.typeParams).sort(), ['Beta']);
|
|
948
|
+
});
|
|
949
|
+
});
|
|
950
|
+
describe('效果和能力解析', () => {
|
|
951
|
+
test('应该解析带显式能力列表的效果声明', () => {
|
|
952
|
+
const module = parseSource(`
|
|
953
|
+
This module is test.parser.effects.explicit_caps.
|
|
954
|
+
|
|
955
|
+
To fetch, produce Text. It performs io [Http, Sql].
|
|
956
|
+
`);
|
|
957
|
+
const func = findFunc(module, 'fetch');
|
|
958
|
+
assert.deepEqual(func.effects, ['io']);
|
|
959
|
+
assert.deepEqual(func.effectCaps, [CapabilityKind.HTTP, CapabilityKind.SQL]);
|
|
960
|
+
assert.equal(func.effectCapsExplicit, true);
|
|
961
|
+
});
|
|
962
|
+
test('应该解析混合效果与显式能力', () => {
|
|
963
|
+
const module = parseSource(`
|
|
964
|
+
This module is test.parser.effects.mixed.
|
|
965
|
+
|
|
966
|
+
To sync, produce Int. It performs io and cpu and Http.
|
|
967
|
+
`);
|
|
968
|
+
const func = findFunc(module, 'sync');
|
|
969
|
+
assert.deepEqual(func.effects, ['io', 'cpu']);
|
|
970
|
+
assert.deepEqual(func.effectCaps, [CapabilityKind.HTTP]);
|
|
971
|
+
assert.equal(func.effectCapsExplicit, true);
|
|
972
|
+
});
|
|
973
|
+
test('应该在出现未知能力时抛出诊断', () => {
|
|
974
|
+
assert.throws(() => parseSource(`
|
|
975
|
+
This module is test.parser.effects.unknown_cap.
|
|
976
|
+
|
|
977
|
+
To risky, produce Text. It performs io with Blockchain.
|
|
978
|
+
`), error => {
|
|
979
|
+
assert.match(String(error), /Unknown capability 'Blockchain'/);
|
|
980
|
+
return true;
|
|
981
|
+
});
|
|
982
|
+
});
|
|
983
|
+
test('应该在仅声明 cpu 时推导能力', () => {
|
|
984
|
+
const module = parseSource(`
|
|
985
|
+
This module is test.parser.effects.cpu_only.
|
|
986
|
+
|
|
987
|
+
To crunch, produce Int. It performs cpu.
|
|
988
|
+
`);
|
|
989
|
+
const func = findFunc(module, 'crunch');
|
|
990
|
+
assert.deepEqual(func.effects, ['cpu']);
|
|
991
|
+
assert.deepEqual(func.effectCaps, [CapabilityKind.CPU]);
|
|
992
|
+
assert.equal(func.effectCapsExplicit, false);
|
|
993
|
+
});
|
|
994
|
+
});
|
|
995
|
+
describe('其他高优场景', () => {
|
|
996
|
+
test('应该解析 Within scope 块语句', () => {
|
|
997
|
+
const module = parseSource(`
|
|
998
|
+
This module is test.parser.misc.within_scope.
|
|
999
|
+
|
|
1000
|
+
To wrap, produce Text:
|
|
1001
|
+
Within scope:
|
|
1002
|
+
Let temp be "a".
|
|
1003
|
+
Return temp.
|
|
1004
|
+
Return "done".
|
|
1005
|
+
`);
|
|
1006
|
+
const func = findFunc(module, 'wrap');
|
|
1007
|
+
const blockStmt = func.body?.statements?.find(stmt => stmt.kind === 'Block');
|
|
1008
|
+
assert.ok(blockStmt && blockStmt.kind === 'Block', '应该找到 Block 语句');
|
|
1009
|
+
if (!blockStmt || blockStmt.kind !== 'Block') {
|
|
1010
|
+
assert.fail('缺少 Block 语句');
|
|
1011
|
+
}
|
|
1012
|
+
assert.equal(blockStmt.statements[0].kind, 'Let');
|
|
1013
|
+
assert.equal(blockStmt.statements[1].kind, 'Return');
|
|
1014
|
+
});
|
|
1015
|
+
test('应该解析 Wait for 多个名称列表', () => {
|
|
1016
|
+
const module = parseSource(`
|
|
1017
|
+
This module is test.parser.misc.wait_many.
|
|
1018
|
+
|
|
1019
|
+
To waitAll, produce Text:
|
|
1020
|
+
Let taskOne be start().
|
|
1021
|
+
Let taskTwo be start().
|
|
1022
|
+
Let taskThree be start().
|
|
1023
|
+
Wait for taskOne, taskTwo and taskThree.
|
|
1024
|
+
Return "ok".
|
|
1025
|
+
`);
|
|
1026
|
+
const func = findFunc(module, 'waitAll');
|
|
1027
|
+
const waitStmt = func.body?.statements.find(stmt => stmt.kind === 'Wait');
|
|
1028
|
+
assert.ok(waitStmt && waitStmt.kind === 'Wait', '应该找到 Wait 语句');
|
|
1029
|
+
if (!waitStmt || waitStmt.kind !== 'Wait') {
|
|
1030
|
+
assert.fail('缺少 Wait 语句');
|
|
1031
|
+
}
|
|
1032
|
+
assert.deepEqual(waitStmt.names, ['taskOne', 'taskTwo', 'taskThree']);
|
|
1033
|
+
});
|
|
1034
|
+
test('应该解析 await 调用语句', () => {
|
|
1035
|
+
const module = parseSource(`
|
|
1036
|
+
This module is test.parser.misc.await_stmt.
|
|
1037
|
+
|
|
1038
|
+
To sync, produce Text:
|
|
1039
|
+
Let result be await(fetch()).
|
|
1040
|
+
Return result.
|
|
1041
|
+
`);
|
|
1042
|
+
const func = findFunc(module, 'sync');
|
|
1043
|
+
const letStmt = func.body?.statements[0];
|
|
1044
|
+
assert.ok(letStmt && letStmt.kind === 'Let', '第一条语句应该是 Let');
|
|
1045
|
+
if (!letStmt || letStmt.kind !== 'Let') {
|
|
1046
|
+
assert.fail('缺少 Let 语句');
|
|
1047
|
+
}
|
|
1048
|
+
if (letStmt.expr.kind !== 'Call') {
|
|
1049
|
+
assert.fail('await 表达式应该解析为 Call');
|
|
1050
|
+
}
|
|
1051
|
+
assert.equal(letStmt.expr.target.kind, 'Name');
|
|
1052
|
+
assert.equal(letStmt.expr.target.name, 'await');
|
|
1053
|
+
assert.equal(letStmt.expr.args.length, 1);
|
|
1054
|
+
});
|
|
1055
|
+
test('应该保留裸调用语句', () => {
|
|
1056
|
+
const module = parseSource(`
|
|
1057
|
+
This module is test.parser.misc.expression_stmt.
|
|
1058
|
+
|
|
1059
|
+
To log, produce Text:
|
|
1060
|
+
Text.log("started").
|
|
1061
|
+
Return "ok".
|
|
1062
|
+
`);
|
|
1063
|
+
const func = findFunc(module, 'log');
|
|
1064
|
+
const callStmt = func.body?.statements[0];
|
|
1065
|
+
assert.ok(callStmt, '应该存在调用语句');
|
|
1066
|
+
if (!callStmt) {
|
|
1067
|
+
assert.fail('缺少调用语句');
|
|
1068
|
+
}
|
|
1069
|
+
assert.equal(callStmt.kind, 'Call');
|
|
1070
|
+
});
|
|
1071
|
+
test('应该解析 Match 分支中的名称模式', () => {
|
|
1072
|
+
const module = parseSource(`
|
|
1073
|
+
This module is test.parser.misc.match_name.
|
|
1074
|
+
|
|
1075
|
+
To unwrap with option: Option of Text, produce Text:
|
|
1076
|
+
Match option:
|
|
1077
|
+
When value, Return value.
|
|
1078
|
+
When null, Return "none".
|
|
1079
|
+
`);
|
|
1080
|
+
const func = findFunc(module, 'unwrap');
|
|
1081
|
+
const matchStmt = func.body?.statements.find(stmt => stmt.kind === 'Match');
|
|
1082
|
+
assert.ok(matchStmt && matchStmt.kind === 'Match', '应该找到 Match 语句');
|
|
1083
|
+
if (!matchStmt || matchStmt.kind !== 'Match') {
|
|
1084
|
+
assert.fail('缺少 Match 语句');
|
|
1085
|
+
}
|
|
1086
|
+
const firstCase = matchStmt.cases[0];
|
|
1087
|
+
assert.ok(firstCase, '应该存在首个分支');
|
|
1088
|
+
if (!firstCase) {
|
|
1089
|
+
assert.fail('缺少首个分支');
|
|
1090
|
+
}
|
|
1091
|
+
assert.equal(firstCase.pattern.kind, 'PatternName');
|
|
1092
|
+
assert.equal(firstCase.pattern.name, 'value');
|
|
1093
|
+
});
|
|
1094
|
+
test('应该解析 Start 语句的绑定与调用目标', () => {
|
|
1095
|
+
const module = parseSource(`
|
|
1096
|
+
This module is test.parser.misc.start_detail.
|
|
1097
|
+
|
|
1098
|
+
To spawn, produce Text:
|
|
1099
|
+
Start worker as async Http.fetch().
|
|
1100
|
+
Return "done".
|
|
1101
|
+
`);
|
|
1102
|
+
const func = findFunc(module, 'spawn');
|
|
1103
|
+
const startStmt = func.body?.statements[0];
|
|
1104
|
+
assert.ok(startStmt && startStmt.kind === 'Start', '第一条语句应该是 Start');
|
|
1105
|
+
if (!startStmt || startStmt.kind !== 'Start') {
|
|
1106
|
+
assert.fail('缺少 Start 语句');
|
|
1107
|
+
}
|
|
1108
|
+
assert.equal(startStmt.name, 'worker');
|
|
1109
|
+
if (startStmt.expr.kind !== 'Call') {
|
|
1110
|
+
assert.fail('Start 目标应该是调用');
|
|
1111
|
+
}
|
|
1112
|
+
assert.equal(startStmt.expr.target.kind, 'Name');
|
|
1113
|
+
assert.equal(startStmt.expr.target.name, 'Http.fetch');
|
|
1114
|
+
});
|
|
1115
|
+
});
|
|
1116
|
+
});
|
|
1117
|
+
//# sourceMappingURL=parser.test.js.map
|