@soundscript/soundscript 0.1.13 → 0.1.15
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/package.json +15 -6
- package/project-transform/index.js +2 -0
- package/project-transform/index.ts +8 -0
- package/project-transform/src/annotation_syntax.js +948 -0
- package/project-transform/src/annotation_syntax.ts +1217 -0
- package/project-transform/src/build_package.js +475 -0
- package/project-transform/src/build_package.ts +683 -0
- package/project-transform/src/bundled/portable-web-globals.d.ts +153 -0
- package/project-transform/src/bundled/runtime_externs.js +220 -0
- package/project-transform/src/bundled/runtime_externs.ts +237 -0
- package/project-transform/src/bundled/sound-libs/lib.decorators.d.ts +385 -0
- package/project-transform/src/bundled/sound-libs/lib.decorators.legacy.d.ts +22 -0
- package/project-transform/src/bundled/sound-libs/lib.dom.asynciterable.d.ts +42 -0
- package/project-transform/src/bundled/sound-libs/lib.dom.d.ts +39440 -0
- package/project-transform/src/bundled/sound-libs/lib.es2015.collection.d.ts +149 -0
- package/project-transform/src/bundled/sound-libs/lib.es2015.core.d.ts +657 -0
- package/project-transform/src/bundled/sound-libs/lib.es2015.d.ts +28 -0
- package/project-transform/src/bundled/sound-libs/lib.es2015.generator.d.ts +77 -0
- package/project-transform/src/bundled/sound-libs/lib.es2015.iterable.d.ts +616 -0
- package/project-transform/src/bundled/sound-libs/lib.es2015.promise.d.ts +80 -0
- package/project-transform/src/bundled/sound-libs/lib.es2015.proxy.d.ts +128 -0
- package/project-transform/src/bundled/sound-libs/lib.es2015.reflect.d.ts +144 -0
- package/project-transform/src/bundled/sound-libs/lib.es2015.symbol.d.ts +46 -0
- package/project-transform/src/bundled/sound-libs/lib.es2015.symbol.wellknown.d.ts +170 -0
- package/project-transform/src/bundled/sound-libs/lib.es2016.array.include.d.ts +116 -0
- package/project-transform/src/bundled/sound-libs/lib.es2016.d.ts +21 -0
- package/project-transform/src/bundled/sound-libs/lib.es2017.arraybuffer.d.ts +21 -0
- package/project-transform/src/bundled/sound-libs/lib.es2017.d.ts +26 -0
- package/project-transform/src/bundled/sound-libs/lib.es2017.date.d.ts +31 -0
- package/project-transform/src/bundled/sound-libs/lib.es2017.object.d.ts +49 -0
- package/project-transform/src/bundled/sound-libs/lib.es2017.string.d.ts +45 -0
- package/project-transform/src/bundled/sound-libs/lib.es2017.typedarrays.d.ts +53 -0
- package/project-transform/src/bundled/sound-libs/lib.es2018.asyncgenerator.d.ts +77 -0
- package/project-transform/src/bundled/sound-libs/lib.es2018.asynciterable.d.ts +57 -0
- package/project-transform/src/bundled/sound-libs/lib.es2018.d.ts +24 -0
- package/project-transform/src/bundled/sound-libs/lib.es2018.promise.d.ts +30 -0
- package/project-transform/src/bundled/sound-libs/lib.es2018.regexp.d.ts +37 -0
- package/project-transform/src/bundled/sound-libs/lib.es2019.array.d.ts +79 -0
- package/project-transform/src/bundled/sound-libs/lib.es2019.d.ts +24 -0
- package/project-transform/src/bundled/sound-libs/lib.es2019.object.d.ts +47 -0
- package/project-transform/src/bundled/sound-libs/lib.es2019.string.d.ts +37 -0
- package/project-transform/src/bundled/sound-libs/lib.es2019.symbol.d.ts +24 -0
- package/project-transform/src/bundled/sound-libs/lib.es2020.bigint.d.ts +765 -0
- package/project-transform/src/bundled/sound-libs/lib.es2020.d.ts +27 -0
- package/project-transform/src/bundled/sound-libs/lib.es2020.date.d.ts +42 -0
- package/project-transform/src/bundled/sound-libs/lib.es2020.number.d.ts +28 -0
- package/project-transform/src/bundled/sound-libs/lib.es2020.promise.d.ts +49 -0
- package/project-transform/src/bundled/sound-libs/lib.es2020.string.d.ts +44 -0
- package/project-transform/src/bundled/sound-libs/lib.es2020.symbol.wellknown.d.ts +41 -0
- package/project-transform/src/bundled/sound-libs/lib.es2021.d.ts +23 -0
- package/project-transform/src/bundled/sound-libs/lib.es2021.promise.d.ts +48 -0
- package/project-transform/src/bundled/sound-libs/lib.es2021.string.d.ts +33 -0
- package/project-transform/src/bundled/sound-libs/lib.es2021.weakref.d.ts +78 -0
- package/project-transform/src/bundled/sound-libs/lib.es2022.array.d.ts +121 -0
- package/project-transform/src/bundled/sound-libs/lib.es2022.d.ts +25 -0
- package/project-transform/src/bundled/sound-libs/lib.es2022.error.d.ts +75 -0
- package/project-transform/src/bundled/sound-libs/lib.es2022.object.d.ts +26 -0
- package/project-transform/src/bundled/sound-libs/lib.es2022.regexp.d.ts +39 -0
- package/project-transform/src/bundled/sound-libs/lib.es2022.string.d.ts +25 -0
- package/project-transform/src/bundled/sound-libs/lib.es2023.array.d.ts +924 -0
- package/project-transform/src/bundled/sound-libs/lib.es2023.collection.d.ts +21 -0
- package/project-transform/src/bundled/sound-libs/lib.es2023.d.ts +22 -0
- package/project-transform/src/bundled/sound-libs/lib.es2024.arraybuffer.d.ts +65 -0
- package/project-transform/src/bundled/sound-libs/lib.es2024.collection.d.ts +29 -0
- package/project-transform/src/bundled/sound-libs/lib.es2024.d.ts +26 -0
- package/project-transform/src/bundled/sound-libs/lib.es2024.object.d.ts +33 -0
- package/project-transform/src/bundled/sound-libs/lib.es2024.promise.d.ts +35 -0
- package/project-transform/src/bundled/sound-libs/lib.es2024.regexp.d.ts +25 -0
- package/project-transform/src/bundled/sound-libs/lib.es2024.string.d.ts +29 -0
- package/project-transform/src/bundled/sound-libs/lib.es5.d.ts +4924 -0
- package/project-transform/src/bundled/sound_stdlib.js +142 -0
- package/project-transform/src/bundled/sound_stdlib.ts +180 -0
- package/project-transform/src/checker/analyze_project.js +1361 -0
- package/project-transform/src/checker/analyze_project.ts +2246 -0
- package/project-transform/src/checker/diagnostics.js +112 -0
- package/project-transform/src/checker/diagnostics.ts +222 -0
- package/project-transform/src/checker/engine/context.js +235 -0
- package/project-transform/src/checker/engine/context.ts +340 -0
- package/project-transform/src/checker/engine/diagnostic_codes.js +72 -0
- package/project-transform/src/checker/engine/diagnostic_codes.ts +95 -0
- package/project-transform/src/checker/engine/facts.js +35 -0
- package/project-transform/src/checker/engine/facts.ts +48 -0
- package/project-transform/src/checker/engine/types.js +1 -0
- package/project-transform/src/checker/engine/types.ts +485 -0
- package/project-transform/src/checker/proof_escape_hatch_diagnostics.js +104 -0
- package/project-transform/src/checker/proof_escape_hatch_diagnostics.ts +173 -0
- package/project-transform/src/checker/rules/async_surface.js +231 -0
- package/project-transform/src/checker/rules/async_surface.ts +335 -0
- package/project-transform/src/checker/rules/class_lifecycle.js +798 -0
- package/project-transform/src/checker/rules/class_lifecycle.ts +1276 -0
- package/project-transform/src/checker/rules/directive_validation.js +571 -0
- package/project-transform/src/checker/rules/directive_validation.ts +938 -0
- package/project-transform/src/checker/rules/directives.js +23 -0
- package/project-transform/src/checker/rules/directives.ts +25 -0
- package/project-transform/src/checker/rules/flow.js +202 -0
- package/project-transform/src/checker/rules/flow.ts +333 -0
- package/project-transform/src/checker/rules/flow_facts.js +601 -0
- package/project-transform/src/checker/rules/flow_facts.ts +978 -0
- package/project-transform/src/checker/rules/flow_invalidation.js +1119 -0
- package/project-transform/src/checker/rules/flow_invalidation.ts +2150 -0
- package/project-transform/src/checker/rules/flow_shared.js +2822 -0
- package/project-transform/src/checker/rules/flow_shared.ts +4383 -0
- package/project-transform/src/checker/rules/foreign_boundary.js +120 -0
- package/project-transform/src/checker/rules/foreign_boundary.ts +196 -0
- package/project-transform/src/checker/rules/foreign_projection.js +279 -0
- package/project-transform/src/checker/rules/foreign_projection.ts +425 -0
- package/project-transform/src/checker/rules/generated_helpers.js +13 -0
- package/project-transform/src/checker/rules/generated_helpers.ts +18 -0
- package/project-transform/src/checker/rules/index.js +35 -0
- package/project-transform/src/checker/rules/index.ts +49 -0
- package/project-transform/src/checker/rules/namespace_object.js +845 -0
- package/project-transform/src/checker/rules/namespace_object.ts +1224 -0
- package/project-transform/src/checker/rules/non_ordinary_recovery.js +1328 -0
- package/project-transform/src/checker/rules/non_ordinary_recovery.ts +2391 -0
- package/project-transform/src/checker/rules/null_prototype.js +3 -0
- package/project-transform/src/checker/rules/null_prototype.ts +6 -0
- package/project-transform/src/checker/rules/overloads.js +181 -0
- package/project-transform/src/checker/rules/overloads.ts +317 -0
- package/project-transform/src/checker/rules/predicate_verification.js +691 -0
- package/project-transform/src/checker/rules/predicate_verification.ts +1088 -0
- package/project-transform/src/checker/rules/prototype_hardening.js +237 -0
- package/project-transform/src/checker/rules/prototype_hardening.ts +343 -0
- package/project-transform/src/checker/rules/receiver_discipline.js +263 -0
- package/project-transform/src/checker/rules/receiver_discipline.ts +356 -0
- package/project-transform/src/checker/rules/relations.js +6861 -0
- package/project-transform/src/checker/rules/relations.ts +12158 -0
- package/project-transform/src/checker/rules/resolved_builtins.js +274 -0
- package/project-transform/src/checker/rules/resolved_builtins.ts +438 -0
- package/project-transform/src/checker/rules/trust.js +217 -0
- package/project-transform/src/checker/rules/trust.ts +301 -0
- package/project-transform/src/checker/rules/type_guards.js +173 -0
- package/project-transform/src/checker/rules/type_guards.ts +257 -0
- package/project-transform/src/checker/rules/universal.js +17 -0
- package/project-transform/src/checker/rules/universal.ts +22 -0
- package/project-transform/src/checker/rules/unsafe_value_origin.js +80 -0
- package/project-transform/src/checker/rules/unsafe_value_origin.ts +125 -0
- package/project-transform/src/checker/rules/unsound_imports.js +218 -0
- package/project-transform/src/checker/rules/unsound_imports.ts +301 -0
- package/project-transform/src/checker/rules/unsound_syntax.js +1695 -0
- package/project-transform/src/checker/rules/unsound_syntax.ts +2540 -0
- package/project-transform/src/checker/rules/value_types.js +206 -0
- package/project-transform/src/checker/rules/value_types.ts +407 -0
- package/project-transform/src/checker/timing.js +43 -0
- package/project-transform/src/checker/timing.ts +78 -0
- package/project-transform/src/checker/unsupported_feature_messages.js +337 -0
- package/project-transform/src/checker/unsupported_feature_messages.ts +531 -0
- package/project-transform/src/cli.js +892 -0
- package/project-transform/src/cli.ts +1476 -0
- package/project-transform/src/compiler/compile_project.js +319 -0
- package/project-transform/src/compiler/compile_project.ts +508 -0
- package/project-transform/src/compiler/errors.js +10 -0
- package/project-transform/src/compiler/errors.ts +29 -0
- package/project-transform/src/compiler/ir.js +1 -0
- package/project-transform/src/compiler/ir.ts +1526 -0
- package/project-transform/src/compiler/lower.js +30550 -0
- package/project-transform/src/compiler/lower.ts +43645 -0
- package/project-transform/src/compiler/lower_arrays.js +140 -0
- package/project-transform/src/compiler/lower_arrays.ts +190 -0
- package/project-transform/src/compiler/lower_strings.js +121 -0
- package/project-transform/src/compiler/lower_strings.ts +198 -0
- package/project-transform/src/compiler/lower_tagged.js +329 -0
- package/project-transform/src/compiler/lower_tagged.ts +427 -0
- package/project-transform/src/compiler/lower_views.js +171 -0
- package/project-transform/src/compiler/lower_views.ts +251 -0
- package/project-transform/src/compiler/object_keys.js +25 -0
- package/project-transform/src/compiler/object_keys.ts +35 -0
- package/project-transform/src/compiler/runtime_ir.js +30 -0
- package/project-transform/src/compiler/runtime_ir.ts +727 -0
- package/project-transform/src/compiler/tagged_boundary.js +18 -0
- package/project-transform/src/compiler/tagged_boundary.ts +37 -0
- package/project-transform/src/compiler/toolchain.js +170 -0
- package/project-transform/src/compiler/toolchain.ts +229 -0
- package/project-transform/src/compiler/unicode_case_data.js +2102 -0
- package/project-transform/src/compiler/unicode_case_data.ts +2112 -0
- package/project-transform/src/compiler/wasm_js_host_runtime.js +656 -0
- package/project-transform/src/compiler/wasm_js_host_runtime.ts +762 -0
- package/project-transform/src/compiler/wat_arrays.js +3132 -0
- package/project-transform/src/compiler/wat_arrays.ts +3768 -0
- package/project-transform/src/compiler/wat_emitter.js +17952 -0
- package/project-transform/src/compiler/wat_emitter.ts +22812 -0
- package/project-transform/src/compiler/wat_strings.js +129 -0
- package/project-transform/src/compiler/wat_strings.ts +187 -0
- package/project-transform/src/compiler/wat_tagged.js +548 -0
- package/project-transform/src/compiler/wat_tagged.ts +674 -0
- package/project-transform/src/compiler_generator_runner.js +153 -0
- package/project-transform/src/compiler_generator_runner.ts +171 -0
- package/project-transform/src/compiler_object_test_helpers.js +69 -0
- package/project-transform/src/compiler_object_test_helpers.ts +96 -0
- package/project-transform/src/compiler_promise_runner.js +2116 -0
- package/project-transform/src/compiler_promise_runner.ts +2184 -0
- package/project-transform/src/compiler_test_helpers.js +854 -0
- package/project-transform/src/compiler_test_helpers.ts +1087 -0
- package/project-transform/src/config.js +568 -0
- package/project-transform/src/config.ts +892 -0
- package/project-transform/src/diagnostic_metadata.js +67 -0
- package/project-transform/src/diagnostic_metadata.ts +99 -0
- package/project-transform/src/diagnostic_reference.js +1368 -0
- package/project-transform/src/diagnostic_reference.ts +1523 -0
- package/project-transform/src/editor_diagnostics_worker.js +176 -0
- package/project-transform/src/editor_diagnostics_worker.ts +250 -0
- package/project-transform/src/editor_projection.js +224 -0
- package/project-transform/src/editor_projection.ts +421 -0
- package/project-transform/src/frontend/builtin_expanded_program_test_cleanup.js +47 -0
- package/project-transform/src/frontend/builtin_expanded_program_test_cleanup.ts +72 -0
- package/project-transform/src/frontend/builtin_macro_support.js +842 -0
- package/project-transform/src/frontend/builtin_macro_support.ts +1386 -0
- package/project-transform/src/frontend/builtin_macros.js +409 -0
- package/project-transform/src/frontend/builtin_macros.ts +542 -0
- package/project-transform/src/frontend/component_poc_runtime.js +279 -0
- package/project-transform/src/frontend/component_poc_runtime.ts +372 -0
- package/project-transform/src/frontend/css_macro.js +148 -0
- package/project-transform/src/frontend/css_macro.ts +222 -0
- package/project-transform/src/frontend/derive_macros.js +2072 -0
- package/project-transform/src/frontend/derive_macros.ts +3188 -0
- package/project-transform/src/frontend/embedded_fragment_support.js +106 -0
- package/project-transform/src/frontend/embedded_fragment_support.ts +172 -0
- package/project-transform/src/frontend/error_normalization.js +403 -0
- package/project-transform/src/frontend/error_normalization.ts +832 -0
- package/project-transform/src/frontend/error_stdlib_support.js +1 -0
- package/project-transform/src/frontend/error_stdlib_support.ts +6 -0
- package/project-transform/src/frontend/expand_project.js +169 -0
- package/project-transform/src/frontend/expand_project.ts +248 -0
- package/project-transform/src/frontend/format_soundscript.js +297 -0
- package/project-transform/src/frontend/format_soundscript.ts +582 -0
- package/project-transform/src/frontend/graphql_macro.js +174 -0
- package/project-transform/src/frontend/graphql_macro.ts +253 -0
- package/project-transform/src/frontend/hash_context.js +83 -0
- package/project-transform/src/frontend/hash_context.ts +113 -0
- package/project-transform/src/frontend/hkt_macro.js +448 -0
- package/project-transform/src/frontend/hkt_macro.ts +897 -0
- package/project-transform/src/frontend/import_binding_usage.js +190 -0
- package/project-transform/src/frontend/import_binding_usage.ts +277 -0
- package/project-transform/src/frontend/macro_advanced_backend_adapter.js +58 -0
- package/project-transform/src/frontend/macro_advanced_backend_adapter.ts +123 -0
- package/project-transform/src/frontend/macro_advanced_context.js +826 -0
- package/project-transform/src/frontend/macro_advanced_context.ts +1102 -0
- package/project-transform/src/frontend/macro_advanced_output.js +21 -0
- package/project-transform/src/frontend/macro_advanced_output.ts +41 -0
- package/project-transform/src/frontend/macro_api.js +353 -0
- package/project-transform/src/frontend/macro_api.ts +1722 -0
- package/project-transform/src/frontend/macro_api_internal.js +35 -0
- package/project-transform/src/frontend/macro_api_internal.ts +80 -0
- package/project-transform/src/frontend/macro_api_module_support.js +39 -0
- package/project-transform/src/frontend/macro_api_module_support.ts +65 -0
- package/project-transform/src/frontend/macro_backend_adapter.js +272 -0
- package/project-transform/src/frontend/macro_backend_adapter.ts +420 -0
- package/project-transform/src/frontend/macro_context.js +816 -0
- package/project-transform/src/frontend/macro_context.ts +1105 -0
- package/project-transform/src/frontend/macro_debug.js +99 -0
- package/project-transform/src/frontend/macro_debug.ts +157 -0
- package/project-transform/src/frontend/macro_definition_support.js +28 -0
- package/project-transform/src/frontend/macro_definition_support.ts +73 -0
- package/project-transform/src/frontend/macro_errors.js +40 -0
- package/project-transform/src/frontend/macro_errors.ts +70 -0
- package/project-transform/src/frontend/macro_expander.js +919 -0
- package/project-transform/src/frontend/macro_expander.ts +1611 -0
- package/project-transform/src/frontend/macro_factory_support.js +176 -0
- package/project-transform/src/frontend/macro_factory_support.ts +263 -0
- package/project-transform/src/frontend/macro_host_ast_internal.js +64 -0
- package/project-transform/src/frontend/macro_host_ast_internal.ts +109 -0
- package/project-transform/src/frontend/macro_index.js +27 -0
- package/project-transform/src/frontend/macro_index.ts +50 -0
- package/project-transform/src/frontend/macro_loader.js +281 -0
- package/project-transform/src/frontend/macro_loader.ts +506 -0
- package/project-transform/src/frontend/macro_operand_semantics.js +838 -0
- package/project-transform/src/frontend/macro_operand_semantics.ts +1489 -0
- package/project-transform/src/frontend/macro_output.js +54 -0
- package/project-transform/src/frontend/macro_output.ts +123 -0
- package/project-transform/src/frontend/macro_parser.js +611 -0
- package/project-transform/src/frontend/macro_parser.ts +832 -0
- package/project-transform/src/frontend/macro_resolver.js +69 -0
- package/project-transform/src/frontend/macro_resolver.ts +125 -0
- package/project-transform/src/frontend/macro_rewrite.js +285 -0
- package/project-transform/src/frontend/macro_rewrite.ts +442 -0
- package/project-transform/src/frontend/macro_runtime_support.js +232 -0
- package/project-transform/src/frontend/macro_runtime_support.ts +324 -0
- package/project-transform/src/frontend/macro_scanner.js +393 -0
- package/project-transform/src/frontend/macro_scanner.ts +455 -0
- package/project-transform/src/frontend/macro_semantic_backend_adapter.js +87 -0
- package/project-transform/src/frontend/macro_semantic_backend_adapter.ts +166 -0
- package/project-transform/src/frontend/macro_semantic_context.js +5 -0
- package/project-transform/src/frontend/macro_semantic_context.ts +12 -0
- package/project-transform/src/frontend/macro_semantic_output.js +24 -0
- package/project-transform/src/frontend/macro_semantic_output.ts +47 -0
- package/project-transform/src/frontend/macro_semantic_types.js +1 -0
- package/project-transform/src/frontend/macro_semantic_types.ts +98 -0
- package/project-transform/src/frontend/macro_semantics.js +1172 -0
- package/project-transform/src/frontend/macro_semantics.ts +1502 -0
- package/project-transform/src/frontend/macro_site_kind_support.js +164 -0
- package/project-transform/src/frontend/macro_site_kind_support.ts +255 -0
- package/project-transform/src/frontend/macro_syntax_internal.js +1950 -0
- package/project-transform/src/frontend/macro_syntax_internal.ts +3338 -0
- package/project-transform/src/frontend/macro_templates.js +57 -0
- package/project-transform/src/frontend/macro_templates.ts +143 -0
- package/project-transform/src/frontend/macro_test_helpers.js +82 -0
- package/project-transform/src/frontend/macro_test_helpers.ts +136 -0
- package/project-transform/src/frontend/macro_types.js +1 -0
- package/project-transform/src/frontend/macro_types.ts +103 -0
- package/project-transform/src/frontend/macro_vm.js +39 -0
- package/project-transform/src/frontend/macro_vm.ts +113 -0
- package/project-transform/src/frontend/match_macro.js +885 -0
- package/project-transform/src/frontend/match_macro.ts +1220 -0
- package/project-transform/src/frontend/numeric_normalization.js +824 -0
- package/project-transform/src/frontend/numeric_normalization.ts +1380 -0
- package/project-transform/src/frontend/numeric_prelude.js +278 -0
- package/project-transform/src/frontend/numeric_prelude.ts +370 -0
- package/project-transform/src/frontend/project_frontend.js +2396 -0
- package/project-transform/src/frontend/project_frontend.ts +3776 -0
- package/project-transform/src/frontend/project_macro_support.js +1401 -0
- package/project-transform/src/frontend/project_macro_support.ts +2137 -0
- package/project-transform/src/frontend/sql_macro.js +175 -0
- package/project-transform/src/frontend/sql_macro.ts +254 -0
- package/project-transform/src/frontend/sql_stdlib_support.js +1 -0
- package/project-transform/src/frontend/sql_stdlib_support.ts +6 -0
- package/project-transform/src/frontend/std_package_support.js +228 -0
- package/project-transform/src/frontend/std_package_support.ts +400 -0
- package/project-transform/src/frontend/value_normalization.js +306 -0
- package/project-transform/src/frontend/value_normalization.ts +599 -0
- package/project-transform/src/lsp/project_service.js +4771 -0
- package/project-transform/src/lsp/project_service.ts +7580 -0
- package/project-transform/src/lsp/protocol.js +9 -0
- package/project-transform/src/lsp/protocol.ts +38 -0
- package/project-transform/src/lsp/server.js +355 -0
- package/project-transform/src/lsp/server.ts +671 -0
- package/project-transform/src/lsp/session.js +49 -0
- package/project-transform/src/lsp/session.ts +48 -0
- package/project-transform/src/lsp/timing.js +43 -0
- package/project-transform/src/lsp/timing.ts +76 -0
- package/project-transform/src/lsp/transport.js +205 -0
- package/project-transform/src/lsp/transport.ts +253 -0
- package/project-transform/src/lsp_main.js +5 -0
- package/project-transform/src/lsp_main.ts +7 -0
- package/project-transform/src/macros.d.ts +1 -0
- package/project-transform/src/macros.js +1 -0
- package/project-transform/src/macros.ts +1 -0
- package/project-transform/src/main.js +24 -0
- package/project-transform/src/main.ts +28 -0
- package/project-transform/src/platform/host.js +264 -0
- package/project-transform/src/platform/host.ts +343 -0
- package/project-transform/src/platform/path.js +8 -0
- package/project-transform/src/platform/path.ts +20 -0
- package/project-transform/src/public_macro_api/macro_api.d.ts +1054 -0
- package/project-transform/src/public_macro_api/macro_semantic_types.d.ts +66 -0
- package/project-transform/src/public_macro_api/macro_types.d.ts +70 -0
- package/project-transform/src/run_program.js +14 -0
- package/project-transform/src/run_program.ts +33 -0
- package/project-transform/src/runtime/materialize.js +371 -0
- package/project-transform/src/runtime/materialize.ts +502 -0
- package/project-transform/src/runtime/on_demand.js +203 -0
- package/project-transform/src/runtime/on_demand.ts +305 -0
- package/project-transform/src/runtime/source_maps.js +205 -0
- package/project-transform/src/runtime/source_maps.ts +297 -0
- package/project-transform/src/runtime/transform.js +148 -0
- package/project-transform/src/runtime/transform.ts +295 -0
- package/project-transform/src/service/types.js +1 -0
- package/project-transform/src/service/types.ts +22 -0
- package/project-transform/src/soundscript_packages.js +477 -0
- package/project-transform/src/soundscript_packages.ts +754 -0
- package/project-transform/src/soundscript_runtime_specifiers.js +88 -0
- package/project-transform/src/soundscript_runtime_specifiers.ts +96 -0
- package/project-transform/src/stdlib/async.d.ts +81 -0
- package/project-transform/src/stdlib/async.js +213 -0
- package/project-transform/src/stdlib/async.ts +315 -0
- package/project-transform/src/stdlib/codec.d.ts +32 -0
- package/project-transform/src/stdlib/codec.js +30 -0
- package/project-transform/src/stdlib/codec.ts +76 -0
- package/project-transform/src/stdlib/compare.d.ts +28 -0
- package/project-transform/src/stdlib/compare.js +115 -0
- package/project-transform/src/stdlib/compare.ts +151 -0
- package/project-transform/src/stdlib/css.d.ts +16 -0
- package/project-transform/src/stdlib/css.js +9 -0
- package/project-transform/src/stdlib/css.ts +28 -0
- package/project-transform/src/stdlib/debug.d.ts +2 -0
- package/project-transform/src/stdlib/debug.js +9 -0
- package/project-transform/src/stdlib/debug.ts +10 -0
- package/project-transform/src/stdlib/decode.d.ts +86 -0
- package/project-transform/src/stdlib/decode.js +254 -0
- package/project-transform/src/stdlib/decode.ts +390 -0
- package/project-transform/src/stdlib/derive.d.ts +6 -0
- package/project-transform/src/stdlib/derive.js +7 -0
- package/project-transform/src/stdlib/derive.ts +7 -0
- package/project-transform/src/stdlib/encode.d.ts +100 -0
- package/project-transform/src/stdlib/encode.js +130 -0
- package/project-transform/src/stdlib/encode.ts +259 -0
- package/project-transform/src/stdlib/failures.d.ts +23 -0
- package/project-transform/src/stdlib/failures.js +41 -0
- package/project-transform/src/stdlib/failures.ts +64 -0
- package/project-transform/src/stdlib/fetch.d.ts +67 -0
- package/project-transform/src/stdlib/fetch.js +5 -0
- package/project-transform/src/stdlib/fetch.ts +11 -0
- package/project-transform/src/stdlib/graphql.d.ts +16 -0
- package/project-transform/src/stdlib/graphql.js +9 -0
- package/project-transform/src/stdlib/graphql.ts +28 -0
- package/project-transform/src/stdlib/hash.d.ts +34 -0
- package/project-transform/src/stdlib/hash.js +110 -0
- package/project-transform/src/stdlib/hash.ts +188 -0
- package/project-transform/src/stdlib/hkt.d.ts +40 -0
- package/project-transform/src/stdlib/hkt.js +3 -0
- package/project-transform/src/stdlib/hkt.ts +41 -0
- package/project-transform/src/stdlib/index.d.ts +9 -0
- package/project-transform/src/stdlib/index.js +15 -0
- package/project-transform/src/stdlib/index.ts +23 -0
- package/project-transform/src/stdlib/json.d.ts +125 -0
- package/project-transform/src/stdlib/json.js +764 -0
- package/project-transform/src/stdlib/json.ts +1034 -0
- package/project-transform/src/stdlib/match.d.ts +11 -0
- package/project-transform/src/stdlib/match.js +13 -0
- package/project-transform/src/stdlib/match.ts +26 -0
- package/project-transform/src/stdlib/numerics.d.ts +523 -0
- package/project-transform/src/stdlib/numerics.js +1356 -0
- package/project-transform/src/stdlib/numerics.ts +1937 -0
- package/project-transform/src/stdlib/random.d.ts +19 -0
- package/project-transform/src/stdlib/random.js +3 -0
- package/project-transform/src/stdlib/random.ts +5 -0
- package/project-transform/src/stdlib/result.d.ts +68 -0
- package/project-transform/src/stdlib/result.js +139 -0
- package/project-transform/src/stdlib/result.ts +248 -0
- package/project-transform/src/stdlib/sql.d.ts +22 -0
- package/project-transform/src/stdlib/sql.js +23 -0
- package/project-transform/src/stdlib/sql.ts +53 -0
- package/project-transform/src/stdlib/text.d.ts +24 -0
- package/project-transform/src/stdlib/text.js +3 -0
- package/project-transform/src/stdlib/text.ts +4 -0
- package/project-transform/src/stdlib/thunk.d.ts +2 -0
- package/project-transform/src/stdlib/thunk.js +9 -0
- package/project-transform/src/stdlib/thunk.ts +15 -0
- package/project-transform/src/stdlib/typeclasses.d.ts +57 -0
- package/project-transform/src/stdlib/typeclasses.js +78 -0
- package/project-transform/src/stdlib/typeclasses.ts +173 -0
- package/project-transform/src/stdlib/url.d.ts +37 -0
- package/project-transform/src/stdlib/url.js +3 -0
- package/project-transform/src/stdlib/url.ts +4 -0
- package/project-transform/src/stdlib/value.d.ts +9 -0
- package/project-transform/src/stdlib/value.js +104 -0
- package/project-transform/src/stdlib/value.ts +133 -0
- package/project-transform/src/test_installed_stdlib.js +147 -0
- package/project-transform/src/test_installed_stdlib.ts +245 -0
- package/project-transform/src/test_macro_package_fixture.js +50 -0
- package/project-transform/src/test_macro_package_fixture.ts +68 -0
- package/project-transform/src/value_deep_safe.js +191 -0
- package/project-transform/src/value_deep_safe.ts +273 -0
|
@@ -0,0 +1,816 @@
|
|
|
1
|
+
import { createAnnotationLookup } from '../annotation_syntax.js';
|
|
2
|
+
import { normalizeRuntimeContext } from '../config.js';
|
|
3
|
+
import { pathExistsSync, readBytesSync, readTextFileSync, runtimeEnv } from '../platform/host.js';
|
|
4
|
+
import { dirname, isAbsolute, join, normalize } from '../platform/path.js';
|
|
5
|
+
import { createMacroError } from './macro_errors.js';
|
|
6
|
+
import { parseSingleHostStatement, synthesizeHostNode, } from './macro_host_ast_internal.js';
|
|
7
|
+
import { buildArrowFunctionExprSyntax, buildAssignmentExprSyntax, buildBinaryExprSyntax, buildBlockSyntax, buildBooleanLiteralExprSyntax, buildCallExprSyntax, buildClassFieldSyntax, buildClassGetterSyntax, buildClassMethodSyntax, buildClassSetterSyntax, buildConstDeclStmtSyntax, buildElementAccessExprSyntax, buildExprStmtSyntax, buildForStmtSyntax, buildFunctionDeclSyntax, buildIdentifierExprSyntax, buildIfStmtSyntax, buildLetDeclStmtSyntax, buildNewExprSyntax, buildNullLiteralExprSyntax, buildNumberLiteralExprSyntax, buildObjectLiteralExprSyntax, buildOptionalMethodCallExprSyntax, buildPropertyAccessExprSyntax, buildReturnStmtSyntax, buildStringLiteralExprSyntax, buildThisExprSyntax, buildThrowStmtSyntax, buildUnaryExprSyntax, createArgumentSyntaxFromText, createBareArgumentSyntax, createBlockSyntaxFromText, createClassMemberSyntaxListFromCode, createDeclSyntaxFromText, createExprSyntaxFromText, createInvocationSyntax, createStmtListSyntaxFromCode, createStmtSyntaxFromNode, getHostExpression, getHostNode, getHostStatement, quoteText, updateClassSyntax, } from './macro_syntax_internal.js';
|
|
8
|
+
import { createMacroExprOutput, createMacroStmtListOutput, createMacroStmtOutput, } from './macro_output.js';
|
|
9
|
+
import { parseTemplateOperand } from './macro_templates.js';
|
|
10
|
+
const DEFAULT_MACRO_RUNTIME_CONTEXT = normalizeRuntimeContext({
|
|
11
|
+
externs: [],
|
|
12
|
+
target: 'js-node',
|
|
13
|
+
});
|
|
14
|
+
function sanitizeBindingHint(hint) {
|
|
15
|
+
const sanitized = hint.replace(/[^A-Za-z0-9_$]/g, '_');
|
|
16
|
+
return sanitized.length > 0 ? sanitized : '__sts_macro_tmp';
|
|
17
|
+
}
|
|
18
|
+
function createFreshBindingFactory(seed) {
|
|
19
|
+
let counter = 0;
|
|
20
|
+
return {
|
|
21
|
+
binding(hint) {
|
|
22
|
+
counter += 1;
|
|
23
|
+
return `${sanitizeBindingHint(hint)}_${seed}_${counter}`;
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function createUnsupportedHostAccess(reason) {
|
|
28
|
+
const fail = () => {
|
|
29
|
+
throw new Error(reason);
|
|
30
|
+
};
|
|
31
|
+
return {
|
|
32
|
+
env: {
|
|
33
|
+
get() {
|
|
34
|
+
return fail();
|
|
35
|
+
},
|
|
36
|
+
require() {
|
|
37
|
+
return fail();
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
fs: {
|
|
41
|
+
exists() {
|
|
42
|
+
return fail();
|
|
43
|
+
},
|
|
44
|
+
readBytes() {
|
|
45
|
+
return fail();
|
|
46
|
+
},
|
|
47
|
+
readText() {
|
|
48
|
+
return fail();
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function resolveHostPath(path, options, base = 'macro') {
|
|
54
|
+
if (isAbsolute(path)) {
|
|
55
|
+
throw new Error(`Macro host path "${path}" must be relative to the macro module or project root. Absolute host paths are not supported.`);
|
|
56
|
+
}
|
|
57
|
+
const root = base === 'project' ? options.projectDirectory : dirname(options.macroFileName);
|
|
58
|
+
return normalize(join(root, path));
|
|
59
|
+
}
|
|
60
|
+
export function createHostAccess(options) {
|
|
61
|
+
const textEncoder = new TextEncoder();
|
|
62
|
+
const envSnapshot = options.env ??
|
|
63
|
+
globalThis.__STS_MACRO_ENV__;
|
|
64
|
+
return {
|
|
65
|
+
env: {
|
|
66
|
+
get(name) {
|
|
67
|
+
return envSnapshot ? envSnapshot[name] : runtimeEnv(name);
|
|
68
|
+
},
|
|
69
|
+
require(name) {
|
|
70
|
+
const value = envSnapshot ? envSnapshot[name] : runtimeEnv(name);
|
|
71
|
+
if (value === undefined) {
|
|
72
|
+
throw new Error(`Macro host environment variable "${name}" is not set.`);
|
|
73
|
+
}
|
|
74
|
+
return value;
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
fs: {
|
|
78
|
+
exists(path, pathOptions = {}) {
|
|
79
|
+
const resolvedPath = resolveHostPath(path, options, pathOptions.base);
|
|
80
|
+
if (options.fileExists) {
|
|
81
|
+
return options.fileExists(resolvedPath);
|
|
82
|
+
}
|
|
83
|
+
return pathExistsSync(resolvedPath);
|
|
84
|
+
},
|
|
85
|
+
readBytes(path, pathOptions = {}) {
|
|
86
|
+
const resolvedPath = resolveHostPath(path, options, pathOptions.base);
|
|
87
|
+
const bytes = options.readBytes?.(resolvedPath);
|
|
88
|
+
if (bytes !== undefined) {
|
|
89
|
+
return bytes;
|
|
90
|
+
}
|
|
91
|
+
const text = options.readFile?.(resolvedPath);
|
|
92
|
+
if (text !== undefined) {
|
|
93
|
+
return textEncoder.encode(text);
|
|
94
|
+
}
|
|
95
|
+
return readBytesSync(resolvedPath);
|
|
96
|
+
},
|
|
97
|
+
readText(path, pathOptions = {}) {
|
|
98
|
+
const resolvedPath = resolveHostPath(path, options, pathOptions.base);
|
|
99
|
+
const text = options.readFile?.(resolvedPath);
|
|
100
|
+
if (text !== undefined) {
|
|
101
|
+
return text;
|
|
102
|
+
}
|
|
103
|
+
return readTextFileSync(resolvedPath);
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
function createUnsupportedRuntimeAccess(reason, runtimeContext) {
|
|
109
|
+
return {
|
|
110
|
+
backend: runtimeContext.backend,
|
|
111
|
+
default() {
|
|
112
|
+
throw new Error(reason);
|
|
113
|
+
},
|
|
114
|
+
externs() {
|
|
115
|
+
return [...runtimeContext.externs];
|
|
116
|
+
},
|
|
117
|
+
host: runtimeContext.host,
|
|
118
|
+
named() {
|
|
119
|
+
throw new Error(reason);
|
|
120
|
+
},
|
|
121
|
+
namespace() {
|
|
122
|
+
throw new Error(reason);
|
|
123
|
+
},
|
|
124
|
+
target: runtimeContext.target,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
function createRuntimeTracker(build, runtimeResolver, runtimeContext) {
|
|
128
|
+
if (!runtimeResolver) {
|
|
129
|
+
return {
|
|
130
|
+
access: createUnsupportedRuntimeAccess('This macro requires runtime import resolution, but no prepared program or macro module metadata was available.', runtimeContext),
|
|
131
|
+
snapshot() {
|
|
132
|
+
return [];
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
const activeRuntimeResolver = runtimeResolver;
|
|
137
|
+
const byKey = new Map();
|
|
138
|
+
function record(kind, specifier, exportName) {
|
|
139
|
+
const resolved = activeRuntimeResolver.resolve({ exportName, kind, specifier });
|
|
140
|
+
byKey.set(`${resolved.kind}\u0000${resolved.specifier}\u0000${resolved.exportName ?? ''}`, resolved);
|
|
141
|
+
return build.identifier(resolved.localName);
|
|
142
|
+
}
|
|
143
|
+
return {
|
|
144
|
+
access: {
|
|
145
|
+
backend: runtimeContext.backend,
|
|
146
|
+
default(specifier) {
|
|
147
|
+
return record('default', specifier);
|
|
148
|
+
},
|
|
149
|
+
externs() {
|
|
150
|
+
return [...runtimeContext.externs];
|
|
151
|
+
},
|
|
152
|
+
host: runtimeContext.host,
|
|
153
|
+
named(specifier, exportName) {
|
|
154
|
+
return record('named', specifier, exportName);
|
|
155
|
+
},
|
|
156
|
+
namespace(specifier) {
|
|
157
|
+
return record('namespace', specifier);
|
|
158
|
+
},
|
|
159
|
+
target: runtimeContext.target,
|
|
160
|
+
},
|
|
161
|
+
snapshot() {
|
|
162
|
+
return [...byKey.values()];
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
function sliceSpan(text, span) {
|
|
167
|
+
return text.slice(span.start, span.end);
|
|
168
|
+
}
|
|
169
|
+
function getLineAndColumn(text, position) {
|
|
170
|
+
let line = 1;
|
|
171
|
+
let column = 1;
|
|
172
|
+
for (let index = 0; index < position; index += 1) {
|
|
173
|
+
if (text[index] === '\n') {
|
|
174
|
+
line += 1;
|
|
175
|
+
column = 1;
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
column += 1;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return { column, line };
|
|
182
|
+
}
|
|
183
|
+
function attachedAnnotationsForNode(node) {
|
|
184
|
+
const hostNode = getHostNode(node);
|
|
185
|
+
return hostNode
|
|
186
|
+
? createAnnotationLookup(hostNode.getSourceFile()).getAttachedAnnotations(hostNode)
|
|
187
|
+
: [];
|
|
188
|
+
}
|
|
189
|
+
function toInvocationForm(invocation) {
|
|
190
|
+
switch (invocation.invocationKind) {
|
|
191
|
+
case 'block':
|
|
192
|
+
return 'block';
|
|
193
|
+
case 'arglist':
|
|
194
|
+
return 'arglist';
|
|
195
|
+
case 'arglist+block':
|
|
196
|
+
return 'arglist';
|
|
197
|
+
case 'decl':
|
|
198
|
+
return 'decl';
|
|
199
|
+
case 'arglist+decl':
|
|
200
|
+
return 'arglist_decl';
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
function getPrimaryExprSpan(invocation) {
|
|
204
|
+
if (getBlockSpan(invocation) || getDeclarationSpan(invocation)) {
|
|
205
|
+
return undefined;
|
|
206
|
+
}
|
|
207
|
+
const expressionArguments = invocation.argumentSpans.filter((argument) => argument.kind === 'ExprArg');
|
|
208
|
+
if (expressionArguments.length !== 1 ||
|
|
209
|
+
expressionArguments.length !== invocation.argumentSpans.length) {
|
|
210
|
+
return undefined;
|
|
211
|
+
}
|
|
212
|
+
return expressionArguments[0]?.span;
|
|
213
|
+
}
|
|
214
|
+
function getBlockSpan(invocation) {
|
|
215
|
+
if (invocation.trailingBlockSpan) {
|
|
216
|
+
return invocation.trailingBlockSpan;
|
|
217
|
+
}
|
|
218
|
+
if (invocation.invocationKind === 'block') {
|
|
219
|
+
const [firstArgument] = invocation.argumentSpans;
|
|
220
|
+
if (firstArgument?.kind === 'BlockArg') {
|
|
221
|
+
return firstArgument.span;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return undefined;
|
|
225
|
+
}
|
|
226
|
+
function getDeclarationSpan(invocation) {
|
|
227
|
+
return invocation.declarationSpan;
|
|
228
|
+
}
|
|
229
|
+
function createInvocationView(invocation, originalText) {
|
|
230
|
+
const normalizedArguments = invocation.argumentSpans.filter((argument) => argument.kind === 'ExprArg');
|
|
231
|
+
const args = normalizedArguments.map((argument, index) => createBareArgumentSyntax(index, argument.span, sliceSpan(originalText, argument.span)));
|
|
232
|
+
return {
|
|
233
|
+
args,
|
|
234
|
+
form: toInvocationForm(invocation),
|
|
235
|
+
hasBlock: getBlockSpan(invocation) !== undefined,
|
|
236
|
+
name: invocation.nameText,
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
function createQuoteFactory(fileName) {
|
|
240
|
+
function interpolate(strings, values) {
|
|
241
|
+
let output = '';
|
|
242
|
+
for (let index = 0; index < strings.length; index += 1) {
|
|
243
|
+
output += strings[index] ?? '';
|
|
244
|
+
if (index < values.length) {
|
|
245
|
+
output += quoteText(values[index]);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
return output;
|
|
249
|
+
}
|
|
250
|
+
return {
|
|
251
|
+
block(strings, ...values) {
|
|
252
|
+
const code = interpolate(strings, values);
|
|
253
|
+
return createBlockSyntaxFromText(fileName, { fileName, start: 0, end: code.length }, code);
|
|
254
|
+
},
|
|
255
|
+
classMembers(strings, ...values) {
|
|
256
|
+
const code = interpolate(strings, values);
|
|
257
|
+
return createClassMemberSyntaxListFromCode(fileName, code);
|
|
258
|
+
},
|
|
259
|
+
decl(strings, ...values) {
|
|
260
|
+
const code = interpolate(strings, values);
|
|
261
|
+
return createDeclSyntaxFromText(fileName, { fileName, start: 0, end: code.length }, code);
|
|
262
|
+
},
|
|
263
|
+
expr(strings, ...values) {
|
|
264
|
+
const code = interpolate(strings, values);
|
|
265
|
+
return createExprSyntaxFromText(fileName, { fileName, start: 0, end: code.length }, code);
|
|
266
|
+
},
|
|
267
|
+
stmt(strings, ...values) {
|
|
268
|
+
const code = interpolate(strings, values);
|
|
269
|
+
const statement = parseSingleHostStatement(fileName, 'macro_quote_stmt', code, 'Quoted macro statements must parse as exactly one host-language statement.');
|
|
270
|
+
return createStmtSyntaxFromNode(statement, statement.getSourceFile(), { fileName, start: 0, end: code.length });
|
|
271
|
+
},
|
|
272
|
+
stmts(strings, ...values) {
|
|
273
|
+
const code = interpolate(strings, values);
|
|
274
|
+
return createStmtListSyntaxFromCode(fileName, 'macro_quote_stmt_list', code);
|
|
275
|
+
},
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
function createBuildFactory(fileName) {
|
|
279
|
+
return {
|
|
280
|
+
assign(target, value) {
|
|
281
|
+
return buildAssignmentExprSyntax(fileName, target, value);
|
|
282
|
+
},
|
|
283
|
+
arrowFunction(parameters, body) {
|
|
284
|
+
return buildArrowFunctionExprSyntax(fileName, parameters, body);
|
|
285
|
+
},
|
|
286
|
+
binary(left, operator, right) {
|
|
287
|
+
return buildBinaryExprSyntax(fileName, left, operator, right);
|
|
288
|
+
},
|
|
289
|
+
block(statements) {
|
|
290
|
+
return buildBlockSyntax(fileName, statements);
|
|
291
|
+
},
|
|
292
|
+
booleanLiteral(value) {
|
|
293
|
+
return buildBooleanLiteralExprSyntax(fileName, value);
|
|
294
|
+
},
|
|
295
|
+
call(callee, args) {
|
|
296
|
+
return buildCallExprSyntax(fileName, callee, args);
|
|
297
|
+
},
|
|
298
|
+
constDecl(name, initializer) {
|
|
299
|
+
return buildConstDeclStmtSyntax(fileName, name, initializer);
|
|
300
|
+
},
|
|
301
|
+
element(object, index) {
|
|
302
|
+
return buildElementAccessExprSyntax(fileName, object, index);
|
|
303
|
+
},
|
|
304
|
+
exprStmt(expression) {
|
|
305
|
+
return buildExprStmtSyntax(fileName, expression);
|
|
306
|
+
},
|
|
307
|
+
field(options) {
|
|
308
|
+
return buildClassFieldSyntax(fileName, options);
|
|
309
|
+
},
|
|
310
|
+
forStmt(options) {
|
|
311
|
+
return buildForStmtSyntax(fileName, options);
|
|
312
|
+
},
|
|
313
|
+
identifier(name) {
|
|
314
|
+
return buildIdentifierExprSyntax(fileName, name);
|
|
315
|
+
},
|
|
316
|
+
ifStmt(options) {
|
|
317
|
+
return buildIfStmtSyntax(fileName, options);
|
|
318
|
+
},
|
|
319
|
+
functionDecl(options) {
|
|
320
|
+
return buildFunctionDeclSyntax(fileName, options);
|
|
321
|
+
},
|
|
322
|
+
getter(options) {
|
|
323
|
+
return buildClassGetterSyntax(fileName, options);
|
|
324
|
+
},
|
|
325
|
+
letDecl(name, initializer) {
|
|
326
|
+
return buildLetDeclStmtSyntax(fileName, name, initializer);
|
|
327
|
+
},
|
|
328
|
+
method(options) {
|
|
329
|
+
return buildClassMethodSyntax(fileName, options);
|
|
330
|
+
},
|
|
331
|
+
newExpr(callee, args) {
|
|
332
|
+
return buildNewExprSyntax(fileName, callee, args);
|
|
333
|
+
},
|
|
334
|
+
nullLiteral() {
|
|
335
|
+
return buildNullLiteralExprSyntax(fileName);
|
|
336
|
+
},
|
|
337
|
+
numberLiteral(value) {
|
|
338
|
+
return buildNumberLiteralExprSyntax(fileName, value);
|
|
339
|
+
},
|
|
340
|
+
objectLiteral(members) {
|
|
341
|
+
return buildObjectLiteralExprSyntax(fileName, members);
|
|
342
|
+
},
|
|
343
|
+
optionalMethodCall(receiver, name, args) {
|
|
344
|
+
return buildOptionalMethodCallExprSyntax(fileName, receiver, name, args);
|
|
345
|
+
},
|
|
346
|
+
property(object, name) {
|
|
347
|
+
return buildPropertyAccessExprSyntax(fileName, object, name);
|
|
348
|
+
},
|
|
349
|
+
returnStmt(expression) {
|
|
350
|
+
return buildReturnStmtSyntax(fileName, expression);
|
|
351
|
+
},
|
|
352
|
+
setter(options) {
|
|
353
|
+
return buildClassSetterSyntax(fileName, options);
|
|
354
|
+
},
|
|
355
|
+
stringLiteral(value) {
|
|
356
|
+
return buildStringLiteralExprSyntax(fileName, value);
|
|
357
|
+
},
|
|
358
|
+
thisExpr() {
|
|
359
|
+
return buildThisExprSyntax(fileName);
|
|
360
|
+
},
|
|
361
|
+
throwStmt(expression) {
|
|
362
|
+
return buildThrowStmtSyntax(fileName, expression);
|
|
363
|
+
},
|
|
364
|
+
unary(operator, value) {
|
|
365
|
+
return buildUnaryExprSyntax(fileName, operator, value);
|
|
366
|
+
},
|
|
367
|
+
updateClass(base, members) {
|
|
368
|
+
return updateClassSyntax(base, members);
|
|
369
|
+
},
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
function createOutputFactory(runtimeTracker) {
|
|
373
|
+
return {
|
|
374
|
+
expr(node) {
|
|
375
|
+
return createMacroExprOutput(synthesizeHostNode(getHostExpression(node)), runtimeTracker.snapshot());
|
|
376
|
+
},
|
|
377
|
+
stmt(node) {
|
|
378
|
+
return createMacroStmtOutput(synthesizeHostNode(getHostStatement(node)), runtimeTracker.snapshot());
|
|
379
|
+
},
|
|
380
|
+
stmts(nodes) {
|
|
381
|
+
return createMacroStmtListOutput(nodes.map((node) => synthesizeHostNode(getHostStatement(node))), runtimeTracker.snapshot());
|
|
382
|
+
},
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
export function createMacroContext(resolved, runtimeResolver = null, hostAccess = createUnsupportedHostAccess('This macro requires compile-time host access, but no prepared program or macro module metadata was available.'), runtimeContext = DEFAULT_MACRO_RUNTIME_CONTEXT) {
|
|
386
|
+
const invocation = resolved.placeholder.invocation;
|
|
387
|
+
const originalText = resolved.placeholder.preparedFile.originalText;
|
|
388
|
+
const invocationView = createInvocationView(invocation, originalText);
|
|
389
|
+
const parsedTemplateArgs = new Map();
|
|
390
|
+
const parsedExprArgs = new Map();
|
|
391
|
+
let parsedBlockSyntax;
|
|
392
|
+
let parsedDeclarationSyntax;
|
|
393
|
+
let parsedInvocationSyntax = null;
|
|
394
|
+
const fresh = createFreshBindingFactory(String(resolved.placeholder.id));
|
|
395
|
+
const build = createBuildFactory(invocation.span.fileName);
|
|
396
|
+
const quote = createQuoteFactory(invocation.span.fileName);
|
|
397
|
+
const runtimeTracker = createRuntimeTracker(build, runtimeResolver, runtimeContext);
|
|
398
|
+
const output = createOutputFactory(runtimeTracker);
|
|
399
|
+
const parseTemplateArgForContext = (index) => {
|
|
400
|
+
if (parsedTemplateArgs.has(index)) {
|
|
401
|
+
return parsedTemplateArgs.get(index) ?? null;
|
|
402
|
+
}
|
|
403
|
+
const argument = invocationView.args[index];
|
|
404
|
+
const parsed = argument ? parseTemplateOperand(argument.span, argument.text()) : null;
|
|
405
|
+
parsedTemplateArgs.set(index, parsed);
|
|
406
|
+
return parsed;
|
|
407
|
+
};
|
|
408
|
+
const parseExprArgForContext = (index) => {
|
|
409
|
+
const existing = parsedExprArgs.get(index);
|
|
410
|
+
if (existing) {
|
|
411
|
+
return existing;
|
|
412
|
+
}
|
|
413
|
+
const argument = invocationView.args[index];
|
|
414
|
+
if (!argument) {
|
|
415
|
+
throw new Error(`Macro "${invocation.nameText}" argument ${index} is out of range.`);
|
|
416
|
+
}
|
|
417
|
+
const syntax = createArgumentSyntaxFromText(index, invocation.span.fileName, argument.span, argument.text());
|
|
418
|
+
parsedExprArgs.set(index, syntax);
|
|
419
|
+
return syntax;
|
|
420
|
+
};
|
|
421
|
+
const parseBlockSyntaxForContext = () => {
|
|
422
|
+
if (parsedBlockSyntax !== undefined) {
|
|
423
|
+
if (parsedBlockSyntax === null) {
|
|
424
|
+
throw new Error(`Macro "${invocation.nameText}" does not have a block argument.`);
|
|
425
|
+
}
|
|
426
|
+
return parsedBlockSyntax;
|
|
427
|
+
}
|
|
428
|
+
const blockSpan = getBlockSpan(invocation);
|
|
429
|
+
if (!blockSpan) {
|
|
430
|
+
parsedBlockSyntax = null;
|
|
431
|
+
throw new Error(`Macro "${invocation.nameText}" does not have a block argument.`);
|
|
432
|
+
}
|
|
433
|
+
parsedBlockSyntax = createBlockSyntaxFromText(invocation.span.fileName, blockSpan, sliceSpan(originalText, blockSpan));
|
|
434
|
+
return parsedBlockSyntax;
|
|
435
|
+
};
|
|
436
|
+
const parseDeclarationSyntaxForContext = () => {
|
|
437
|
+
if (parsedDeclarationSyntax !== undefined) {
|
|
438
|
+
if (parsedDeclarationSyntax === null) {
|
|
439
|
+
throw new Error(`Macro "${invocation.nameText}" does not have a declaration argument.`);
|
|
440
|
+
}
|
|
441
|
+
return parsedDeclarationSyntax;
|
|
442
|
+
}
|
|
443
|
+
const declarationSpan = getDeclarationSpan(invocation);
|
|
444
|
+
if (!declarationSpan) {
|
|
445
|
+
parsedDeclarationSyntax = null;
|
|
446
|
+
throw new Error(`Macro "${invocation.nameText}" does not have a declaration argument.`);
|
|
447
|
+
}
|
|
448
|
+
parsedDeclarationSyntax = createDeclSyntaxFromText(invocation.span.fileName, declarationSpan, sliceSpan(originalText, declarationSpan));
|
|
449
|
+
return parsedDeclarationSyntax;
|
|
450
|
+
};
|
|
451
|
+
const parseInvocationSyntaxForContext = () => {
|
|
452
|
+
if (parsedInvocationSyntax) {
|
|
453
|
+
return parsedInvocationSyntax;
|
|
454
|
+
}
|
|
455
|
+
parsedInvocationSyntax = createInvocationSyntax({
|
|
456
|
+
args: invocationView.args.map((_, index) => parseExprArgForContext(index)),
|
|
457
|
+
block: getBlockSpan(invocation) ? parseBlockSyntaxForContext() : null,
|
|
458
|
+
declaration: getDeclarationSpan(invocation) ? parseDeclarationSyntaxForContext() : null,
|
|
459
|
+
form: invocationView.form,
|
|
460
|
+
hasBlock: invocationView.hasBlock,
|
|
461
|
+
name: invocation.nameText,
|
|
462
|
+
span: invocation.span,
|
|
463
|
+
text: sliceSpan(originalText, invocation.span),
|
|
464
|
+
});
|
|
465
|
+
return parsedInvocationSyntax;
|
|
466
|
+
};
|
|
467
|
+
return {
|
|
468
|
+
build,
|
|
469
|
+
fresh,
|
|
470
|
+
host: hostAccess,
|
|
471
|
+
invocation: invocationView,
|
|
472
|
+
kind: invocation.rewriteKind,
|
|
473
|
+
name: invocation.nameText,
|
|
474
|
+
output,
|
|
475
|
+
quote,
|
|
476
|
+
runtime: runtimeTracker.access,
|
|
477
|
+
syntax: {
|
|
478
|
+
annotations(node) {
|
|
479
|
+
return attachedAnnotationsForNode(node);
|
|
480
|
+
},
|
|
481
|
+
arg(index) {
|
|
482
|
+
return parseExprArgForContext(index);
|
|
483
|
+
},
|
|
484
|
+
args() {
|
|
485
|
+
return invocationView.args.map((_, index) => parseExprArgForContext(index));
|
|
486
|
+
},
|
|
487
|
+
block() {
|
|
488
|
+
return parseBlockSyntaxForContext();
|
|
489
|
+
},
|
|
490
|
+
declaration() {
|
|
491
|
+
return parseDeclarationSyntaxForContext();
|
|
492
|
+
},
|
|
493
|
+
primaryExpr() {
|
|
494
|
+
const exprSpan = getPrimaryExprSpan(invocation);
|
|
495
|
+
if (!exprSpan) {
|
|
496
|
+
throw new Error(`Macro "${invocation.nameText}" does not have a primary expression argument.`);
|
|
497
|
+
}
|
|
498
|
+
return parseExprArgForContext(0);
|
|
499
|
+
},
|
|
500
|
+
root() {
|
|
501
|
+
return parseInvocationSyntaxForContext();
|
|
502
|
+
},
|
|
503
|
+
template(index) {
|
|
504
|
+
return parseTemplateArgForContext(index);
|
|
505
|
+
},
|
|
506
|
+
},
|
|
507
|
+
blockSpan() {
|
|
508
|
+
return getBlockSpan(invocation) ?? null;
|
|
509
|
+
},
|
|
510
|
+
declarationSpan() {
|
|
511
|
+
return getDeclarationSpan(invocation) ?? null;
|
|
512
|
+
},
|
|
513
|
+
error(message, node) {
|
|
514
|
+
throw createMacroError(resolved, message, node?.span);
|
|
515
|
+
},
|
|
516
|
+
hasBlock() {
|
|
517
|
+
return invocationView.hasBlock;
|
|
518
|
+
},
|
|
519
|
+
invocationSpan() {
|
|
520
|
+
return invocation.span;
|
|
521
|
+
},
|
|
522
|
+
location() {
|
|
523
|
+
const start = getLineAndColumn(originalText, invocation.span.start);
|
|
524
|
+
return {
|
|
525
|
+
column: start.column,
|
|
526
|
+
filePath: invocation.span.fileName,
|
|
527
|
+
line: start.line,
|
|
528
|
+
};
|
|
529
|
+
},
|
|
530
|
+
parsedSyntax() {
|
|
531
|
+
return parseInvocationSyntaxForContext();
|
|
532
|
+
},
|
|
533
|
+
runtimeImports() {
|
|
534
|
+
return runtimeTracker.snapshot();
|
|
535
|
+
},
|
|
536
|
+
sourceText() {
|
|
537
|
+
return sliceSpan(originalText, invocation.span);
|
|
538
|
+
},
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
export function createSyntaxOnlyMacroContext(invocation, originalText, runtimeContext = DEFAULT_MACRO_RUNTIME_CONTEXT) {
|
|
542
|
+
const base = (() => {
|
|
543
|
+
const invocationView = createInvocationView(invocation, originalText);
|
|
544
|
+
const parsedTemplateArgs = new Map();
|
|
545
|
+
const parsedExprArgs = new Map();
|
|
546
|
+
let parsedBlockSyntax;
|
|
547
|
+
let parsedDeclarationSyntax;
|
|
548
|
+
let parsedInvocationSyntax = null;
|
|
549
|
+
const fresh = createFreshBindingFactory(`${invocation.span.start}_${invocation.span.end}`);
|
|
550
|
+
const build = createBuildFactory(invocation.span.fileName);
|
|
551
|
+
const quote = createQuoteFactory(invocation.span.fileName);
|
|
552
|
+
const runtimeTracker = createRuntimeTracker(build, null, runtimeContext);
|
|
553
|
+
const output = createOutputFactory(runtimeTracker);
|
|
554
|
+
const parseTemplateArgForContext = (index) => {
|
|
555
|
+
if (parsedTemplateArgs.has(index)) {
|
|
556
|
+
return parsedTemplateArgs.get(index) ?? null;
|
|
557
|
+
}
|
|
558
|
+
const argument = invocationView.args[index];
|
|
559
|
+
const parsed = argument ? parseTemplateOperand(argument.span, argument.text()) : null;
|
|
560
|
+
parsedTemplateArgs.set(index, parsed);
|
|
561
|
+
return parsed;
|
|
562
|
+
};
|
|
563
|
+
const parseExprArgForContext = (index) => {
|
|
564
|
+
const existing = parsedExprArgs.get(index);
|
|
565
|
+
if (existing) {
|
|
566
|
+
return existing;
|
|
567
|
+
}
|
|
568
|
+
const argument = invocationView.args[index];
|
|
569
|
+
if (!argument) {
|
|
570
|
+
throw new Error(`Macro "${invocation.nameText}" argument ${index} is out of range.`);
|
|
571
|
+
}
|
|
572
|
+
const syntax = createArgumentSyntaxFromText(index, invocation.span.fileName, argument.span, argument.text());
|
|
573
|
+
parsedExprArgs.set(index, syntax);
|
|
574
|
+
return syntax;
|
|
575
|
+
};
|
|
576
|
+
const parseBlockSyntaxForContext = () => {
|
|
577
|
+
if (parsedBlockSyntax !== undefined) {
|
|
578
|
+
if (parsedBlockSyntax === null) {
|
|
579
|
+
throw new Error(`Macro "${invocation.nameText}" does not have a block argument.`);
|
|
580
|
+
}
|
|
581
|
+
return parsedBlockSyntax;
|
|
582
|
+
}
|
|
583
|
+
const blockSpan = getBlockSpan(invocation);
|
|
584
|
+
if (!blockSpan) {
|
|
585
|
+
parsedBlockSyntax = null;
|
|
586
|
+
throw new Error(`Macro "${invocation.nameText}" does not have a block argument.`);
|
|
587
|
+
}
|
|
588
|
+
parsedBlockSyntax = createBlockSyntaxFromText(invocation.span.fileName, blockSpan, sliceSpan(originalText, blockSpan));
|
|
589
|
+
return parsedBlockSyntax;
|
|
590
|
+
};
|
|
591
|
+
const parseDeclarationSyntaxForContext = () => {
|
|
592
|
+
if (parsedDeclarationSyntax !== undefined) {
|
|
593
|
+
if (parsedDeclarationSyntax === null) {
|
|
594
|
+
throw new Error(`Macro "${invocation.nameText}" does not have a declaration argument.`);
|
|
595
|
+
}
|
|
596
|
+
return parsedDeclarationSyntax;
|
|
597
|
+
}
|
|
598
|
+
const declarationSpan = getDeclarationSpan(invocation);
|
|
599
|
+
if (!declarationSpan) {
|
|
600
|
+
parsedDeclarationSyntax = null;
|
|
601
|
+
throw new Error(`Macro "${invocation.nameText}" does not have a declaration argument.`);
|
|
602
|
+
}
|
|
603
|
+
parsedDeclarationSyntax = createDeclSyntaxFromText(invocation.span.fileName, declarationSpan, sliceSpan(originalText, declarationSpan));
|
|
604
|
+
return parsedDeclarationSyntax;
|
|
605
|
+
};
|
|
606
|
+
const parseInvocationSyntaxForContext = () => {
|
|
607
|
+
if (parsedInvocationSyntax) {
|
|
608
|
+
return parsedInvocationSyntax;
|
|
609
|
+
}
|
|
610
|
+
parsedInvocationSyntax = createInvocationSyntax({
|
|
611
|
+
args: invocationView.args.map((_, index) => parseExprArgForContext(index)),
|
|
612
|
+
block: getBlockSpan(invocation) ? parseBlockSyntaxForContext() : null,
|
|
613
|
+
declaration: getDeclarationSpan(invocation) ? parseDeclarationSyntaxForContext() : null,
|
|
614
|
+
form: invocationView.form,
|
|
615
|
+
hasBlock: invocationView.hasBlock,
|
|
616
|
+
name: invocation.nameText,
|
|
617
|
+
span: invocation.span,
|
|
618
|
+
text: sliceSpan(originalText, invocation.span),
|
|
619
|
+
});
|
|
620
|
+
return parsedInvocationSyntax;
|
|
621
|
+
};
|
|
622
|
+
return {
|
|
623
|
+
build,
|
|
624
|
+
fresh,
|
|
625
|
+
host: createUnsupportedHostAccess('This macro requires compile-time host access, but only syntax-only context was available.'),
|
|
626
|
+
invocation: invocationView,
|
|
627
|
+
kind: invocation.rewriteKind,
|
|
628
|
+
name: invocation.nameText,
|
|
629
|
+
output,
|
|
630
|
+
quote,
|
|
631
|
+
runtime: runtimeTracker.access,
|
|
632
|
+
syntax: {
|
|
633
|
+
annotations(node) {
|
|
634
|
+
return attachedAnnotationsForNode(node);
|
|
635
|
+
},
|
|
636
|
+
arg(index) {
|
|
637
|
+
return parseExprArgForContext(index);
|
|
638
|
+
},
|
|
639
|
+
args() {
|
|
640
|
+
return invocationView.args.map((_, index) => parseExprArgForContext(index));
|
|
641
|
+
},
|
|
642
|
+
block() {
|
|
643
|
+
return parseBlockSyntaxForContext();
|
|
644
|
+
},
|
|
645
|
+
declaration() {
|
|
646
|
+
return parseDeclarationSyntaxForContext();
|
|
647
|
+
},
|
|
648
|
+
primaryExpr() {
|
|
649
|
+
const exprSpan = getPrimaryExprSpan(invocation);
|
|
650
|
+
if (!exprSpan) {
|
|
651
|
+
throw new Error(`Macro "${invocation.nameText}" does not have a primary expression argument.`);
|
|
652
|
+
}
|
|
653
|
+
return parseExprArgForContext(0);
|
|
654
|
+
},
|
|
655
|
+
root() {
|
|
656
|
+
return parseInvocationSyntaxForContext();
|
|
657
|
+
},
|
|
658
|
+
template(index) {
|
|
659
|
+
return parseTemplateArgForContext(index);
|
|
660
|
+
},
|
|
661
|
+
},
|
|
662
|
+
blockSpan() {
|
|
663
|
+
return getBlockSpan(invocation) ?? null;
|
|
664
|
+
},
|
|
665
|
+
declarationSpan() {
|
|
666
|
+
return getDeclarationSpan(invocation) ?? null;
|
|
667
|
+
},
|
|
668
|
+
error(message, _node) {
|
|
669
|
+
throw new Error(message);
|
|
670
|
+
},
|
|
671
|
+
hasBlock() {
|
|
672
|
+
return invocationView.hasBlock;
|
|
673
|
+
},
|
|
674
|
+
invocationSpan() {
|
|
675
|
+
return invocation.span;
|
|
676
|
+
},
|
|
677
|
+
location() {
|
|
678
|
+
const start = getLineAndColumn(originalText, invocation.span.start);
|
|
679
|
+
return {
|
|
680
|
+
column: start.column,
|
|
681
|
+
filePath: invocation.span.fileName,
|
|
682
|
+
line: start.line,
|
|
683
|
+
};
|
|
684
|
+
},
|
|
685
|
+
parsedSyntax() {
|
|
686
|
+
return parseInvocationSyntaxForContext();
|
|
687
|
+
},
|
|
688
|
+
runtimeImports() {
|
|
689
|
+
return runtimeTracker.snapshot();
|
|
690
|
+
},
|
|
691
|
+
sourceText() {
|
|
692
|
+
return sliceSpan(originalText, invocation.span);
|
|
693
|
+
},
|
|
694
|
+
};
|
|
695
|
+
})();
|
|
696
|
+
const unsupported = (capability) => {
|
|
697
|
+
throw new Error(`Macro "${invocation.nameText}" cannot use ${capability} in syntax-only formatting contexts.`);
|
|
698
|
+
};
|
|
699
|
+
return {
|
|
700
|
+
...base,
|
|
701
|
+
controlFlow: {
|
|
702
|
+
deferCleanup() {
|
|
703
|
+
return unsupported('controlFlow.deferCleanup');
|
|
704
|
+
},
|
|
705
|
+
freshBinding() {
|
|
706
|
+
return unsupported('controlFlow.freshBinding');
|
|
707
|
+
},
|
|
708
|
+
placement() {
|
|
709
|
+
return unsupported('controlFlow.placement');
|
|
710
|
+
},
|
|
711
|
+
rewriteWithValue() {
|
|
712
|
+
return unsupported('controlFlow.rewriteWithValue');
|
|
713
|
+
},
|
|
714
|
+
},
|
|
715
|
+
reflect: {
|
|
716
|
+
declarationShape() {
|
|
717
|
+
return unsupported('reflect.declarationShape');
|
|
718
|
+
},
|
|
719
|
+
typeShape() {
|
|
720
|
+
return unsupported('reflect.typeShape');
|
|
721
|
+
},
|
|
722
|
+
},
|
|
723
|
+
semantics: {
|
|
724
|
+
argExpanded() {
|
|
725
|
+
return unsupported('semantics.argExpanded');
|
|
726
|
+
},
|
|
727
|
+
argType() {
|
|
728
|
+
return unsupported('semantics.argType');
|
|
729
|
+
},
|
|
730
|
+
awaitedType() {
|
|
731
|
+
return unsupported('semantics.awaitedType');
|
|
732
|
+
},
|
|
733
|
+
classDeclarationOfType() {
|
|
734
|
+
return unsupported('semantics.classDeclarationOfType');
|
|
735
|
+
},
|
|
736
|
+
classifyCanonicalFailureType() {
|
|
737
|
+
return unsupported('semantics.classifyCanonicalFailureType');
|
|
738
|
+
},
|
|
739
|
+
classifyCanonicalResultCarrierType() {
|
|
740
|
+
return unsupported('semantics.classifyCanonicalResultCarrierType');
|
|
741
|
+
},
|
|
742
|
+
classifyCanonicalResultType() {
|
|
743
|
+
return unsupported('semantics.classifyCanonicalResultType');
|
|
744
|
+
},
|
|
745
|
+
classifyTryCarrierType() {
|
|
746
|
+
return unsupported('semantics.classifyTryCarrierType');
|
|
747
|
+
},
|
|
748
|
+
exprType() {
|
|
749
|
+
return unsupported('semantics.exprType');
|
|
750
|
+
},
|
|
751
|
+
enclosingFunction() {
|
|
752
|
+
return unsupported('semantics.enclosingFunction');
|
|
753
|
+
},
|
|
754
|
+
enclosingFunctionCanonicalResult() {
|
|
755
|
+
return unsupported('semantics.enclosingFunctionCanonicalResult');
|
|
756
|
+
},
|
|
757
|
+
finiteCases() {
|
|
758
|
+
return unsupported('semantics.finiteCases');
|
|
759
|
+
},
|
|
760
|
+
isAssignable() {
|
|
761
|
+
return unsupported('semantics.isAssignable');
|
|
762
|
+
},
|
|
763
|
+
localDeclarationHasAnnotation() {
|
|
764
|
+
return unsupported('semantics.localDeclarationHasAnnotation');
|
|
765
|
+
},
|
|
766
|
+
nullType() {
|
|
767
|
+
return unsupported('semantics.nullType');
|
|
768
|
+
},
|
|
769
|
+
parameterType() {
|
|
770
|
+
return unsupported('semantics.parameterType');
|
|
771
|
+
},
|
|
772
|
+
primaryExprEnclosingFunction() {
|
|
773
|
+
return unsupported('semantics.primaryExprEnclosingFunction');
|
|
774
|
+
},
|
|
775
|
+
primaryExprEnclosingFunctionCanonicalResult() {
|
|
776
|
+
return unsupported('semantics.primaryExprEnclosingFunctionCanonicalResult');
|
|
777
|
+
},
|
|
778
|
+
primaryExprExpanded() {
|
|
779
|
+
return unsupported('semantics.primaryExprExpanded');
|
|
780
|
+
},
|
|
781
|
+
primaryExprPrelude() {
|
|
782
|
+
return unsupported('semantics.primaryExprPrelude');
|
|
783
|
+
},
|
|
784
|
+
primaryExprCanonicalResultCarrier() {
|
|
785
|
+
return unsupported('semantics.primaryExprCanonicalResultCarrier');
|
|
786
|
+
},
|
|
787
|
+
primaryExprCanonicalResult() {
|
|
788
|
+
return unsupported('semantics.primaryExprCanonicalResult');
|
|
789
|
+
},
|
|
790
|
+
primaryExprContainsMacroInvocations() {
|
|
791
|
+
return unsupported('semantics.primaryExprContainsMacroInvocations');
|
|
792
|
+
},
|
|
793
|
+
primaryExprTryCarrier() {
|
|
794
|
+
return unsupported('semantics.primaryExprTryCarrier');
|
|
795
|
+
},
|
|
796
|
+
primaryExprType() {
|
|
797
|
+
return unsupported('semantics.primaryExprType');
|
|
798
|
+
},
|
|
799
|
+
readSet() {
|
|
800
|
+
return unsupported('semantics.readSet');
|
|
801
|
+
},
|
|
802
|
+
undefinedType() {
|
|
803
|
+
return unsupported('semantics.undefinedType');
|
|
804
|
+
},
|
|
805
|
+
valueBindingCallableInScope() {
|
|
806
|
+
return unsupported('semantics.valueBindingCallableInScope');
|
|
807
|
+
},
|
|
808
|
+
valueBindingInScope() {
|
|
809
|
+
return unsupported('semantics.valueBindingInScope');
|
|
810
|
+
},
|
|
811
|
+
writeSet() {
|
|
812
|
+
return unsupported('semantics.writeSet');
|
|
813
|
+
},
|
|
814
|
+
},
|
|
815
|
+
};
|
|
816
|
+
}
|