funkscript 0.0.0-stage → 0.2.3
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/LICENSE +21 -0
- package/README.md +204 -2
- package/dist/Widget.tsx +9 -0
- package/dist/ast/types.d.ts +513 -0
- package/dist/ast/types.d.ts.map +1 -0
- package/dist/ast/types.js +5 -0
- package/dist/ast/types.js.map +1 -0
- package/dist/ast/walk.d.ts +8 -0
- package/dist/ast/walk.d.ts.map +1 -0
- package/dist/ast/walk.js +23 -0
- package/dist/ast/walk.js.map +1 -0
- package/dist/cli/build-bun.d.ts +24 -0
- package/dist/cli/build-bun.d.ts.map +1 -0
- package/dist/cli/build-bun.js +190 -0
- package/dist/cli/build-bun.js.map +1 -0
- package/dist/cli/build-watch.d.ts +21 -0
- package/dist/cli/build-watch.d.ts.map +1 -0
- package/dist/cli/build-watch.js +244 -0
- package/dist/cli/build-watch.js.map +1 -0
- package/dist/cli/build.d.ts +4 -0
- package/dist/cli/build.d.ts.map +1 -0
- package/dist/cli/build.js +338 -0
- package/dist/cli/build.js.map +1 -0
- package/dist/cli/check.d.ts +4 -0
- package/dist/cli/check.d.ts.map +1 -0
- package/dist/cli/check.js +278 -0
- package/dist/cli/check.js.map +1 -0
- package/dist/cli/commands.d.ts +13 -0
- package/dist/cli/commands.d.ts.map +1 -0
- package/dist/cli/commands.js +262 -0
- package/dist/cli/commands.js.map +1 -0
- package/dist/cli/doc.d.ts +3 -0
- package/dist/cli/doc.d.ts.map +1 -0
- package/dist/cli/doc.js +71 -0
- package/dist/cli/doc.js.map +1 -0
- package/dist/cli/doctor.d.ts +3 -0
- package/dist/cli/doctor.d.ts.map +1 -0
- package/dist/cli/doctor.js +121 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/emit.d.ts +4 -0
- package/dist/cli/emit.d.ts.map +1 -0
- package/dist/cli/emit.js +87 -0
- package/dist/cli/emit.js.map +1 -0
- package/dist/cli/explain.d.ts +3 -0
- package/dist/cli/explain.d.ts.map +1 -0
- package/dist/cli/explain.js +103 -0
- package/dist/cli/explain.js.map +1 -0
- package/dist/cli/fmt.d.ts +3 -0
- package/dist/cli/fmt.d.ts.map +1 -0
- package/dist/cli/fmt.js +146 -0
- package/dist/cli/fmt.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +186 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/init.d.ts +10 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +412 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/io.d.ts +9 -0
- package/dist/cli/io.d.ts.map +1 -0
- package/dist/cli/io.js +113 -0
- package/dist/cli/io.js.map +1 -0
- package/dist/cli/output-collisions.d.ts +2 -0
- package/dist/cli/output-collisions.d.ts.map +1 -0
- package/dist/cli/output-collisions.js +39 -0
- package/dist/cli/output-collisions.js.map +1 -0
- package/dist/cli/pipeline-style.d.ts +3 -0
- package/dist/cli/pipeline-style.d.ts.map +1 -0
- package/dist/cli/pipeline-style.js +45 -0
- package/dist/cli/pipeline-style.js.map +1 -0
- package/dist/cli/repl.d.ts +37 -0
- package/dist/cli/repl.d.ts.map +1 -0
- package/dist/cli/repl.js +334 -0
- package/dist/cli/repl.js.map +1 -0
- package/dist/cli/run.d.ts +4 -0
- package/dist/cli/run.d.ts.map +1 -0
- package/dist/cli/run.js +185 -0
- package/dist/cli/run.js.map +1 -0
- package/dist/cli/test.d.ts +3 -0
- package/dist/cli/test.d.ts.map +1 -0
- package/dist/cli/test.js +124 -0
- package/dist/cli/test.js.map +1 -0
- package/dist/cli/tsc.d.ts +3 -0
- package/dist/cli/tsc.d.ts.map +1 -0
- package/dist/cli/tsc.js +143 -0
- package/dist/cli/tsc.js.map +1 -0
- package/dist/cli/typecheck.d.ts +23 -0
- package/dist/cli/typecheck.d.ts.map +1 -0
- package/dist/cli/typecheck.js +65 -0
- package/dist/cli/typecheck.js.map +1 -0
- package/dist/compiler/ast-inspection.d.ts +18 -0
- package/dist/compiler/ast-inspection.d.ts.map +1 -0
- package/dist/compiler/ast-inspection.js +96 -0
- package/dist/compiler/ast-inspection.js.map +1 -0
- package/dist/compiler/boolean-operators.d.ts +8 -0
- package/dist/compiler/boolean-operators.d.ts.map +1 -0
- package/dist/compiler/boolean-operators.js +84 -0
- package/dist/compiler/boolean-operators.js.map +1 -0
- package/dist/compiler/check.d.ts +87 -0
- package/dist/compiler/check.d.ts.map +1 -0
- package/dist/compiler/check.js +1830 -0
- package/dist/compiler/check.js.map +1 -0
- package/dist/compiler/diagnostics.d.ts +6 -0
- package/dist/compiler/diagnostics.d.ts.map +1 -0
- package/dist/compiler/diagnostics.js +136 -0
- package/dist/compiler/diagnostics.js.map +1 -0
- package/dist/compiler/effect-mutation-rule.d.ts +4 -0
- package/dist/compiler/effect-mutation-rule.d.ts.map +1 -0
- package/dist/compiler/effect-mutation-rule.js +348 -0
- package/dist/compiler/effect-mutation-rule.js.map +1 -0
- package/dist/compiler/entry-rules.d.ts +5 -0
- package/dist/compiler/entry-rules.d.ts.map +1 -0
- package/dist/compiler/entry-rules.js +89 -0
- package/dist/compiler/entry-rules.js.map +1 -0
- package/dist/compiler/imported-record-functions.d.ts +4 -0
- package/dist/compiler/imported-record-functions.d.ts.map +1 -0
- package/dist/compiler/imported-record-functions.js +706 -0
- package/dist/compiler/imported-record-functions.js.map +1 -0
- package/dist/compiler/imported-schemas.d.ts +21 -0
- package/dist/compiler/imported-schemas.d.ts.map +1 -0
- package/dist/compiler/imported-schemas.js +461 -0
- package/dist/compiler/imported-schemas.js.map +1 -0
- package/dist/compiler/incremental-build.d.ts +23 -0
- package/dist/compiler/incremental-build.d.ts.map +1 -0
- package/dist/compiler/incremental-build.js +90 -0
- package/dist/compiler/incremental-build.js.map +1 -0
- package/dist/compiler/incremental-dependencies.d.ts +7 -0
- package/dist/compiler/incremental-dependencies.d.ts.map +1 -0
- package/dist/compiler/incremental-dependencies.js +190 -0
- package/dist/compiler/incremental-dependencies.js.map +1 -0
- package/dist/compiler/js-interop-nullability.d.ts +9 -0
- package/dist/compiler/js-interop-nullability.d.ts.map +1 -0
- package/dist/compiler/js-interop-nullability.js +57 -0
- package/dist/compiler/js-interop-nullability.js.map +1 -0
- package/dist/compiler/module-resolution.d.ts +6 -0
- package/dist/compiler/module-resolution.d.ts.map +1 -0
- package/dist/compiler/module-resolution.js +44 -0
- package/dist/compiler/module-resolution.js.map +1 -0
- package/dist/compiler/modules/output-collisions.d.ts +2 -0
- package/dist/compiler/modules/output-collisions.d.ts.map +1 -0
- package/dist/compiler/modules/output-collisions.js +39 -0
- package/dist/compiler/modules/output-collisions.js.map +1 -0
- package/dist/compiler/modules/output-plan.d.ts +7 -0
- package/dist/compiler/modules/output-plan.d.ts.map +1 -0
- package/dist/compiler/modules/output-plan.js +37 -0
- package/dist/compiler/modules/output-plan.js.map +1 -0
- package/dist/compiler/modules/resolution.d.ts +8 -0
- package/dist/compiler/modules/resolution.d.ts.map +1 -0
- package/dist/compiler/modules/resolution.js +48 -0
- package/dist/compiler/modules/resolution.js.map +1 -0
- package/dist/compiler/numeric-comparisons.d.ts +9 -0
- package/dist/compiler/numeric-comparisons.d.ts.map +1 -0
- package/dist/compiler/numeric-comparisons.js +153 -0
- package/dist/compiler/numeric-comparisons.js.map +1 -0
- package/dist/compiler/optional-arguments.d.ts +11 -0
- package/dist/compiler/optional-arguments.d.ts.map +1 -0
- package/dist/compiler/optional-arguments.js +246 -0
- package/dist/compiler/optional-arguments.js.map +1 -0
- package/dist/compiler/package-fingerprint.d.ts +7 -0
- package/dist/compiler/package-fingerprint.d.ts.map +1 -0
- package/dist/compiler/package-fingerprint.js +178 -0
- package/dist/compiler/package-fingerprint.js.map +1 -0
- package/dist/compiler/package-record-contracts.d.ts +5 -0
- package/dist/compiler/package-record-contracts.d.ts.map +1 -0
- package/dist/compiler/package-record-contracts.js +126 -0
- package/dist/compiler/package-record-contracts.js.map +1 -0
- package/dist/compiler/pipeline-companions.d.ts +18 -0
- package/dist/compiler/pipeline-companions.d.ts.map +1 -0
- package/dist/compiler/pipeline-companions.js +1042 -0
- package/dist/compiler/pipeline-companions.js.map +1 -0
- package/dist/compiler/pipelines/catalog.d.ts +15 -0
- package/dist/compiler/pipelines/catalog.d.ts.map +1 -0
- package/dist/compiler/pipelines/catalog.js +55 -0
- package/dist/compiler/pipelines/catalog.js.map +1 -0
- package/dist/compiler/pipelines/companions.d.ts +18 -0
- package/dist/compiler/pipelines/companions.d.ts.map +1 -0
- package/dist/compiler/pipelines/companions.js +1042 -0
- package/dist/compiler/pipelines/companions.js.map +1 -0
- package/dist/compiler/pipelines/resolution.d.ts +38 -0
- package/dist/compiler/pipelines/resolution.d.ts.map +1 -0
- package/dist/compiler/pipelines/resolution.js +571 -0
- package/dist/compiler/pipelines/resolution.js.map +1 -0
- package/dist/compiler/project-config.d.ts +28 -0
- package/dist/compiler/project-config.d.ts.map +1 -0
- package/dist/compiler/project-config.js +155 -0
- package/dist/compiler/project-config.js.map +1 -0
- package/dist/compiler/providers.d.ts +4 -0
- package/dist/compiler/providers.d.ts.map +1 -0
- package/dist/compiler/providers.js +101 -0
- package/dist/compiler/providers.js.map +1 -0
- package/dist/compiler/record-contracts.d.ts +6 -0
- package/dist/compiler/record-contracts.d.ts.map +1 -0
- package/dist/compiler/record-contracts.js +41 -0
- package/dist/compiler/record-contracts.js.map +1 -0
- package/dist/compiler/rules/control-flow.d.ts +10 -0
- package/dist/compiler/rules/control-flow.d.ts.map +1 -0
- package/dist/compiler/rules/control-flow.js +19 -0
- package/dist/compiler/rules/control-flow.js.map +1 -0
- package/dist/compiler/rules/diagnostic.d.ts +4 -0
- package/dist/compiler/rules/diagnostic.d.ts.map +1 -0
- package/dist/compiler/rules/diagnostic.js +2 -0
- package/dist/compiler/rules/diagnostic.js.map +1 -0
- package/dist/compiler/rules/module-scope-refs.d.ts +5 -0
- package/dist/compiler/rules/module-scope-refs.d.ts.map +1 -0
- package/dist/compiler/rules/module-scope-refs.js +47 -0
- package/dist/compiler/rules/module-scope-refs.js.map +1 -0
- package/dist/compiler/schemas/analysis.d.ts +13 -0
- package/dist/compiler/schemas/analysis.d.ts.map +1 -0
- package/dist/compiler/schemas/analysis.js +24 -0
- package/dist/compiler/schemas/analysis.js.map +1 -0
- package/dist/compiler/schemas/imported-record-functions.d.ts +4 -0
- package/dist/compiler/schemas/imported-record-functions.d.ts.map +1 -0
- package/dist/compiler/schemas/imported-record-functions.js +706 -0
- package/dist/compiler/schemas/imported-record-functions.js.map +1 -0
- package/dist/compiler/schemas/imported-schemas.d.ts +21 -0
- package/dist/compiler/schemas/imported-schemas.d.ts.map +1 -0
- package/dist/compiler/schemas/imported-schemas.js +461 -0
- package/dist/compiler/schemas/imported-schemas.js.map +1 -0
- package/dist/compiler/source-map.d.ts +6 -0
- package/dist/compiler/source-map.d.ts.map +1 -0
- package/dist/compiler/source-map.js +127 -0
- package/dist/compiler/source-map.js.map +1 -0
- package/dist/compiler/typescript-context.d.ts +33 -0
- package/dist/compiler/typescript-context.d.ts.map +1 -0
- package/dist/compiler/typescript-context.js +200 -0
- package/dist/compiler/typescript-context.js.map +1 -0
- package/dist/compiler.d.ts +77 -0
- package/dist/compiler.d.ts.map +1 -0
- package/dist/compiler.js +497 -0
- package/dist/compiler.js.map +1 -0
- package/dist/emitter/assemblyscript.d.ts +5 -0
- package/dist/emitter/assemblyscript.d.ts.map +1 -0
- package/dist/emitter/assemblyscript.js +979 -0
- package/dist/emitter/assemblyscript.js.map +1 -0
- package/dist/emitter/declarations.d.ts +46 -0
- package/dist/emitter/declarations.d.ts.map +1 -0
- package/dist/emitter/declarations.js +739 -0
- package/dist/emitter/declarations.js.map +1 -0
- package/dist/emitter/emitter.d.ts +165 -0
- package/dist/emitter/emitter.d.ts.map +1 -0
- package/dist/emitter/emitter.js +2448 -0
- package/dist/emitter/emitter.js.map +1 -0
- package/dist/emitter/imports.d.ts +6 -0
- package/dist/emitter/imports.d.ts.map +1 -0
- package/dist/emitter/imports.js +73 -0
- package/dist/emitter/imports.js.map +1 -0
- package/dist/emitter/indent.d.ts +3 -0
- package/dist/emitter/indent.d.ts.map +1 -0
- package/dist/emitter/indent.js +31 -0
- package/dist/emitter/indent.js.map +1 -0
- package/dist/emitter/jsx.d.ts +20 -0
- package/dist/emitter/jsx.d.ts.map +1 -0
- package/dist/emitter/jsx.js +82 -0
- package/dist/emitter/jsx.js.map +1 -0
- package/dist/emitter/local-bindings.d.ts +6 -0
- package/dist/emitter/local-bindings.d.ts.map +1 -0
- package/dist/emitter/local-bindings.js +32 -0
- package/dist/emitter/local-bindings.js.map +1 -0
- package/dist/emitter/match.d.ts +56 -0
- package/dist/emitter/match.d.ts.map +1 -0
- package/dist/emitter/match.js +1287 -0
- package/dist/emitter/match.js.map +1 -0
- package/dist/emitter/pipeline-catalog.d.ts +15 -0
- package/dist/emitter/pipeline-catalog.d.ts.map +1 -0
- package/dist/emitter/pipeline-catalog.js +55 -0
- package/dist/emitter/pipeline-catalog.js.map +1 -0
- package/dist/emitter/pipeline-resolution.d.ts +38 -0
- package/dist/emitter/pipeline-resolution.d.ts.map +1 -0
- package/dist/emitter/pipeline-resolution.js +571 -0
- package/dist/emitter/pipeline-resolution.js.map +1 -0
- package/dist/emitter/runtime-helpers.d.ts +10 -0
- package/dist/emitter/runtime-helpers.d.ts.map +1 -0
- package/dist/emitter/runtime-helpers.js +22 -0
- package/dist/emitter/runtime-helpers.js.map +1 -0
- package/dist/emitter/schemas.d.ts +36 -0
- package/dist/emitter/schemas.d.ts.map +1 -0
- package/dist/emitter/schemas.js +766 -0
- package/dist/emitter/schemas.js.map +1 -0
- package/dist/emitter/statements.d.ts +23 -0
- package/dist/emitter/statements.d.ts.map +1 -0
- package/dist/emitter/statements.js +216 -0
- package/dist/emitter/statements.js.map +1 -0
- package/dist/emitter/tagged-match.d.ts +23 -0
- package/dist/emitter/tagged-match.d.ts.map +1 -0
- package/dist/emitter/tagged-match.js +109 -0
- package/dist/emitter/tagged-match.js.map +1 -0
- package/dist/emitter/types.d.ts +22 -0
- package/dist/emitter/types.d.ts.map +1 -0
- package/dist/emitter/types.js +231 -0
- package/dist/emitter/types.js.map +1 -0
- package/dist/errors.d.ts +39 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +98 -0
- package/dist/errors.js.map +1 -0
- package/dist/formatter/comments.d.ts +25 -0
- package/dist/formatter/comments.d.ts.map +1 -0
- package/dist/formatter/comments.js +283 -0
- package/dist/formatter/comments.js.map +1 -0
- package/dist/formatter/index.d.ts +71 -0
- package/dist/formatter/index.d.ts.map +1 -0
- package/dist/formatter/index.js +1113 -0
- package/dist/formatter/index.js.map +1 -0
- package/dist/formatter/operator-precedence.d.ts +3 -0
- package/dist/formatter/operator-precedence.d.ts.map +1 -0
- package/dist/formatter/operator-precedence.js +27 -0
- package/dist/formatter/operator-precedence.js.map +1 -0
- package/dist/formatter/prettier.d.ts +7 -0
- package/dist/formatter/prettier.d.ts.map +1 -0
- package/dist/formatter/prettier.js +51 -0
- package/dist/formatter/prettier.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/interop/callback.d.ts +38 -0
- package/dist/interop/callback.d.ts.map +1 -0
- package/dist/interop/callback.js +130 -0
- package/dist/interop/callback.js.map +1 -0
- package/dist/interop/index.d.ts +6 -0
- package/dist/interop/index.d.ts.map +1 -0
- package/dist/interop/index.js +6 -0
- package/dist/interop/index.js.map +1 -0
- package/dist/interop/js.d.ts +16 -0
- package/dist/interop/js.d.ts.map +1 -0
- package/dist/interop/js.js +35 -0
- package/dist/interop/js.js.map +1 -0
- package/dist/interop/record.d.ts +9 -0
- package/dist/interop/record.d.ts.map +1 -0
- package/dist/interop/record.js +18 -0
- package/dist/interop/record.js.map +1 -0
- package/dist/interop/valibot.d.ts +9 -0
- package/dist/interop/valibot.d.ts.map +1 -0
- package/dist/interop/valibot.js +94 -0
- package/dist/interop/valibot.js.map +1 -0
- package/dist/interop/zod.d.ts +45 -0
- package/dist/interop/zod.d.ts.map +1 -0
- package/dist/interop/zod.js +143 -0
- package/dist/interop/zod.js.map +1 -0
- package/dist/lexer/lexer.d.ts +65 -0
- package/dist/lexer/lexer.d.ts.map +1 -0
- package/dist/lexer/lexer.js +1335 -0
- package/dist/lexer/lexer.js.map +1 -0
- package/dist/lexer/tokens.d.ts +96 -0
- package/dist/lexer/tokens.d.ts.map +1 -0
- package/dist/lexer/tokens.js +150 -0
- package/dist/lexer/tokens.js.map +1 -0
- package/dist/lsp/code-action-worker.d.ts +2 -0
- package/dist/lsp/code-action-worker.d.ts.map +1 -0
- package/dist/lsp/code-action-worker.js +17 -0
- package/dist/lsp/code-action-worker.js.map +1 -0
- package/dist/lsp/completion.d.ts +11 -0
- package/dist/lsp/completion.d.ts.map +1 -0
- package/dist/lsp/completion.js +260 -0
- package/dist/lsp/completion.js.map +1 -0
- package/dist/lsp/definition.d.ts +42 -0
- package/dist/lsp/definition.d.ts.map +1 -0
- package/dist/lsp/definition.js +1074 -0
- package/dist/lsp/definition.js.map +1 -0
- package/dist/lsp/diagnostics-worker.d.ts +2 -0
- package/dist/lsp/diagnostics-worker.d.ts.map +1 -0
- package/dist/lsp/diagnostics-worker.js +169 -0
- package/dist/lsp/diagnostics-worker.js.map +1 -0
- package/dist/lsp/docs.d.ts +37 -0
- package/dist/lsp/docs.d.ts.map +1 -0
- package/dist/lsp/docs.js +830 -0
- package/dist/lsp/docs.js.map +1 -0
- package/dist/lsp/error-channel.d.ts +3 -0
- package/dist/lsp/error-channel.d.ts.map +1 -0
- package/dist/lsp/error-channel.js +48 -0
- package/dist/lsp/error-channel.js.map +1 -0
- package/dist/lsp/hover.d.ts +5 -0
- package/dist/lsp/hover.d.ts.map +1 -0
- package/dist/lsp/hover.js +651 -0
- package/dist/lsp/hover.js.map +1 -0
- package/dist/lsp/imports.d.ts +5 -0
- package/dist/lsp/imports.d.ts.map +1 -0
- package/dist/lsp/imports.js +317 -0
- package/dist/lsp/imports.js.map +1 -0
- package/dist/lsp/index.d.ts +16 -0
- package/dist/lsp/index.d.ts.map +1 -0
- package/dist/lsp/index.js +17 -0
- package/dist/lsp/index.js.map +1 -0
- package/dist/lsp/inlay-hints.d.ts +3 -0
- package/dist/lsp/inlay-hints.d.ts.map +1 -0
- package/dist/lsp/inlay-hints.js +236 -0
- package/dist/lsp/inlay-hints.js.map +1 -0
- package/dist/lsp/interop-rename.d.ts +26 -0
- package/dist/lsp/interop-rename.d.ts.map +1 -0
- package/dist/lsp/interop-rename.js +346 -0
- package/dist/lsp/interop-rename.js.map +1 -0
- package/dist/lsp/match-arms.d.ts +3 -0
- package/dist/lsp/match-arms.d.ts.map +1 -0
- package/dist/lsp/match-arms.js +341 -0
- package/dist/lsp/match-arms.js.map +1 -0
- package/dist/lsp/navigation.d.ts +23 -0
- package/dist/lsp/navigation.d.ts.map +1 -0
- package/dist/lsp/navigation.js +430 -0
- package/dist/lsp/navigation.js.map +1 -0
- package/dist/lsp/parsed-documents.d.ts +25 -0
- package/dist/lsp/parsed-documents.d.ts.map +1 -0
- package/dist/lsp/parsed-documents.js +47 -0
- package/dist/lsp/parsed-documents.js.map +1 -0
- package/dist/lsp/rename-worker.d.ts +2 -0
- package/dist/lsp/rename-worker.d.ts.map +1 -0
- package/dist/lsp/rename-worker.js +27 -0
- package/dist/lsp/rename-worker.js.map +1 -0
- package/dist/lsp/server.d.ts +78 -0
- package/dist/lsp/server.d.ts.map +1 -0
- package/dist/lsp/server.js +1098 -0
- package/dist/lsp/server.js.map +1 -0
- package/dist/lsp/thunk-pipeline.d.ts +4 -0
- package/dist/lsp/thunk-pipeline.d.ts.map +1 -0
- package/dist/lsp/thunk-pipeline.js +95 -0
- package/dist/lsp/thunk-pipeline.js.map +1 -0
- package/dist/lsp/validation.d.ts +8 -0
- package/dist/lsp/validation.d.ts.map +1 -0
- package/dist/lsp/validation.js +124 -0
- package/dist/lsp/validation.js.map +1 -0
- package/dist/lsp/workspace.d.ts +8 -0
- package/dist/lsp/workspace.d.ts.map +1 -0
- package/dist/lsp/workspace.js +70 -0
- package/dist/lsp/workspace.js.map +1 -0
- package/dist/math.ts +1 -0
- package/dist/parser/declarations.d.ts +21 -0
- package/dist/parser/declarations.d.ts.map +1 -0
- package/dist/parser/declarations.js +626 -0
- package/dist/parser/declarations.js.map +1 -0
- package/dist/parser/errors.d.ts +9 -0
- package/dist/parser/errors.d.ts.map +1 -0
- package/dist/parser/errors.js +11 -0
- package/dist/parser/errors.js.map +1 -0
- package/dist/parser/index.d.ts +9 -0
- package/dist/parser/index.d.ts.map +1 -0
- package/dist/parser/index.js +9 -0
- package/dist/parser/index.js.map +1 -0
- package/dist/parser/jsx.d.ts +5 -0
- package/dist/parser/jsx.d.ts.map +1 -0
- package/dist/parser/jsx.js +188 -0
- package/dist/parser/jsx.js.map +1 -0
- package/dist/parser/operator-expressions.d.ts +16 -0
- package/dist/parser/operator-expressions.d.ts.map +1 -0
- package/dist/parser/operator-expressions.js +146 -0
- package/dist/parser/operator-expressions.js.map +1 -0
- package/dist/parser/parser.d.ts +104 -0
- package/dist/parser/parser.d.ts.map +1 -0
- package/dist/parser/parser.js +1216 -0
- package/dist/parser/parser.js.map +1 -0
- package/dist/parser/patterns.d.ts +9 -0
- package/dist/parser/patterns.d.ts.map +1 -0
- package/dist/parser/patterns.js +292 -0
- package/dist/parser/patterns.js.map +1 -0
- package/dist/parser/pipeline-expressions.d.ts +10 -0
- package/dist/parser/pipeline-expressions.d.ts.map +1 -0
- package/dist/parser/pipeline-expressions.js +57 -0
- package/dist/parser/pipeline-expressions.js.map +1 -0
- package/dist/parser/scope.d.ts +17 -0
- package/dist/parser/scope.d.ts.map +1 -0
- package/dist/parser/scope.js +56 -0
- package/dist/parser/scope.js.map +1 -0
- package/dist/parser/statements.d.ts +13 -0
- package/dist/parser/statements.d.ts.map +1 -0
- package/dist/parser/statements.js +737 -0
- package/dist/parser/statements.js.map +1 -0
- package/dist/parser/types.d.ts +13 -0
- package/dist/parser/types.d.ts.map +1 -0
- package/dist/parser/types.js +371 -0
- package/dist/parser/types.js.map +1 -0
- package/dist/plugins/bun-preload.d.ts +4 -0
- package/dist/plugins/bun-preload.d.ts.map +1 -0
- package/dist/plugins/bun-preload.js +18 -0
- package/dist/plugins/bun-preload.js.map +1 -0
- package/dist/plugins/bun.d.ts +115 -0
- package/dist/plugins/bun.d.ts.map +1 -0
- package/dist/plugins/bun.js +240 -0
- package/dist/plugins/bun.js.map +1 -0
- package/dist/plugins/esbuild.d.ts +45 -0
- package/dist/plugins/esbuild.d.ts.map +1 -0
- package/dist/plugins/esbuild.js +184 -0
- package/dist/plugins/esbuild.js.map +1 -0
- package/dist/plugins/type-view.d.ts +30 -0
- package/dist/plugins/type-view.d.ts.map +1 -0
- package/dist/plugins/type-view.js +245 -0
- package/dist/plugins/type-view.js.map +1 -0
- package/dist/plugins/vite.d.ts +56 -0
- package/dist/plugins/vite.d.ts.map +1 -0
- package/dist/plugins/vite.js +182 -0
- package/dist/plugins/vite.js.map +1 -0
- package/dist/service.ts +3 -0
- package/dist/service.ts.map +1 -0
- package/dist/testing/index.d.ts +24 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +56 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/tooling/doc.d.ts +82 -0
- package/dist/tooling/doc.d.ts.map +1 -0
- package/dist/tooling/doc.js +624 -0
- package/dist/tooling/doc.js.map +1 -0
- package/dist/tooling/idiomatic.d.ts +20 -0
- package/dist/tooling/idiomatic.d.ts.map +1 -0
- package/dist/tooling/idiomatic.js +154 -0
- package/dist/tooling/idiomatic.js.map +1 -0
- package/dist/tooling/migrate.d.ts +62 -0
- package/dist/tooling/migrate.d.ts.map +1 -0
- package/dist/tooling/migrate.js +608 -0
- package/dist/tooling/migrate.js.map +1 -0
- package/dist/tooling/pipeline-style.d.ts +12 -0
- package/dist/tooling/pipeline-style.d.ts.map +1 -0
- package/dist/tooling/pipeline-style.js +208 -0
- package/dist/tooling/pipeline-style.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +25 -0
- package/dist/version.js.map +1 -0
- package/package.json +128 -4
- package/src/ast/types.ts +753 -0
- package/src/ast/walk.ts +35 -0
- package/src/cli/build-bun.ts +249 -0
- package/src/cli/build-watch.ts +299 -0
- package/src/cli/build.ts +450 -0
- package/src/cli/check.ts +342 -0
- package/src/cli/commands.ts +301 -0
- package/src/cli/doc.ts +81 -0
- package/src/cli/doctor.ts +173 -0
- package/src/cli/emit.ts +138 -0
- package/src/cli/explain.ts +127 -0
- package/src/cli/fmt.ts +170 -0
- package/src/cli/index.ts +227 -0
- package/src/cli/init.ts +491 -0
- package/src/cli/io.ts +150 -0
- package/src/cli/pipeline-style.ts +55 -0
- package/src/cli/repl.ts +443 -0
- package/src/cli/run.ts +238 -0
- package/src/cli/test.ts +148 -0
- package/src/cli/tsc.ts +207 -0
- package/src/cli/typecheck.ts +100 -0
- package/src/compiler/ast-inspection.ts +121 -0
- package/src/compiler/boolean-operators.ts +108 -0
- package/src/compiler/check.ts +2763 -0
- package/src/compiler/diagnostics.ts +179 -0
- package/src/compiler/effect-mutation-rule.ts +407 -0
- package/src/compiler/entry-rules.ts +116 -0
- package/src/compiler/incremental-build.ts +131 -0
- package/src/compiler/incremental-dependencies.ts +200 -0
- package/src/compiler/js-interop-nullability.ts +67 -0
- package/src/compiler/modules/output-collisions.ts +48 -0
- package/src/compiler/modules/output-plan.ts +46 -0
- package/src/compiler/modules/resolution.ts +56 -0
- package/src/compiler/numeric-comparisons.ts +213 -0
- package/src/compiler/optional-arguments.ts +335 -0
- package/src/compiler/package-fingerprint.ts +216 -0
- package/src/compiler/package-record-contracts.ts +156 -0
- package/src/compiler/pipelines/catalog.ts +1128 -0
- package/src/compiler/pipelines/companions.ts +1279 -0
- package/src/compiler/pipelines/resolution.ts +684 -0
- package/src/compiler/project-config.ts +221 -0
- package/src/compiler/record-contracts.ts +46 -0
- package/src/compiler/rules/control-flow.ts +57 -0
- package/src/compiler/rules/diagnostic.ts +11 -0
- package/src/compiler/rules/module-scope-refs.ts +63 -0
- package/src/compiler/schemas/analysis.ts +45 -0
- package/src/compiler/schemas/imported-record-functions.ts +984 -0
- package/src/compiler/schemas/imported-schemas.ts +761 -0
- package/src/compiler/source-map.ts +165 -0
- package/src/compiler/typescript-context.ts +250 -0
- package/src/compiler.ts +865 -0
- package/src/emitter/assemblyscript.ts +1220 -0
- package/src/emitter/declarations.ts +916 -0
- package/src/emitter/emitter.ts +3128 -0
- package/src/emitter/imports.ts +89 -0
- package/src/emitter/indent.ts +39 -0
- package/src/emitter/jsx.ts +122 -0
- package/src/emitter/local-bindings.ts +40 -0
- package/src/emitter/match.ts +1631 -0
- package/src/emitter/runtime-helpers.ts +31 -0
- package/src/emitter/schemas.ts +969 -0
- package/src/emitter/statements.ts +310 -0
- package/src/emitter/tagged-match.ts +171 -0
- package/src/emitter/types.ts +289 -0
- package/src/errors.ts +115 -0
- package/src/formatter/comments.ts +350 -0
- package/src/formatter/index.ts +1457 -0
- package/src/formatter/operator-precedence.ts +36 -0
- package/src/formatter/prettier.ts +61 -0
- package/src/index.ts +16 -0
- package/src/interop/callback.ts +188 -0
- package/src/interop/js.ts +66 -0
- package/src/interop/record.ts +36 -0
- package/src/interop/valibot.ts +141 -0
- package/src/interop/zod.ts +219 -0
- package/src/lexer/lexer.ts +1521 -0
- package/src/lexer/tokens.ts +174 -0
- package/src/lsp/code-action-worker.ts +31 -0
- package/src/lsp/completion.ts +343 -0
- package/src/lsp/definition.ts +1165 -0
- package/src/lsp/diagnostics-worker.ts +198 -0
- package/src/lsp/docs.ts +864 -0
- package/src/lsp/error-channel.ts +63 -0
- package/src/lsp/hover.ts +803 -0
- package/src/lsp/imports.ts +380 -0
- package/src/lsp/index.ts +55 -0
- package/src/lsp/inlay-hints.ts +308 -0
- package/src/lsp/interop-rename.ts +454 -0
- package/src/lsp/match-arms.ts +400 -0
- package/src/lsp/navigation.ts +553 -0
- package/src/lsp/parsed-documents.ts +64 -0
- package/src/lsp/rename-worker.ts +40 -0
- package/src/lsp/server.ts +1437 -0
- package/src/lsp/thunk-pipeline.ts +117 -0
- package/src/lsp/validation.ts +147 -0
- package/src/lsp/workspace.ts +74 -0
- package/src/parser/declarations.ts +808 -0
- package/src/parser/errors.ts +18 -0
- package/src/parser/jsx.ts +253 -0
- package/src/parser/operator-expressions.ts +170 -0
- package/src/parser/parser.ts +1565 -0
- package/src/parser/patterns.ts +342 -0
- package/src/parser/pipeline-expressions.ts +77 -0
- package/src/parser/scope.ts +69 -0
- package/src/parser/statements.ts +831 -0
- package/src/parser/types.ts +453 -0
- package/src/plugins/bun-preload.ts +25 -0
- package/src/plugins/bun.ts +448 -0
- package/src/plugins/esbuild.ts +308 -0
- package/src/plugins/type-view.ts +326 -0
- package/src/plugins/vite.ts +294 -0
- package/src/testing/index.ts +72 -0
- package/src/tooling/doc.ts +786 -0
- package/src/tooling/idiomatic.ts +202 -0
- package/src/tooling/pipeline-style.ts +248 -0
- package/src/version.ts +27 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sources":["../../src/parser/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,qBAAa,UAAW,SAAQ,cAAc;IAC5C,YAAY,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAGtC;CACF;AAED,eAAO,MAAM,0BAA0B,iUACyR,CAAC;AAEjU,eAAO,MAAM,wBAAwB,4TACsR,CAAC;AAE5T,eAAO,MAAM,2BAA2B,wMAC+J,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FunScriptError } from "../errors.js";
|
|
2
|
+
export class ParseError extends FunScriptError {
|
|
3
|
+
constructor(message, span) {
|
|
4
|
+
super(message, span);
|
|
5
|
+
this.name = "ParseError";
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export const FUNCTION_RETURN_DIAGNOSTIC = "Function block must end with an explicit '=> returnValue'. Multi-statement functions require an explicit return arrow to distinguish returned values from side effects. Use '=> value' or rewrite as an inline single-expression lambda '(args) => expr'. See docs/syntax.md#311-explicit-returns-and-conditional-execution.";
|
|
9
|
+
export const EFFECT_RETURN_DIAGNOSTIC = "Effect block must end with an explicit '=> returnValue'. Effect blocks require an explicit return arrow to ensure values are yielded and returned properly. Use '=> value' to return, or '_ <- effect' followed by '=> Void' to discard. See docs/syntax.md#93-the-non-final-expression-rule-and-control-flow-lowering.";
|
|
10
|
+
export const EFFECT_BARE_EXPR_DIAGNOSTIC = "Non-final bare expression in effect block is not executed. Use '<-' to run an effect or '_ <-' to discard its value. See docs/syntax.md#93-the-non-final-expression-rule-and-control-flow-lowering.";
|
|
11
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sources":["../../src/parser/errors.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,OAAO,UAAW,SAAQ,cAAc;IAC5C,YAAY,OAAe,EAAE,IAAU;QACrC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;IAC3B,CAAC;CACF;AAED,MAAM,CAAC,MAAM,0BAA0B,GACrC,8TAA8T,CAAC;AAEjU,MAAM,CAAC,MAAM,wBAAwB,GACnC,yTAAyT,CAAC;AAE5T,MAAM,CAAC,MAAM,2BAA2B,GACtC,qMAAqM,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./declarations.js";
|
|
2
|
+
export * from "./errors.js";
|
|
3
|
+
export * from "./jsx.js";
|
|
4
|
+
export * from "./parser.js";
|
|
5
|
+
export * from "./patterns.js";
|
|
6
|
+
export * from "./scope.js";
|
|
7
|
+
export * from "./statements.js";
|
|
8
|
+
export * from "./types.js";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":["../../src/parser/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./declarations.js";
|
|
2
|
+
export * from "./errors.js";
|
|
3
|
+
export * from "./jsx.js";
|
|
4
|
+
export * from "./parser.js";
|
|
5
|
+
export * from "./patterns.js";
|
|
6
|
+
export * from "./scope.js";
|
|
7
|
+
export * from "./statements.js";
|
|
8
|
+
export * from "./types.js";
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/parser/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { JSXElement, JSXSelfClosingElement } from "../ast/types.js";
|
|
2
|
+
import type { Parser } from "./parser.js";
|
|
3
|
+
export type JsxParserContext = Parser;
|
|
4
|
+
export declare function parseJsxElement(ctx: JsxParserContext): JSXElement | JSXSelfClosingElement;
|
|
5
|
+
//# sourceMappingURL=jsx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx.d.ts","sources":["../../src/parser/jsx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAOV,UAAU,EAGV,qBAAqB,EAGtB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAEtC,wBAAgB,eAAe,CAC7B,GAAG,EAAE,gBAAgB,GACpB,UAAU,GAAG,qBAAqB,CAuGpC"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { TokenType } from "../lexer/tokens.js";
|
|
2
|
+
import { ParseError } from "./errors.js";
|
|
3
|
+
export function parseJsxElement(ctx) {
|
|
4
|
+
const start = ctx.consume(TokenType.JSX_TAG_OPEN, "Expected '<'").span.start;
|
|
5
|
+
const tagName = parseJsxTagName(ctx);
|
|
6
|
+
const attributes = [];
|
|
7
|
+
while (!ctx.check(TokenType.JSX_TAG_CLOSE) &&
|
|
8
|
+
!ctx.check(TokenType.JSX_SLASH_CLOSE) &&
|
|
9
|
+
!ctx.isAtEnd()) {
|
|
10
|
+
ctx.skipNewlines();
|
|
11
|
+
if (ctx.check(TokenType.JSX_TAG_CLOSE) ||
|
|
12
|
+
ctx.check(TokenType.JSX_SLASH_CLOSE)) {
|
|
13
|
+
break;
|
|
14
|
+
}
|
|
15
|
+
attributes.push(parseJsxAttribute(ctx));
|
|
16
|
+
ctx.skipNewlines();
|
|
17
|
+
}
|
|
18
|
+
if (ctx.match(TokenType.JSX_SLASH_CLOSE)) {
|
|
19
|
+
const slashClose = ctx.previous();
|
|
20
|
+
return {
|
|
21
|
+
kind: "JSXSelfClosingElement",
|
|
22
|
+
name: tagName,
|
|
23
|
+
attributes,
|
|
24
|
+
span: { start, end: slashClose.span.end },
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
const tagClose = ctx.consume(TokenType.JSX_TAG_CLOSE, "Expected '>' or '/>' after JSX attributes");
|
|
28
|
+
const openingElement = {
|
|
29
|
+
kind: "JSXOpeningElement",
|
|
30
|
+
name: tagName,
|
|
31
|
+
attributes,
|
|
32
|
+
span: { start, end: tagClose.span.end },
|
|
33
|
+
};
|
|
34
|
+
const children = [];
|
|
35
|
+
while (!ctx.check(TokenType.JSX_CLOSING_TAG_OPEN) && !ctx.isAtEnd()) {
|
|
36
|
+
if (ctx.check(TokenType.JSX_TAG_OPEN)) {
|
|
37
|
+
children.push(parseJsxElement(ctx));
|
|
38
|
+
}
|
|
39
|
+
else if (ctx.check(TokenType.LBRACE)) {
|
|
40
|
+
children.push(parseJsxExpressionContainer(ctx));
|
|
41
|
+
}
|
|
42
|
+
else if (ctx.check(TokenType.JSX_TEXT)) {
|
|
43
|
+
const textTok = ctx.advance();
|
|
44
|
+
const raw = textTok.value;
|
|
45
|
+
// Skip whitespace-only formatting lines between tags
|
|
46
|
+
if (/^\s*[\r\n]\s*$/.test(raw)) {
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
// Normalize leading and trailing newlines from multiline text, preserving inline spacing
|
|
50
|
+
const value = raw
|
|
51
|
+
.replace(/^\s*[\r\n]+\s*/, "")
|
|
52
|
+
.replace(/\s*[\r\n]+\s*$/, "");
|
|
53
|
+
children.push({
|
|
54
|
+
kind: "JSXText",
|
|
55
|
+
value,
|
|
56
|
+
raw,
|
|
57
|
+
span: textTok.span,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
throw new ParseError(`Unexpected token '${ctx.peek().value}' in JSX children`, ctx.peek().span);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
const closingStart = ctx.consume(TokenType.JSX_CLOSING_TAG_OPEN, `Expected closing tag for <${formatTagName(tagName)}>`).span.start;
|
|
65
|
+
const closingName = parseJsxTagName(ctx);
|
|
66
|
+
const closingGt = ctx.consume(TokenType.JSX_TAG_CLOSE, "Expected '>' to close tag");
|
|
67
|
+
if (!areTagNamesEqual(tagName, closingName)) {
|
|
68
|
+
throw new ParseError(`Expected closing tag </${formatTagName(tagName)}>, found </${formatTagName(closingName)}>`, closingName.span);
|
|
69
|
+
}
|
|
70
|
+
const closingElement = {
|
|
71
|
+
kind: "JSXClosingElement",
|
|
72
|
+
name: closingName,
|
|
73
|
+
span: { start: closingStart, end: closingGt.span.end },
|
|
74
|
+
};
|
|
75
|
+
return {
|
|
76
|
+
kind: "JSXElement",
|
|
77
|
+
openingElement,
|
|
78
|
+
children,
|
|
79
|
+
closingElement,
|
|
80
|
+
span: { start: openingElement.span.start, end: closingElement.span.end },
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
function parseJsxTagName(ctx) {
|
|
84
|
+
if (ctx.check(TokenType.JSX_TAG_CLOSE)) {
|
|
85
|
+
// Empty fragment tag (<> or </>)
|
|
86
|
+
const pos = ctx.peek().span.start;
|
|
87
|
+
return {
|
|
88
|
+
kind: "Identifier",
|
|
89
|
+
name: "",
|
|
90
|
+
span: { start: pos, end: pos },
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
if (!ctx.check(TokenType.IDENTIFIER) &&
|
|
94
|
+
!ctx.check(TokenType.UPPER_IDENTIFIER)) {
|
|
95
|
+
throw new ParseError(`Expected JSX tag name, found '${ctx.peek().value}'`, ctx.peek().span);
|
|
96
|
+
}
|
|
97
|
+
let name = ctx.parseAnyIdentifier();
|
|
98
|
+
while (ctx.match(TokenType.DOT)) {
|
|
99
|
+
const prop = ctx.parsePropertyIdentifier();
|
|
100
|
+
name = {
|
|
101
|
+
kind: "MemberExpression",
|
|
102
|
+
object: name,
|
|
103
|
+
property: prop,
|
|
104
|
+
span: { start: name.span.start, end: prop.span.end },
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
return name;
|
|
108
|
+
}
|
|
109
|
+
function parseJsxAttribute(ctx) {
|
|
110
|
+
if (ctx.match(TokenType.LBRACE)) {
|
|
111
|
+
const start = ctx.previous().span.start;
|
|
112
|
+
ctx.consume(TokenType.DOTDOTDOT, "Expected '...' in JSX spread attribute");
|
|
113
|
+
const argument = ctx.parseExpression();
|
|
114
|
+
const end = ctx.consume(TokenType.RBRACE, "Expected '}' after JSX spread")
|
|
115
|
+
.span.end;
|
|
116
|
+
return { kind: "JSXSpreadAttribute", argument, span: { start, end } };
|
|
117
|
+
}
|
|
118
|
+
let nameTok;
|
|
119
|
+
if (ctx.check(TokenType.JSX_ATTRIBUTE_NAME)) {
|
|
120
|
+
nameTok = ctx.advance();
|
|
121
|
+
}
|
|
122
|
+
else if (ctx.check(TokenType.IDENTIFIER) ||
|
|
123
|
+
ctx.check(TokenType.UPPER_IDENTIFIER)) {
|
|
124
|
+
nameTok = ctx.advance();
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
throw new ParseError(`Expected attribute name, found '${ctx.peek().value}'`, ctx.peek().span);
|
|
128
|
+
}
|
|
129
|
+
const nameNode = nameTok.type === TokenType.UPPER_IDENTIFIER
|
|
130
|
+
? { kind: "UpperIdentifier", name: nameTok.value, span: nameTok.span }
|
|
131
|
+
: { kind: "Identifier", name: nameTok.value, span: nameTok.span };
|
|
132
|
+
if (ctx.match(TokenType.EQ)) {
|
|
133
|
+
let value;
|
|
134
|
+
if (ctx.check(TokenType.STRING) || ctx.check(TokenType.STRING_PART)) {
|
|
135
|
+
value = ctx.parseStringLiteral();
|
|
136
|
+
}
|
|
137
|
+
else if (ctx.check(TokenType.LBRACE)) {
|
|
138
|
+
value = parseJsxExpressionContainer(ctx);
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
throw new ParseError(`Expected attribute value (string or expression container), found '${ctx.peek().value}'`, ctx.peek().span);
|
|
142
|
+
}
|
|
143
|
+
return {
|
|
144
|
+
kind: "JSXAttribute",
|
|
145
|
+
name: nameNode,
|
|
146
|
+
value,
|
|
147
|
+
span: { start: nameNode.span.start, end: value.span.end },
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
return {
|
|
151
|
+
kind: "JSXAttribute",
|
|
152
|
+
name: nameNode,
|
|
153
|
+
span: nameNode.span,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
function parseJsxExpressionContainer(ctx) {
|
|
157
|
+
const start = ctx.consume(TokenType.LBRACE, "Expected '{'").span.start;
|
|
158
|
+
ctx.skipNewlines();
|
|
159
|
+
const hasIndent = ctx.match(TokenType.INDENT);
|
|
160
|
+
ctx.skipNewlines();
|
|
161
|
+
const expression = ctx.parseExpression();
|
|
162
|
+
ctx.skipNewlines();
|
|
163
|
+
if (hasIndent) {
|
|
164
|
+
ctx.match(TokenType.DEDENT);
|
|
165
|
+
ctx.skipNewlines();
|
|
166
|
+
}
|
|
167
|
+
const end = ctx.consume(TokenType.RBRACE, "Expected '}' after JSX expression")
|
|
168
|
+
.span.end;
|
|
169
|
+
return {
|
|
170
|
+
kind: "JSXExpressionContainer",
|
|
171
|
+
expression,
|
|
172
|
+
span: { start, end },
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
function formatTagName(name) {
|
|
176
|
+
if (name.kind === "Identifier" || name.kind === "UpperIdentifier") {
|
|
177
|
+
return name.name;
|
|
178
|
+
}
|
|
179
|
+
if (name.kind === "MemberExpression") {
|
|
180
|
+
const obj = formatTagName(name.object);
|
|
181
|
+
return `${obj}.${name.property.name}`;
|
|
182
|
+
}
|
|
183
|
+
return "";
|
|
184
|
+
}
|
|
185
|
+
function areTagNamesEqual(a, b) {
|
|
186
|
+
return formatTagName(a) === formatTagName(b);
|
|
187
|
+
}
|
|
188
|
+
//# sourceMappingURL=jsx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx.js","sources":["../../src/parser/jsx.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,SAAS,EAAc,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAKzC,MAAM,UAAU,eAAe,CAC7B,GAAqB;IAErB,MAAM,KAAK,GAAG,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;QACL,IAAI,EAAE,wBAAwB;QAC9B,UAAU;QACV,IAAI,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE;KACrB,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,IAAgB;IACrC,IAAI,IAAI,CAAC,IAAI,KAAK,YAAY,IAAI,IAAI,CAAC,IAAI,KAAK,iBAAiB,EAAE,CAAC;QAClE,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IACD,IAAI,IAAI,CAAC,IAAI,KAAK,kBAAkB,EAAE,CAAC;QACrC,MAAM,GAAG,GAAG,aAAa,CAAC,IAAI,CAAC,MAAoB,CAAC,CAAC;QACrD,OAAO,GAAG,GAAG,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;IACxC,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,SAAS,gBAAgB,CAAC,CAAa,EAAE,CAAa;IACpD,OAAO,aAAa,CAAC,CAAC,CAAC,KAAK,aAAa,CAAC,CAAC,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Expression } from "../ast/types.js";
|
|
2
|
+
import type { Parser } from "./parser.js";
|
|
3
|
+
export declare class OperatorParser {
|
|
4
|
+
private readonly ctx;
|
|
5
|
+
constructor(ctx: Parser);
|
|
6
|
+
parseLogicalOr(): Expression;
|
|
7
|
+
private parseLogicalAnd;
|
|
8
|
+
private isPrimitiveLiteral;
|
|
9
|
+
private parseEquality;
|
|
10
|
+
private parseComparison;
|
|
11
|
+
private parseAdditive;
|
|
12
|
+
private parseMultiplicative;
|
|
13
|
+
private parseExponent;
|
|
14
|
+
private parseUnary;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=operator-expressions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operator-expressions.d.ts","sources":["../../src/parser/operator-expressions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGlD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,qBAAa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,GAAG;IAAhC,YAA6B,GAAG,EAAE,MAAM,EAAI;IAErC,cAAc,IAAI,UAAU,CAalC;IAED,OAAO,CAAC,eAAe;IAevB,OAAO,CAAC,kBAAkB;IAoB1B,OAAO,CAAC,aAAa;IAgCrB,OAAO,CAAC,eAAe;IAkBvB,OAAO,CAAC,aAAa;IAgBrB,OAAO,CAAC,mBAAmB;IAgB3B,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,UAAU;CAcnB"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { TokenType } from "../lexer/tokens.js";
|
|
2
|
+
import { ParseError } from "./errors.js";
|
|
3
|
+
export class OperatorParser {
|
|
4
|
+
ctx;
|
|
5
|
+
constructor(ctx) {
|
|
6
|
+
this.ctx = ctx;
|
|
7
|
+
}
|
|
8
|
+
parseLogicalOr() {
|
|
9
|
+
let expr = this.parseLogicalAnd();
|
|
10
|
+
while (this.ctx.match(TokenType.OR)) {
|
|
11
|
+
const right = this.parseLogicalAnd();
|
|
12
|
+
expr = {
|
|
13
|
+
kind: "BinaryExpression",
|
|
14
|
+
operator: "or",
|
|
15
|
+
left: expr,
|
|
16
|
+
right,
|
|
17
|
+
span: { start: expr.span.start, end: right.span.end },
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
return expr;
|
|
21
|
+
}
|
|
22
|
+
parseLogicalAnd() {
|
|
23
|
+
let expr = this.parseEquality();
|
|
24
|
+
while (this.ctx.match(TokenType.AND)) {
|
|
25
|
+
const right = this.parseEquality();
|
|
26
|
+
expr = {
|
|
27
|
+
kind: "BinaryExpression",
|
|
28
|
+
operator: "and",
|
|
29
|
+
left: expr,
|
|
30
|
+
right,
|
|
31
|
+
span: { start: expr.span.start, end: right.span.end },
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
return expr;
|
|
35
|
+
}
|
|
36
|
+
isPrimitiveLiteral(expr) {
|
|
37
|
+
if (expr.kind === "NumberLiteral" ||
|
|
38
|
+
expr.kind === "StringLiteral" ||
|
|
39
|
+
expr.kind === "BooleanLiteral") {
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
if (expr.kind === "UnaryExpression" &&
|
|
43
|
+
this.isPrimitiveLiteral(expr.argument)) {
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
if (expr.kind === "BinaryExpression") {
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
parseEquality() {
|
|
52
|
+
let expr = this.parseComparison();
|
|
53
|
+
while (this.ctx.match(TokenType.VALUE_EQ, TokenType.VALUE_NEQ, TokenType.REF_EQ, TokenType.REF_NEQ)) {
|
|
54
|
+
const opTok = this.ctx.previous();
|
|
55
|
+
const op = opTok.value;
|
|
56
|
+
const right = this.parseComparison();
|
|
57
|
+
if (op === "@=" || op === "@!") {
|
|
58
|
+
if (this.isPrimitiveLiteral(expr) || this.isPrimitiveLiteral(right)) {
|
|
59
|
+
throw new ParseError(`Reference identity operator '${op}' cannot be used with primitive values; use '#=' or '#!' for value equality`, opTok.span);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
expr = {
|
|
63
|
+
kind: "BinaryExpression",
|
|
64
|
+
operator: op,
|
|
65
|
+
left: expr,
|
|
66
|
+
right,
|
|
67
|
+
span: { start: expr.span.start, end: right.span.end },
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
return expr;
|
|
71
|
+
}
|
|
72
|
+
parseComparison() {
|
|
73
|
+
let expr = this.parseAdditive();
|
|
74
|
+
while (this.ctx.match(TokenType.LT, TokenType.LTE, TokenType.GT, TokenType.GTE)) {
|
|
75
|
+
const op = this.ctx.previous().value;
|
|
76
|
+
const right = this.parseAdditive();
|
|
77
|
+
expr = {
|
|
78
|
+
kind: "BinaryExpression",
|
|
79
|
+
operator: op,
|
|
80
|
+
left: expr,
|
|
81
|
+
right,
|
|
82
|
+
span: { start: expr.span.start, end: right.span.end },
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
return expr;
|
|
86
|
+
}
|
|
87
|
+
parseAdditive() {
|
|
88
|
+
let expr = this.parseMultiplicative();
|
|
89
|
+
while (this.ctx.match(TokenType.PLUS, TokenType.MINUS)) {
|
|
90
|
+
const op = this.ctx.previous().value;
|
|
91
|
+
const right = this.parseMultiplicative();
|
|
92
|
+
expr = {
|
|
93
|
+
kind: "BinaryExpression",
|
|
94
|
+
operator: op,
|
|
95
|
+
left: expr,
|
|
96
|
+
right,
|
|
97
|
+
span: { start: expr.span.start, end: right.span.end },
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
return expr;
|
|
101
|
+
}
|
|
102
|
+
parseMultiplicative() {
|
|
103
|
+
let expr = this.parseExponent();
|
|
104
|
+
while (this.ctx.match(TokenType.STAR, TokenType.SLASH, TokenType.PERCENT)) {
|
|
105
|
+
const op = this.ctx.previous().value;
|
|
106
|
+
const right = this.parseExponent();
|
|
107
|
+
expr = {
|
|
108
|
+
kind: "BinaryExpression",
|
|
109
|
+
operator: op,
|
|
110
|
+
left: expr,
|
|
111
|
+
right,
|
|
112
|
+
span: { start: expr.span.start, end: right.span.end },
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
return expr;
|
|
116
|
+
}
|
|
117
|
+
parseExponent() {
|
|
118
|
+
let expr = this.parseUnary();
|
|
119
|
+
if (this.ctx.match(TokenType.STARSTAR)) {
|
|
120
|
+
const right = this.parseExponent(); // Right-associative
|
|
121
|
+
expr = {
|
|
122
|
+
kind: "BinaryExpression",
|
|
123
|
+
operator: "**",
|
|
124
|
+
left: expr,
|
|
125
|
+
right,
|
|
126
|
+
span: { start: expr.span.start, end: right.span.end },
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
return expr;
|
|
130
|
+
}
|
|
131
|
+
parseUnary() {
|
|
132
|
+
if (this.ctx.match(TokenType.NOT, TokenType.MINUS)) {
|
|
133
|
+
const start = this.ctx.previous().span.start;
|
|
134
|
+
const op = this.ctx.previous().value;
|
|
135
|
+
const arg = this.parseUnary();
|
|
136
|
+
return {
|
|
137
|
+
kind: "UnaryExpression",
|
|
138
|
+
operator: op,
|
|
139
|
+
argument: arg,
|
|
140
|
+
span: { start, end: arg.span.end },
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
return this.ctx.parsePostfix();
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=operator-expressions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operator-expressions.js","sources":["../../src/parser/operator-expressions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,MAAM,OAAO,cAAc;IACI,GAAG;IAAhC,YAA6B,GAAW;mBAAX,GAAG;IAAW,CAAC;IAErC,cAAc;QACnB,IAAI,IAAI,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QAClC,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC;YACpC,MAAM,KAAK,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;YACrC,IAAI,GAAG;gBACL,IAAI,EAAE,kBAAkB;gBACxB,QAAQ,EAAE,IAAI;gBACd,IAAI,EAAE,IAAI;gBACV,KAAK;gBACL,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE;aACtD,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAEO,eAAe;QACrB,IAAI,IAAI,GAAG,IAAI,CAAC,aAAa,EAAE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lockStatement, type DotPathExpression, type EffectBlockExpression, type EffectTypeNode, type ErrorDeclaration, type ExportDefaultDeclaration, type ExportFromDeclaration, type Expression, type FunctionBody, type FunctionExpression, type Identifier, type ImportDeclaration, type ImportedTsSchema, type IndexExpression, type JSXElement, type JSXSelfClosingElement, type Parameter, type ParBlockExpression, type Pattern, type Position, type Program, type RecordPattern, type RecordSchema, type SchemaBody, type SchemaDeclaration, type ServiceDeclaration, type StringLiteral, type StructuralUnionSchema, type TaggedUnionSchema, type TopLevelDeclaration, type TsDerivedSchema, type TypeNode, type TypeParameter, type UpperIdentifier, type WhenStatement } from "../ast/types.js";
|
|
2
|
+
import { type Token, TokenType } from "../lexer/tokens.js";
|
|
3
|
+
import { EFFECT_BARE_EXPR_DIAGNOSTIC, EFFECT_RETURN_DIAGNOSTIC, FUNCTION_RETURN_DIAGNOSTIC, ParseError } from "./errors.js";
|
|
4
|
+
export { EFFECT_BARE_EXPR_DIAGNOSTIC, EFFECT_RETURN_DIAGNOSTIC, FUNCTION_RETURN_DIAGNOSTIC, ParseError, };
|
|
5
|
+
export interface ParserOptions {
|
|
6
|
+
throwOnError?: boolean;
|
|
7
|
+
isFunx?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare class Parser {
|
|
10
|
+
tokens: Token[];
|
|
11
|
+
current: number;
|
|
12
|
+
diagnostics: ParseError[];
|
|
13
|
+
functionDepth: number;
|
|
14
|
+
private scopeStack;
|
|
15
|
+
enterScope(): void;
|
|
16
|
+
exitScope(): void;
|
|
17
|
+
addMutableVariable(name: string): void;
|
|
18
|
+
addMutDraftVariable(name: string): void;
|
|
19
|
+
isMutableVariable(name: string): boolean;
|
|
20
|
+
isMutDraftVariable(name: string): boolean;
|
|
21
|
+
parseBindingPattern(): RecordPattern | ArrayPattern;
|
|
22
|
+
parsingBraceEffect: boolean;
|
|
23
|
+
hasDefaultExport: boolean;
|
|
24
|
+
allowDefaultedRecordFields: boolean;
|
|
25
|
+
recordTypeDepth: number;
|
|
26
|
+
private options;
|
|
27
|
+
constructor(tokens: Token[], _filename?: string, _source?: string, options?: ParserOptions);
|
|
28
|
+
getDiagnostics(): ParseError[];
|
|
29
|
+
synchronize(): void;
|
|
30
|
+
parse(optionsOrThrowOnError?: boolean | ParserOptions): Program;
|
|
31
|
+
parseTopLevelDeclaration(): TopLevelDeclaration;
|
|
32
|
+
isExportFrom(): boolean;
|
|
33
|
+
parseExportFrom(start: Position): ExportFromDeclaration;
|
|
34
|
+
parseExportDefaultDeclaration(start: Position): ExportDefaultDeclaration;
|
|
35
|
+
parseDeclaration(isJs?: boolean, isTs?: boolean): TopLevelDeclaration;
|
|
36
|
+
/** Consumes the raw TypeScript payload the lexer captured after 'ts'. */
|
|
37
|
+
consumeTsCode(): Token;
|
|
38
|
+
parseImportDeclaration(): ImportDeclaration;
|
|
39
|
+
parseImportSource(): StringLiteral;
|
|
40
|
+
parseSchemaDeclaration(isTs?: boolean, tsStart?: Position): SchemaDeclaration;
|
|
41
|
+
parseTsDerivedSchema(): TsDerivedSchema;
|
|
42
|
+
parseSchemaBody(): SchemaBody;
|
|
43
|
+
parseImportedTsSchema(): ImportedTsSchema;
|
|
44
|
+
parseRecordSchema(): RecordSchema;
|
|
45
|
+
parseStructuralUnionSchema(): StructuralUnionSchema;
|
|
46
|
+
parseTaggedUnionSchema(): TaggedUnionSchema;
|
|
47
|
+
parseErrorDeclaration(): ErrorDeclaration;
|
|
48
|
+
parseServiceDeclaration(): ServiceDeclaration;
|
|
49
|
+
parseBindingDeclaration(isJs?: boolean): BindingDeclaration;
|
|
50
|
+
private expressionToBindingTarget;
|
|
51
|
+
private parseValueParameter;
|
|
52
|
+
validateValueParameters(params: Parameter[]): void;
|
|
53
|
+
parseWhenStatement(): WhenStatement;
|
|
54
|
+
parseExpression(): Expression;
|
|
55
|
+
private parseMutBlock;
|
|
56
|
+
parsePostfix(): Expression;
|
|
57
|
+
parsePrimary(): Expression;
|
|
58
|
+
private parseRecordLiteral;
|
|
59
|
+
private parseArrayLiteral;
|
|
60
|
+
private tryParseTupleScrutinee;
|
|
61
|
+
private parseMatchExpression;
|
|
62
|
+
parsePattern(): Pattern;
|
|
63
|
+
parseEffectBlock(): EffectBlockExpression;
|
|
64
|
+
parseParBlock(): ParBlockExpression;
|
|
65
|
+
isBraceBlock(): boolean;
|
|
66
|
+
isAssignmentStart(): boolean;
|
|
67
|
+
parseAssignmentTarget(): Identifier | DotPathExpression | IndexExpression;
|
|
68
|
+
collectPatternVariables(pat: Pattern | BindingTarget): string[];
|
|
69
|
+
isDestructuringBindingStart(): boolean;
|
|
70
|
+
isDestructuringEffectBindStart(): boolean;
|
|
71
|
+
parseFunctionBody(requireExplicitReturn?: boolean): FunctionBody;
|
|
72
|
+
parseBraceBlock(requireExplicitReturn?: boolean): BlockStatement;
|
|
73
|
+
parseIndentedBlock(requireExplicitReturn?: boolean): BlockStatement;
|
|
74
|
+
parseTypeNode(): TypeNode;
|
|
75
|
+
parseUnionType(): TypeNode;
|
|
76
|
+
parseIntersectionType(): TypeNode;
|
|
77
|
+
parseFunctionTypeNode(): TypeNode;
|
|
78
|
+
parsePrimaryType(): TypeNode;
|
|
79
|
+
parseEffectTypeNode(): EffectTypeNode;
|
|
80
|
+
parseGenericFunctionExpression(): FunctionExpression;
|
|
81
|
+
isGenericCallableStart(): boolean;
|
|
82
|
+
parseTypeParameters(): TypeParameter[];
|
|
83
|
+
parseJsxElement(): JSXElement | JSXSelfClosingElement;
|
|
84
|
+
parseIdentifier(): Identifier;
|
|
85
|
+
parseUpperIdentifier(): UpperIdentifier;
|
|
86
|
+
parseAnyIdentifier(): Identifier | UpperIdentifier;
|
|
87
|
+
parsePropertyIdentifier(): Identifier | UpperIdentifier;
|
|
88
|
+
parseRecordKeyIdentifier(): Identifier;
|
|
89
|
+
parseStringLiteral(): StringLiteral;
|
|
90
|
+
private parseTemplateLiteral;
|
|
91
|
+
private isTypeArgumentListBeforeTemplate;
|
|
92
|
+
private parseTypeArguments;
|
|
93
|
+
skipNewlines(): void;
|
|
94
|
+
consumeNewlineOrEof(message?: string): void;
|
|
95
|
+
match(...types: TokenType[]): boolean;
|
|
96
|
+
check(type: TokenType): boolean;
|
|
97
|
+
advance(): Token;
|
|
98
|
+
isAtEnd(): boolean;
|
|
99
|
+
peek(): Token;
|
|
100
|
+
peekAhead(n: number): Token;
|
|
101
|
+
previous(): Token;
|
|
102
|
+
consume(type: TokenType, message: string): Token;
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sources":["../../src/parser/parser.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,cAAc,EAEnB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,qBAAqB,EAI1B,KAAK,SAAS,EACd,KAAK,kBAAkB,EACvB,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,OAAO,EAGZ,KAAK,aAAa,EAElB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EAEvB,KAAK,aAAa,EAElB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EAEtB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,aAAa,EACnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,KAAK,KAAK,EAAY,SAAS,EAAE,MAAM,oBAAoB,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