semantifold 0.1.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -10
- package/build/index.d.ts +32 -3
- package/build/index.d.ts.map +1 -1
- package/build/index.js +99 -4
- package/build/src/acceptance.d.ts +32 -0
- package/build/src/acceptance.d.ts.map +1 -0
- package/build/src/acceptance.js +358 -0
- package/build/src/array.d.ts +7 -0
- package/build/src/array.d.ts.map +1 -0
- package/build/src/array.js +18 -0
- package/build/src/artifact-path.d.ts +13 -0
- package/build/src/artifact-path.d.ts.map +1 -0
- package/build/src/artifact-path.js +30 -0
- package/build/src/artifacts.d.ts +7 -0
- package/build/src/artifacts.d.ts.map +1 -0
- package/build/src/artifacts.js +389 -0
- package/build/src/backends/c-runtime.d.ts +3 -0
- package/build/src/backends/c-runtime.d.ts.map +1 -0
- package/build/src/backends/c-runtime.js +151 -0
- package/build/src/backends/c-validation.d.ts +12 -0
- package/build/src/backends/c-validation.d.ts.map +1 -0
- package/build/src/backends/c-validation.js +85 -0
- package/build/src/backends/c.d.ts +31 -0
- package/build/src/backends/c.d.ts.map +1 -0
- package/build/src/backends/c.js +308 -0
- package/build/src/backends/cpp-runtime.d.ts +3 -0
- package/build/src/backends/cpp-runtime.d.ts.map +1 -0
- package/build/src/backends/cpp-runtime.js +99 -0
- package/build/src/backends/cpp-validation.d.ts +9 -0
- package/build/src/backends/cpp-validation.d.ts.map +1 -0
- package/build/src/backends/cpp-validation.js +74 -0
- package/build/src/backends/cpp.d.ts +16 -0
- package/build/src/backends/cpp.d.ts.map +1 -0
- package/build/src/backends/cpp.js +285 -0
- package/build/src/backends/csharp.d.ts +20 -0
- package/build/src/backends/csharp.d.ts.map +1 -0
- package/build/src/backends/csharp.js +259 -0
- package/build/src/backends/go.d.ts +20 -0
- package/build/src/backends/go.d.ts.map +1 -0
- package/build/src/backends/go.js +374 -0
- package/build/src/backends/identifiers.d.ts +12 -0
- package/build/src/backends/identifiers.d.ts.map +1 -1
- package/build/src/backends/identifiers.js +79 -2
- package/build/src/backends/index.d.ts.map +1 -1
- package/build/src/backends/index.js +27 -37
- package/build/src/backends/native-validation.d.ts +9 -0
- package/build/src/backends/native-validation.d.ts.map +1 -0
- package/build/src/backends/native-validation.js +59 -0
- package/build/src/backends/ordered-expressions.d.ts +74 -0
- package/build/src/backends/ordered-expressions.d.ts.map +1 -0
- package/build/src/backends/ordered-expressions.js +159 -0
- package/build/src/backends/python.d.ts +8 -0
- package/build/src/backends/python.d.ts.map +1 -0
- package/build/src/backends/python.js +162 -0
- package/build/src/backends/scalars.d.ts.map +1 -1
- package/build/src/backends/scalars.js +8 -2
- package/build/src/backends/shared.d.ts.map +1 -1
- package/build/src/backends/shared.js +67 -19
- package/build/src/binary-mapping.d.ts +32 -0
- package/build/src/binary-mapping.d.ts.map +1 -0
- package/build/src/binary-mapping.js +285 -0
- package/build/src/diagnostic.d.ts +36 -4
- package/build/src/diagnostic.d.ts.map +1 -1
- package/build/src/diagnostic.js +42 -3
- package/build/src/frontends/c-parser.d.ts +20 -0
- package/build/src/frontends/c-parser.d.ts.map +1 -0
- package/build/src/frontends/c-parser.js +14 -0
- package/build/src/frontends/c.d.ts +220 -0
- package/build/src/frontends/c.d.ts.map +1 -0
- package/build/src/frontends/c.js +750 -0
- package/build/src/frontends/cpp-parser.d.ts +11 -0
- package/build/src/frontends/cpp-parser.d.ts.map +1 -0
- package/build/src/frontends/cpp-parser.js +15 -0
- package/build/src/frontends/cpp.d.ts +227 -0
- package/build/src/frontends/cpp.d.ts.map +1 -0
- package/build/src/frontends/cpp.js +784 -0
- package/build/src/frontends/csharp.d.ts +14 -0
- package/build/src/frontends/csharp.d.ts.map +1 -0
- package/build/src/frontends/csharp.js +708 -0
- package/build/src/frontends/go.d.ts +15 -0
- package/build/src/frontends/go.d.ts.map +1 -0
- package/build/src/frontends/go.js +712 -0
- package/build/src/frontends/index.d.ts.map +1 -1
- package/build/src/frontends/index.js +5 -23
- package/build/src/frontends/python.d.ts +14 -0
- package/build/src/frontends/python.d.ts.map +1 -0
- package/build/src/frontends/python.js +615 -0
- package/build/src/frontends/scalars.d.ts.map +1 -1
- package/build/src/frontends/scalars.js +21 -1
- package/build/src/language-registry.d.ts +113 -0
- package/build/src/language-registry.d.ts.map +1 -0
- package/build/src/language-registry.js +421 -0
- package/build/src/mapping.js +3 -2
- package/build/src/semantic/location.d.ts +7 -0
- package/build/src/semantic/location.d.ts.map +1 -1
- package/build/src/semantic/location.js +10 -1
- package/build/src/semantic/provenance.js +3 -3
- package/build/src/semantic/types.d.ts +399 -2
- package/build/src/semantic/types.d.ts.map +1 -1
- package/build/src/semantic/types.js +110 -2
- package/build/src/subprocess.d.ts +38 -0
- package/build/src/subprocess.d.ts.map +1 -0
- package/build/src/subprocess.js +233 -0
- package/build/src/timeout.d.ts +8 -0
- package/build/src/timeout.d.ts.map +1 -0
- package/build/src/timeout.js +11 -0
- package/build/src/toolchains.d.ts +107 -0
- package/build/src/toolchains.d.ts.map +1 -0
- package/build/src/toolchains.js +417 -0
- package/docs/architecture.md +23 -5
- package/docs/c.md +60 -0
- package/docs/cpp.md +61 -0
- package/docs/goals.md +4 -2
- package/docs/language-support.md +46 -6
- package/docs/parser-qualification.md +219 -0
- package/docs/plans/2026-09-05-standard-library-portability.md +46 -0
- package/docs/source-maps.md +38 -5
- package/docs/standard-library-portability.md +190 -0
- package/docs/testing.md +131 -3
- package/index.js +109 -4
- package/node_modules/node-addon-api/LICENSE.md +9 -0
- package/node_modules/node-addon-api/README.md +95 -0
- package/node_modules/node-addon-api/common.gypi +21 -0
- package/node_modules/node-addon-api/except.gypi +25 -0
- package/node_modules/node-addon-api/index.js +14 -0
- package/node_modules/node-addon-api/napi-inl.deprecated.h +186 -0
- package/node_modules/node-addon-api/napi-inl.h +7250 -0
- package/node_modules/node-addon-api/napi.h +3463 -0
- package/node_modules/node-addon-api/node_addon_api.gyp +42 -0
- package/node_modules/node-addon-api/node_api.gyp +9 -0
- package/node_modules/node-addon-api/noexcept.gypi +26 -0
- package/node_modules/node-addon-api/nothing.c +0 -0
- package/node_modules/node-addon-api/package-support.json +21 -0
- package/node_modules/node-addon-api/package.json +481 -0
- package/node_modules/node-addon-api/tools/README.md +73 -0
- package/node_modules/node-addon-api/tools/check-napi.js +99 -0
- package/node_modules/node-addon-api/tools/clang-format.js +71 -0
- package/node_modules/node-addon-api/tools/conversion.js +301 -0
- package/node_modules/node-gyp-build/LICENSE +21 -0
- package/node_modules/node-gyp-build/README.md +58 -0
- package/node_modules/node-gyp-build/SECURITY.md +5 -0
- package/node_modules/node-gyp-build/bin.js +84 -0
- package/node_modules/node-gyp-build/build-test.js +19 -0
- package/node_modules/node-gyp-build/index.js +6 -0
- package/node_modules/node-gyp-build/node-gyp-build.js +207 -0
- package/node_modules/node-gyp-build/optional.js +7 -0
- package/node_modules/node-gyp-build/package.json +43 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/LICENSE +15 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/README.md +7 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/LICENSE +21 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/README.md +90 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/binding.gyp +79 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/index.js +895 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/package.json +62 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/prebuilds/darwin-arm64/tree-sitter.node +0 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/prebuilds/darwin-x64/tree-sitter.node +0 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/prebuilds/linux-x64/tree-sitter.node +0 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/prebuilds/win32-x64/tree-sitter.node +0 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/addon_data.h +47 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/binding.cc +35 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/conversions.cc +140 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/conversions.h +22 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/language.cc +106 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/language.h +17 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/logger.cc +70 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/logger.h +19 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/lookaheaditerator.cc +122 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/lookaheaditerator.h +33 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/node.cc +1056 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/node.h +30 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/parser.cc +298 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/parser.h +35 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/query.cc +383 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/query.h +39 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/tree.cc +307 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/tree.h +45 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/tree_cursor.cc +213 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/src/tree_cursor.h +52 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/tree-sitter.d.ts +211 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/include/tree_sitter/api.h +1266 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/alloc.c +48 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/alloc.h +41 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/array.h +290 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/atomic.h +68 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/clock.h +146 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/error_costs.h +11 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/get_changed_ranges.c +501 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/get_changed_ranges.h +36 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/host.h +21 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/language.c +221 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/language.h +299 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/length.h +52 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lexer.c +419 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lexer.h +49 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lib.c +14 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/node.c +774 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/parser.c +2151 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/parser.h +230 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/point.h +62 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/query.c +4134 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/reduce_action.h +34 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/reusable_node.h +95 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/stack.c +899 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/stack.h +133 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/subtree.c +1060 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/subtree.h +382 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree.c +165 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree.h +31 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree_cursor.c +714 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree_cursor.h +48 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/ICU_SHA +1 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/LICENSE +414 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/README.md +29 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/ptypes.h +1 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/umachine.h +448 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/urename.h +1 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf.h +1 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf16.h +733 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf8.h +881 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode.h +50 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/stdlib-symbols.txt +23 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/stdlib.c +109 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/wasm-stdlib.h +1294 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm_store.c +1823 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm_store.h +31 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/LICENSE +21 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/README.md +18 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/binding.gyp +29 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/bindings/node/binding.cc +20 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/bindings/node/binding_test.js +9 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/bindings/node/index.d.ts +28 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/bindings/node/index.js +11 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/grammar.js +1470 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/package.json +60 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/prebuilds/darwin-arm64/tree-sitter-c.node +0 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/prebuilds/darwin-x64/tree-sitter-c.node +0 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/prebuilds/linux-arm64/tree-sitter-c.node +0 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/prebuilds/linux-x64/tree-sitter-c.node +0 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/prebuilds/win32-arm64/tree-sitter-c.node +0 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/prebuilds/win32-x64/tree-sitter-c.node +0 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/queries/highlights.scm +81 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/queries/tags.scm +9 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/src/grammar.json +9735 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/src/node-types.json +4614 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/src/parser.c +119615 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/src/tree_sitter/alloc.h +54 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/src/tree_sitter/array.h +290 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/src/tree_sitter/parser.h +266 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/tree-sitter-c.wasm +0 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-c/tree-sitter.json +43 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/LICENSE +21 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/README.md +22 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/binding.gyp +30 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/bindings/node/binding.cc +20 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/bindings/node/binding_test.js +9 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/bindings/node/index.d.ts +28 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/bindings/node/index.js +11 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/grammar.js +1436 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/package.json +61 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/prebuilds/darwin-arm64/tree-sitter-cpp.node +0 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/prebuilds/darwin-x64/tree-sitter-cpp.node +0 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/prebuilds/linux-arm64/tree-sitter-cpp.node +0 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/prebuilds/linux-x64/tree-sitter-cpp.node +0 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/prebuilds/win32-arm64/tree-sitter-cpp.node +0 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/prebuilds/win32-x64/tree-sitter-cpp.node +0 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/queries/highlights.scm +70 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/queries/injections.scm +3 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/queries/tags.scm +15 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/src/grammar.json +17084 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/src/node-types.json +7997 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/src/parser.c +530368 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/src/scanner.c +148 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/src/tree_sitter/alloc.h +54 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/src/tree_sitter/array.h +290 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/src/tree_sitter/parser.h +266 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/tree-sitter-cpp.wasm +0 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/node_modules/tree-sitter-cpp/tree-sitter.json +55 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/package.json +22 -0
- package/node_modules/semantifold-tree-sitter-legacy-internal/src/c.js +152 -0
- package/node_modules/tree-sitter/LICENSE +21 -0
- package/node_modules/tree-sitter/README.md +128 -0
- package/node_modules/tree-sitter/binding.gyp +88 -0
- package/node_modules/tree-sitter/index.js +950 -0
- package/node_modules/tree-sitter/package.json +76 -0
- package/node_modules/tree-sitter/prebuilds/darwin-arm64/tree-sitter.node +0 -0
- package/node_modules/tree-sitter/prebuilds/darwin-x64/tree-sitter.node +0 -0
- package/node_modules/tree-sitter/prebuilds/linux-arm64/tree-sitter.node +0 -0
- package/node_modules/tree-sitter/prebuilds/linux-x64/tree-sitter.node +0 -0
- package/node_modules/tree-sitter/prebuilds/win32-arm64/tree-sitter.node +0 -0
- package/node_modules/tree-sitter/prebuilds/win32-x64/tree-sitter.node +0 -0
- package/node_modules/tree-sitter/src/addon_data.h +47 -0
- package/node_modules/tree-sitter/src/binding.cc +35 -0
- package/node_modules/tree-sitter/src/conversions.cc +140 -0
- package/node_modules/tree-sitter/src/conversions.h +22 -0
- package/node_modules/tree-sitter/src/language.cc +105 -0
- package/node_modules/tree-sitter/src/language.h +17 -0
- package/node_modules/tree-sitter/src/logger.cc +70 -0
- package/node_modules/tree-sitter/src/logger.h +19 -0
- package/node_modules/tree-sitter/src/lookaheaditerator.cc +122 -0
- package/node_modules/tree-sitter/src/lookaheaditerator.h +33 -0
- package/node_modules/tree-sitter/src/node.cc +1088 -0
- package/node_modules/tree-sitter/src/node.h +30 -0
- package/node_modules/tree-sitter/src/parser.cc +332 -0
- package/node_modules/tree-sitter/src/parser.h +35 -0
- package/node_modules/tree-sitter/src/query.cc +425 -0
- package/node_modules/tree-sitter/src/query.h +40 -0
- package/node_modules/tree-sitter/src/tree.cc +316 -0
- package/node_modules/tree-sitter/src/tree.h +45 -0
- package/node_modules/tree-sitter/src/tree_cursor.cc +213 -0
- package/node_modules/tree-sitter/src/tree_cursor.h +52 -0
- package/node_modules/tree-sitter/tree-sitter.d.ts +1083 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/include/tree_sitter/api.h +1478 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/alloc.c +48 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/alloc.h +41 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/array.h +291 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/atomic.h +68 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/clock.h +146 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/error_costs.h +11 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/get_changed_ranges.c +523 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/get_changed_ranges.h +36 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/host.h +21 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/language.c +293 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/language.h +293 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/length.h +52 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lexer.c +483 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lexer.h +54 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lib.c +12 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/node.c +875 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/parser.c +2297 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/parser.h +286 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/point.h +48 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/portable/endian.h +241 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/query.c +4347 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/reduce_action.h +34 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/reusable_node.h +95 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/stack.c +912 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/stack.h +133 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/subtree.c +1034 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/subtree.h +399 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree.c +170 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree.h +31 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree_cursor.c +716 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree_cursor.h +48 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/ts_assert.h +11 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/ICU_SHA +1 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/LICENSE +414 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/README.md +29 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/ptypes.h +1 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/umachine.h +448 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/urename.h +1 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf.h +1 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf16.h +733 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf8.h +881 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode.h +75 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/stdlib-symbols.txt +24 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/stdlib.c +137 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/wasm-stdlib.h +1314 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm_store.c +1937 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm_store.h +31 -0
- package/package.json +24 -6
- package/src/acceptance.js +380 -0
- package/src/array.js +19 -0
- package/src/artifact-path.js +34 -0
- package/src/artifacts.js +420 -0
- package/src/backends/c-runtime.js +151 -0
- package/src/backends/c-validation.js +83 -0
- package/src/backends/c.js +308 -0
- package/src/backends/cpp-runtime.js +99 -0
- package/src/backends/cpp-validation.js +70 -0
- package/src/backends/cpp.js +285 -0
- package/src/backends/csharp.js +270 -0
- package/src/backends/go.js +383 -0
- package/src/backends/identifiers.js +80 -1
- package/src/backends/index.js +23 -32
- package/src/backends/native-validation.js +64 -0
- package/src/backends/ordered-expressions.js +161 -0
- package/src/backends/python.js +175 -0
- package/src/backends/scalars.js +8 -1
- package/src/backends/shared.js +64 -17
- package/src/binary-mapping.js +305 -0
- package/src/diagnostic.js +34 -2
- package/src/frontends/c-parser.js +17 -0
- package/src/frontends/c.js +780 -0
- package/src/frontends/cpp-parser.js +18 -0
- package/src/frontends/cpp.js +816 -0
- package/src/frontends/csharp.js +759 -0
- package/src/frontends/go.js +770 -0
- package/src/frontends/index.js +5 -20
- package/src/frontends/python.js +689 -0
- package/src/frontends/scalars.js +20 -0
- package/src/language-registry.js +454 -0
- package/src/mapping.js +2 -1
- package/src/semantic/location.js +10 -0
- package/src/semantic/provenance.js +2 -2
- package/src/semantic/types.js +124 -1
- package/src/subprocess.js +232 -0
- package/src/timeout.js +12 -0
- package/src/toolchains.js +448 -0
- package/tsconfig.json +1 -0
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Semantifold
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Task019 adds independent [C++20 source and target support](docs/cpp.md) (`cpp`): one deterministic `program.cpp`, owned UTF-8 `std::string` values, checked integer arithmetic, exact ordered-expression reparsing, and real Clang O0/O2 sanitizer acceptance. The official CPP grammar shares the existing private isolated parser runtime inside the single root distribution.
|
|
4
|
+
|
|
5
|
+
Semantifold is an early language-neutral semantic code toolkit. The current source tree proves a deliberately small ten-language end-to-end baseline: parse equivalent PHP, Ruby, JavaScript with JSDoc, TypeScript, Java, strictly annotated Python, canonical C#, bounded Go, C17, and C++20 programs into one typed semantic representation, then generate and execute equivalent programs in every target language. The published package remains `semantifold@0.2.0`; Task019 does not publish a release.
|
|
4
6
|
|
|
5
7
|
## Current API
|
|
6
8
|
|
|
@@ -22,7 +24,7 @@ const module = parse({
|
|
|
22
24
|
const javaSource = generate({language: "java", module})
|
|
23
25
|
```
|
|
24
26
|
|
|
25
|
-
`parse` returns parser-independent discriminated semantic nodes with normalized types, source locations, a versioned source registry, and deterministic node/symbol provenance. `generate` accepts that shared module and returns an independently executable source program with its historical bytes unchanged. `generateArtifact` adds an output filename, an authoritative range-based `SemantifoldMapping` v1, and a Source Map v3 sidecar
|
|
27
|
+
`parse` returns parser-independent discriminated semantic nodes with normalized types, source locations, a versioned source registry, and deterministic node/symbol provenance. `generate` accepts that shared module and returns an independently executable source program with its historical bytes unchanged. For each single-artifact target, `generateArtifact` adds an output filename, an authoritative range-based `SemantifoldMapping` v1, and a Source Map v3 sidecar:
|
|
26
28
|
|
|
27
29
|
```js
|
|
28
30
|
import {generateArtifact, originalPositionFor} from "semantifold"
|
|
@@ -31,31 +33,58 @@ const artifact = generateArtifact({language: "java", module})
|
|
|
31
33
|
const original = originalPositionFor(artifact.mapping, {offset: artifact.code.indexOf("label")})
|
|
32
34
|
```
|
|
33
35
|
|
|
34
|
-
Generated output always uses LF. Exact original content, including LF, CRLF, lone CR, and astral UTF-16 coordinates, remains in the source registry and `sourcesContent`. Optional inline/external `sourceMappingURL` directives apply only to JavaScript and TypeScript; PHP, Ruby, and
|
|
36
|
+
Generated output always uses LF. Exact original content, including LF, CRLF, lone CR, and astral UTF-16 coordinates, remains in the source registry and `sourcesContent`. Optional inline/external `sourceMappingURL` directives apply only to JavaScript and TypeScript; PHP, Ruby, Java, Python, C#, Go, C, and CPP use the same rich/v3 model without foreign comments. See [source provenance and mappings](docs/source-maps.md) for schemas, lookups, composition, diagnostics, directives, and compatibility.
|
|
37
|
+
|
|
38
|
+
`supportedLanguages` is the immutable registry-derived list `php`, `ruby`, `javascript`, `typescript`, `java`, `python`, `csharp`, `go`, `c`, and `cpp`. `languageCapabilities` exposes each ID's independent frontend, text-backend, binary-backend, application-backend, and interoperability roles together with artifact multiplicity, round-trip, mapping, acceptance-stage, and toolchain declarations. Unknown IDs use `UNSUPPORTED_LANGUAGE`; a registered ID missing a requested role uses `UNSUPPORTED_ROLE`; an existing backend that cannot represent a semantic module uses `UNSUPPORTED_CAPABILITY`.
|
|
39
|
+
|
|
40
|
+
`generateArtifactSet` is the additive single-module artifact API. Original text targets return an entry artifact with the exact legacy bytes and rich/v3 mappings; an external JavaScript-family map directive also returns the referenced serialized mapping sidecar. C# returns mapped `Program.cs` then synthetic-provenance `Semantifold.csproj`. Go returns exactly two ordered artifacts: fixed synthetic-provenance `go.mod` first, then mapped `main.go`; the fixed module is `example.com/semantifold/generated` with `go 1.26.0` and creates no `go.sum`. C returns mapped `program.c` followed by synthetic `semantifold_runtime.h`. Because C#, Go, and C are deliberately multi-artifact, `generate()` and `generateArtifact()` reject them with `UNSUPPORTED_ROLE`. Go accepts only an omitted filename or exact `main.go`, and C accepts only omitted or exact `program.c`; these multi-artifact backends reject mapping options rather than ignoring them. `createGeneratedArtifactSet` validates multi-file text, binary, mixed loader/binary, and application shapes transactionally: paths are ordered, unique, safe relative POSIX paths with no file/directory prefix collisions; content is explicitly text or bytes; media type, role, generated ownership, and provenance are required; and exactly one artifact has role `entry`. Binary content is held privately and returned as a fresh detached byte view on every read, so caller mutation cannot change validated bytes or their provenance. Generated helper files do not create semantic modules and are not Task 010 projects.
|
|
41
|
+
|
|
42
|
+
Binary/resource provenance uses `SemantifoldByteMapping` v1 through `createByteMapping`, `parseByteMapping`, and `stringifyByteMapping`. Generated ranges are ordered, non-overlapping, half-open byte offsets with semantic identities or explicit synthetic reasons. They are never interpreted as UTF-16 positions.
|
|
43
|
+
|
|
44
|
+
`discoverCanonicalToolchain` and `discoverToolchain` resolve an exact executable from a configured absolute override or one unambiguous canonical PATH command and capture its version. `runAcceptanceStages` materializes a validated artifact set in a unique temporary directory and runs applicable `parse`, `generate`, `restore`, `compile`, `link`, `validate`, `instantiate`, and `execute` stages with exact argument arrays, a deterministic locale/timezone, bounded per-stage timeouts, captured output, no shell, and normalized stage diagnostics. The canonical overrides are `SEMANTIFOLD_PHP`, `SEMANTIFOLD_RUBY`, `SEMANTIFOLD_NODE`, `SEMANTIFOLD_TSC`, `SEMANTIFOLD_JAVAC`, `SEMANTIFOLD_JAVA`, `SEMANTIFOLD_PYTHON`, `SEMANTIFOLD_DOTNET`, `SEMANTIFOLD_GO`, `SEMANTIFOLD_CLANG`, and `SEMANTIFOLD_CLANGPP`; none of these APIs installs or downloads a tool. C# requires .NET SDK major 10, while Go requires Go 1.26.x on Linux/amd64 with matching-GOROOT `gofmt`.
|
|
45
|
+
|
|
46
|
+
This is not general-purpose support for any of the ten languages. The implemented subset is a two-parameter function using explicit integer, boolean, or string types; explicitly typed, initialized scalar locals; plain assignment to mutable locals; ordered lexical blocks; strictly boolean, nested `if` statements with optional `else`; explicit scalar returns; typed scalar operations; a two-argument function call; and sequenced printing. Operations cover integer add/subtract/multiply/negate and ordering, Boolean not/short-circuit and/or, same-type scalar value equality/inequality, and string concatenation. Non-void functions must return on every reachable path, and statements after an unconditional return are rejected. See [language support](docs/language-support.md) before using it on other code.
|
|
35
47
|
|
|
36
|
-
`
|
|
48
|
+
Semantic integers must be JavaScript-safe mathematical integers and have one unsigned zero. Generated JavaScript and TypeScript canonically render scalar output for modules containing negation or multiplication so IEEE-754 `-0` is observed as `0` without folding or rewriting the semantic operation tree. Java generation narrows literals and compile-time-known arithmetic trees further to signed 32-bit `int`. C# uses checked signed-64-bit arithmetic. Go uses exact decimal `int64` literals, rejects compile-time-known results outside signed 64-bit, and otherwise preserves native runtime wrap outside the portable guarantee. Strings are parser-decoded Unicode scalar values and are re-escaped for each target without preserving source quotes or escapes. Equality never coerces and never applies to objects or collections. Division, remainder, exponentiation, bitwise/shift/update/compound operations, ternary/nullish forms, casts/assertions, truthiness, implicit returns, loops, switches, exceptions, and constant folding are unsupported. JavaScript and TypeScript functions must be synchronous and non-generator; Ruby annotations must be immediately associated comment blocks; and PHP accepts only an optional exact `declare(strict_types=1)`. Python requires exact `int`/`bool`/`str` annotations and its exact adjacent immutable carrier. C# requires its exact generated namespace/class shell. Go requires `package main`, at most the exact `fmt` import, explicit `int64`/`bool`/`string` types, final zero-argument `func main()`, and direct `fmt.Println`; assignment occurrence determines source-local mutability, while generated immutable locals carry exact adjacent `// @semantifold-immutable`. Frontends reject syntax instead of dropping receivers, arguments, parameters, declarations, or statements. Before emission, each backend recursively validates blocks, flow, scalar types, typed operations, modeled bindings, mutability, target identifiers, and literal representability.
|
|
37
49
|
|
|
38
|
-
|
|
50
|
+
C17 support uses exact `int64_t`, `bool` and immutable UTF-8 byte slices. Its deterministic `program.c`/header pair preserves left-to-right and short-circuit effects through checked ordered-expression regions, uses checked signed-64-bit arithmetic, and owns concatenation storage until main cleanup. Reparse verifies the complete generated CST before collapsing temporary values. The qualified toolchain is Ubuntu Clang 21.1.8 on Linux x86-64 with mandatory O0/O2 ordinary and sanitizer execution. See the [C source/target profile](docs/c.md) and [portable toolchain commands](docs/testing.md).
|
|
39
51
|
|
|
40
|
-
|
|
52
|
+
## Standard-library portability direction
|
|
53
|
+
|
|
54
|
+
Standard-library portability is planned and is not implemented in `semantifold@0.2.0`. The design is hub-and-spoke, with two integrations per language: a source-facing **language compatibility stdlib/facade** preserves that language's familiar supported API shape in portable executable definitions, while a **target host provider/native binding** implements versioned **canonical Semantifold stdlib contracts/capabilities** with the target's genuine native standard library.
|
|
55
|
+
|
|
56
|
+
For example, planned Ruby-to-PHP compilation would compile a Ruby application with portable Ruby `TCPSocket` and bounded one-string `puts`/`Kernel.puts` compatibility facades through the semantic IR. The generated PHP could retain those source-compatible names in a collision-safe compatibility namespace, call canonical `SocketClient`, text-stream, output, and resource capabilities, and link only the required PHP provider modules. That provider would use native `fsockopen`, `fgets`, and `fclose` for socket operations and native stdout output without adding a duplicate LF. This requires no handwritten Ruby-on-PHP bridge, source-specific loop recognition, or whole-program intelligent refactor. See the [authoritative standard-library portability design](docs/standard-library-portability.md) and [dependency-ordered implementation plan](docs/plans/2026-09-05-standard-library-portability.md).
|
|
41
57
|
|
|
42
58
|
## Development
|
|
43
59
|
|
|
44
|
-
Use Node.js 24 and install with `npm ci`. Specs use `@velocious/testing@0.0.0` and the standalone `velocious-test` runner. Run a focused spec with `npx velocious-test spec/repository-contract.spec.js
|
|
60
|
+
Use Node.js 24 and install with `npm ci`. Specs use `@velocious/testing@0.0.0` and the standalone `velocious-test` runner. Run a focused spec with `npx velocious-test spec/repository-contract.spec.js`. Task 018 local validation runs explicitly named changed/affected spec files sequentially; aggregate `npm test` discovery runs only in TensorBuzz.
|
|
61
|
+
|
|
62
|
+
The aggregate suite includes direct real-toolchain specs that inherit the outer test process locale, so repository validation requires `LANG=C.UTF-8` and `LC_ALL=C.UTF-8`. The canonical container currently exports neither variable. This outer-suite requirement is separate from `runAcceptanceStages`, which normalizes the locale and timezone of every child it owns and does not depend on ambient locale.
|
|
45
63
|
|
|
46
|
-
The
|
|
64
|
+
The local quality/package gate follows the named focused specs documented in [testing](docs/testing.md):
|
|
47
65
|
|
|
48
66
|
```sh
|
|
49
|
-
|
|
67
|
+
export LANG=C.UTF-8
|
|
68
|
+
export LC_ALL=C.UTF-8
|
|
69
|
+
npm run verify:legacy-runtime
|
|
70
|
+
npx velocious-test spec/repository-contract.spec.js
|
|
50
71
|
npm run lint
|
|
51
72
|
npm run typecheck
|
|
52
73
|
npm run build
|
|
53
74
|
npm audit --audit-level=high
|
|
54
75
|
npm ls --omit=dev --all
|
|
76
|
+
npm ls --all
|
|
55
77
|
npm pack --dry-run --json
|
|
78
|
+
git diff --check
|
|
56
79
|
```
|
|
57
80
|
|
|
58
|
-
The
|
|
81
|
+
The one `semantifold@0.2.0` distribution explicitly bundles root `tree-sitter@0.25.1` and a private internal package containing an isolated exact `tree-sitter@0.21.1` plus `tree-sitter-c@0.23.2` and `tree-sitter-cpp@0.23.4` dependency subtree. The private `packages/tree-sitter-legacy` workspace owns source checking and declaration generation, but has no export or publication identity. Its serializer returns only recursively frozen parser-neutral CST data; native parser, tree, node, and language handles stay inside the legacy runtime. The packed-consumer spec installs the real root tarball with a fresh npm cache and proves modern Go and legacy C parsing together without a workspace or registry fallback for the internal package.
|
|
82
|
+
|
|
83
|
+
Because `install-links=true` installs a copy of the private runtime, run `npm ci` again after editing its shipped files under `packages/tree-sitter-legacy/runtime/`. Tests, lint, and `npm pack` reject a stale installed payload with that recovery instruction. The gate compares npm's source file inventory and every file's bytes, including the manifest, serializer, README, and license; it never copies or repairs dependencies itself.
|
|
84
|
+
|
|
85
|
+
Consumers need no Semantifold-specific npm settings: default `npm install`, `npm ls --all`, and subsequent `npm ci` work with `install-links=false`. The repository alone uses `install-links=true` to materialize the local source. Root `acceptDependencies` accepts the exact private `0.1.0` package already present in the bundle; npm still resolves new installations from the declared `file:` source, never from a registry release of the internal name. The cold-consumer proof isolates user/global configuration, verifies the public registry and ordinary default, and repeats dependency, parser, and TypeScript checks after both install and clean reinstall.
|
|
86
|
+
|
|
87
|
+
The execution specs require PHP CLI, Ruby, Python 3, TypeScript, a Java JDK, .NET 10, Clang 21.1.8 with compiler-rt, and Go 1.26 with matching `gofmt` in addition to Node; missing tools are failures. The canonical container provides them: `docker compose up --build --detach`, followed by `docker compose exec dev npm ci` and the commands above.
|
|
59
88
|
|
|
60
89
|
## Documentation
|
|
61
90
|
|
|
@@ -63,8 +92,11 @@ The execution specs require PHP CLI, Ruby, TypeScript, and a Java JDK in additio
|
|
|
63
92
|
- [Architecture](docs/architecture.md)
|
|
64
93
|
- [Coding standards](docs/coding-standards.md)
|
|
65
94
|
- [Language support](docs/language-support.md)
|
|
95
|
+
- [Parser qualification](docs/parser-qualification.md)
|
|
66
96
|
- [Testing](docs/testing.md)
|
|
67
97
|
- [Source provenance and mappings](docs/source-maps.md)
|
|
98
|
+
- [Standard-library portability design](docs/standard-library-portability.md)
|
|
99
|
+
- [Standard-library portability implementation plan](docs/plans/2026-09-05-standard-library-portability.md)
|
|
68
100
|
- [Language feature roadmap](https://github.com/kaspernj/semantifold/blob/master/todo/README.md)
|
|
69
101
|
- [Initial toolchain plan](docs/plans/2026-09-02-initial-toolchain.md)
|
|
70
102
|
|
package/build/index.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
import { SemantifoldDiagnostic } from "./src/diagnostic.js";
|
|
2
|
+
export { SemantifoldDiagnostic };
|
|
3
|
+
export { languageCapabilities, supportedLanguages } from "./src/language-registry.js";
|
|
4
|
+
export { createGeneratedArtifactSet } from "./src/artifacts.js";
|
|
5
|
+
export { createByteMapping, parseByteMapping, stringifyByteMapping } from "./src/binary-mapping.js";
|
|
6
|
+
export { canonicalToolchains, discoverCanonicalToolchain, discoverToolchain } from "./src/toolchains.js";
|
|
7
|
+
export { runAcceptanceStages } from "./src/acceptance.js";
|
|
2
8
|
export { getNodeProvenance, getSymbolProvenance } from "./src/semantic/provenance.js";
|
|
3
9
|
export { primaryLocation } from "./src/semantic/provenance.js";
|
|
4
10
|
export { composeMappings, composeSourceMaps, generatedPositionFor, mappingFromSourceMap, originalPositionFor, parseMapping, remapDiagnostic, remapLocation, spansForNode, spansForSymbol, stringifyMapping, toSourceMapV3 } from "./src/mapping.js";
|
|
5
|
-
/** @type {readonly import("./src/semantic/types.js").SemanticLanguage[]} */
|
|
6
|
-
export declare const supportedLanguages: readonly import("./src/semantic/types.js").SemanticLanguage[];
|
|
7
11
|
/**
|
|
8
12
|
* Parses source into Semantifold's shared semantic representation.
|
|
9
13
|
* @param {object} input - Parse request.
|
|
@@ -51,4 +55,29 @@ export declare function generateArtifact(input: {
|
|
|
51
55
|
language?: import("./src/semantic/types.js").SemanticLanguage;
|
|
52
56
|
}[];
|
|
53
57
|
}): import("./src/semantic/types.js").GeneratedArtifact;
|
|
58
|
+
/**
|
|
59
|
+
* Generates a deterministic artifact set for one semantic module.
|
|
60
|
+
* @param {object} input - Artifact-set generation request.
|
|
61
|
+
* @param {string} input.language - Registered target language or platform ID.
|
|
62
|
+
* @param {import("./src/semantic/types.js").SemanticModule} input.module - Semantic module.
|
|
63
|
+
* @param {"text" | "binary" | "application"} [input.role] - Requested backend artifact role.
|
|
64
|
+
* @param {string} [input.filename] - Safe output path for a text target.
|
|
65
|
+
* @param {"none" | "external" | "inline"} [input.mapDirective] - JavaScript-family map directive.
|
|
66
|
+
* @param {string} [input.sourceMapFilename] - External map filename.
|
|
67
|
+
* @param {{filename: string, content: string, language?: import("./src/semantic/types.js").SemanticLanguage}[]} [input.sources] - Original sources.
|
|
68
|
+
* @returns {import("./src/semantic/types.js").GeneratedArtifactSet} Complete generated set.
|
|
69
|
+
*/
|
|
70
|
+
export declare function generateArtifactSet(input: {
|
|
71
|
+
language: string;
|
|
72
|
+
module: import("./src/semantic/types.js").SemanticModule;
|
|
73
|
+
role?: "text" | "binary" | "application";
|
|
74
|
+
filename?: string;
|
|
75
|
+
mapDirective?: "none" | "external" | "inline";
|
|
76
|
+
sourceMapFilename?: string;
|
|
77
|
+
sources?: {
|
|
78
|
+
filename: string;
|
|
79
|
+
content: string;
|
|
80
|
+
language?: import("./src/semantic/types.js").SemanticLanguage;
|
|
81
|
+
}[];
|
|
82
|
+
}): import("./src/semantic/types.js").GeneratedArtifactSet;
|
|
54
83
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.js"],"names":[],"mappings":"AAKA,OAAO,EAAC,qBAAqB,EAAC,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.js"],"names":[],"mappings":"AAKA,OAAO,EAAC,qBAAqB,EAAC,MAAM,qBAAqB,CAAA;AAKzD,OAAO,EAAC,qBAAqB,EAAC,CAAA;AAC9B,OAAO,EAAC,oBAAoB,EAAE,kBAAkB,EAAC,MAAM,4BAA4B,CAAA;AACnF,OAAO,EAAC,0BAA0B,EAAC,MAAM,oBAAoB,CAAA;AAC7D,OAAO,EAAC,iBAAiB,EAAE,gBAAgB,EAAE,oBAAoB,EAAC,MAAM,yBAAyB,CAAA;AACjG,OAAO,EAAC,mBAAmB,EAAE,0BAA0B,EAAE,iBAAiB,EAAC,MAAM,qBAAqB,CAAA;AACtG,OAAO,EAAC,mBAAmB,EAAC,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAC,iBAAiB,EAAE,mBAAmB,EAAC,MAAM,8BAA8B,CAAA;AACnF,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAA;AAC5D,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,YAAY,EACZ,eAAe,EACf,aAAa,EACb,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,aAAa,EACd,MAAM,kBAAkB,CAAA;AAEzB;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,KAAK,EALxB;IAAsB,QAAQ,EAAtB,MAAM,CACd;IAAkE,QAAQ,EAAlE,OAAO,yBAAyB,EAAE,gBAAgB,CAC1D;IAAsB,MAAM,EAApB,MAAM,CACd;CAEwB,GAFd,OAAO,yBAAyB,EAAE,cA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AQ,CAAC,EAAE,OAAO,yBAAyB,EAAE,gBAAgB,CAAA;KAAC,EAAE,CAC5G;CAEsC,GAF5B,OAAO,yBAAyB,EAAE,oBAAoB,CAsFlE"}
|
package/build/index.js
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
import { parseSource } from "./src/frontends/index.js";
|
|
3
3
|
import { generateArtifactSource, generateSource } from "./src/backends/index.js";
|
|
4
|
-
|
|
4
|
+
import { createGeneratedArtifactSet as constructArtifactSet } from "./src/artifacts.js";
|
|
5
|
+
import { SemantifoldDiagnostic } from "./src/diagnostic.js";
|
|
6
|
+
import { languageRegistry } from "./src/language-registry.js";
|
|
7
|
+
const artifactBackendRoles = new Set(["text", "binary", "application"]);
|
|
8
|
+
export { SemantifoldDiagnostic };
|
|
9
|
+
export { languageCapabilities, supportedLanguages } from "./src/language-registry.js";
|
|
10
|
+
export { createGeneratedArtifactSet } from "./src/artifacts.js";
|
|
11
|
+
export { createByteMapping, parseByteMapping, stringifyByteMapping } from "./src/binary-mapping.js";
|
|
12
|
+
export { canonicalToolchains, discoverCanonicalToolchain, discoverToolchain } from "./src/toolchains.js";
|
|
13
|
+
export { runAcceptanceStages } from "./src/acceptance.js";
|
|
5
14
|
export { getNodeProvenance, getSymbolProvenance } from "./src/semantic/provenance.js";
|
|
6
15
|
export { primaryLocation } from "./src/semantic/provenance.js";
|
|
7
16
|
export { composeMappings, composeSourceMaps, generatedPositionFor, mappingFromSourceMap, originalPositionFor, parseMapping, remapDiagnostic, remapLocation, spansForNode, spansForSymbol, stringifyMapping, toSourceMapV3 } from "./src/mapping.js";
|
|
8
|
-
/** @type {readonly import("./src/semantic/types.js").SemanticLanguage[]} */
|
|
9
|
-
export const supportedLanguages = Object.freeze(["php", "ruby", "javascript", "typescript", "java"]);
|
|
10
17
|
/**
|
|
11
18
|
* Parses source into Semantifold's shared semantic representation.
|
|
12
19
|
* @param {object} input - Parse request.
|
|
@@ -42,4 +49,92 @@ export function generate(input) {
|
|
|
42
49
|
export function generateArtifact(input) {
|
|
43
50
|
return generateArtifactSource(input);
|
|
44
51
|
}
|
|
45
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Generates a deterministic artifact set for one semantic module.
|
|
54
|
+
* @param {object} input - Artifact-set generation request.
|
|
55
|
+
* @param {string} input.language - Registered target language or platform ID.
|
|
56
|
+
* @param {import("./src/semantic/types.js").SemanticModule} input.module - Semantic module.
|
|
57
|
+
* @param {"text" | "binary" | "application"} [input.role] - Requested backend artifact role.
|
|
58
|
+
* @param {string} [input.filename] - Safe output path for a text target.
|
|
59
|
+
* @param {"none" | "external" | "inline"} [input.mapDirective] - JavaScript-family map directive.
|
|
60
|
+
* @param {string} [input.sourceMapFilename] - External map filename.
|
|
61
|
+
* @param {{filename: string, content: string, language?: import("./src/semantic/types.js").SemanticLanguage}[]} [input.sources] - Original sources.
|
|
62
|
+
* @returns {import("./src/semantic/types.js").GeneratedArtifactSet} Complete generated set.
|
|
63
|
+
*/
|
|
64
|
+
export function generateArtifactSet(input) {
|
|
65
|
+
if (!input || typeof input != "object" || Array.isArray(input) || Object.getPrototypeOf(input) != Object.prototype) {
|
|
66
|
+
throw new SemantifoldDiagnostic({
|
|
67
|
+
code: "INVALID_ARTIFACT_SET",
|
|
68
|
+
language: "artifact",
|
|
69
|
+
message: "Artifact-set generation requires a request object."
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
const { filename, language, mapDirective, module, role = "text", sourceMapFilename, sources } = input;
|
|
73
|
+
if (typeof language != "string" || language.length == 0) {
|
|
74
|
+
throw new SemantifoldDiagnostic({
|
|
75
|
+
code: "INVALID_ARTIFACT_SET",
|
|
76
|
+
language: "artifact",
|
|
77
|
+
message: "Artifact-set generation requires a non-empty string language or target ID."
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
if (typeof role != "string" || !artifactBackendRoles.has(role)) {
|
|
81
|
+
throw new SemantifoldDiagnostic({
|
|
82
|
+
code: "INVALID_ARTIFACT_SET",
|
|
83
|
+
language,
|
|
84
|
+
message: "Artifact backend role must be 'text', 'binary', or 'application'."
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
if (role == "text") {
|
|
88
|
+
const record = languageRegistry.record(language);
|
|
89
|
+
if (record.artifactMultiplicity == "multiple") {
|
|
90
|
+
const backend = languageRegistry.resolve(language, "textBackend", module?.location);
|
|
91
|
+
return constructArtifactSet(backend({ filename, language, mapDirective, module, sourceMapFilename, sources }));
|
|
92
|
+
}
|
|
93
|
+
const artifact = generateArtifactSource({
|
|
94
|
+
filename,
|
|
95
|
+
language: /** @type {import("./src/semantic/types.js").SemanticLanguage} */ (language),
|
|
96
|
+
mapDirective,
|
|
97
|
+
module,
|
|
98
|
+
sourceMapFilename,
|
|
99
|
+
sources
|
|
100
|
+
});
|
|
101
|
+
/** @type {import("./src/semantic/types.js").GeneratedSetArtifact[]} */
|
|
102
|
+
const artifacts = [{
|
|
103
|
+
content: artifact.code,
|
|
104
|
+
contentKind: "text",
|
|
105
|
+
mediaType: /** @type {string} */ (record.mediaType),
|
|
106
|
+
ownership: "generated",
|
|
107
|
+
path: artifact.filename,
|
|
108
|
+
provenance: {
|
|
109
|
+
kind: "text",
|
|
110
|
+
mapping: artifact.mapping,
|
|
111
|
+
sourceMap: artifact.sourceMap,
|
|
112
|
+
sourceMapFilename: artifact.sourceMapFilename
|
|
113
|
+
},
|
|
114
|
+
role: "entry"
|
|
115
|
+
}];
|
|
116
|
+
if (mapDirective == "external") {
|
|
117
|
+
artifacts.push({
|
|
118
|
+
content: `${JSON.stringify(artifact.sourceMap)}\n`,
|
|
119
|
+
contentKind: "text",
|
|
120
|
+
mediaType: "application/json",
|
|
121
|
+
ownership: "generated",
|
|
122
|
+
path: artifact.sourceMapFilename,
|
|
123
|
+
provenance: {
|
|
124
|
+
kind: "synthetic",
|
|
125
|
+
reason: "Serialized Source Map v3 projection for the generated entry artifact.",
|
|
126
|
+
relatedOrigins: []
|
|
127
|
+
},
|
|
128
|
+
role: "mapping"
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
return constructArtifactSet({
|
|
132
|
+
artifacts,
|
|
133
|
+
target: language
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
const registryRole = role == "binary" ? "binaryBackend" : "applicationBackend";
|
|
137
|
+
const backend = languageRegistry.resolve(language, registryRole, module?.location);
|
|
138
|
+
return constructArtifactSet(backend({ filename, language, module, sources }));
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9pbmRleC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxZQUFZO0FBRVosT0FBTyxFQUFDLFdBQVcsRUFBQyxNQUFNLDBCQUEwQixDQUFBO0FBQ3BELE9BQU8sRUFBQyxzQkFBc0IsRUFBRSxjQUFjLEVBQUMsTUFBTSx5QkFBeUIsQ0FBQTtBQUM5RSxPQUFPLEVBQUMsMEJBQTBCLElBQUksb0JBQW9CLEVBQUMsTUFBTSxvQkFBb0IsQ0FBQTtBQUNyRixPQUFPLEVBQUMscUJBQXFCLEVBQUMsTUFBTSxxQkFBcUIsQ0FBQTtBQUN6RCxPQUFPLEVBQUMsZ0JBQWdCLEVBQUMsTUFBTSw0QkFBNEIsQ0FBQTtBQUUzRCxNQUFNLG9CQUFvQixHQUFHLElBQUksR0FBRyxDQUFDLENBQUMsTUFBTSxFQUFFLFFBQVEsRUFBRSxhQUFhLENBQUMsQ0FBQyxDQUFBO0FBRXZFLE9BQU8sRUFBQyxxQkFBcUIsRUFBQyxDQUFBO0FBQzlCLE9BQU8sRUFBQyxvQkFBb0IsRUFBRSxrQkFBa0IsRUFBQyxNQUFNLDRCQUE0QixDQUFBO0FBQ25GLE9BQU8sRUFBQywwQkFBMEIsRUFBQyxNQUFNLG9CQUFvQixDQUFBO0FBQzdELE9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act set and runs ordered acceptance stages without a shell.
|
|
4
|
+
* @param {object} input - Acceptance request.
|
|
5
|
+
* @param {import("./semantic/types.js").GeneratedArtifactSet} input.artifacts - Complete input artifacts.
|
|
6
|
+
* @param {Readonly<Record<string, string | undefined>>} [input.environment] - Explicit process environment.
|
|
7
|
+
* @param {{arguments: string[], stage: import("./semantic/types.js").AcceptanceStage, tool: import("./semantic/types.js").DiscoveredToolchain}[]} input.stages - Ordered stages.
|
|
8
|
+
* @param {string} input.target - Target identity.
|
|
9
|
+
* @param {number} [input.timeoutMs] - Per-stage timeout.
|
|
10
|
+
* @returns {Promise<import("./semantic/types.js").AcceptanceResult>} Captured results after cleanup.
|
|
11
|
+
*/
|
|
12
|
+
export declare function runAcceptanceStages(input: {
|
|
13
|
+
artifacts: import("./semantic/types.js").GeneratedArtifactSet;
|
|
14
|
+
environment?: Readonly<Record<string, string | undefined>>;
|
|
15
|
+
stages: {
|
|
16
|
+
arguments: string[];
|
|
17
|
+
stage: import("./semantic/types.js").AcceptanceStage;
|
|
18
|
+
tool: import("./semantic/types.js").DiscoveredToolchain;
|
|
19
|
+
}[];
|
|
20
|
+
target: string;
|
|
21
|
+
timeoutMs?: number;
|
|
22
|
+
}): Promise<import("./semantic/types.js").AcceptanceResult>;
|
|
23
|
+
/**
|
|
24
|
+
* Creates an acceptance runner with instance-owned cleanup behavior.
|
|
25
|
+
* @param {object} dependencies - Internal runner dependencies.
|
|
26
|
+
* @param {typeof rm} dependencies.removeDirectory - Isolated-directory removal operation.
|
|
27
|
+
* @returns {typeof runAcceptanceStages} Acceptance runner.
|
|
28
|
+
*/
|
|
29
|
+
export declare function createAcceptanceRunner({ removeDirectory }: {
|
|
30
|
+
removeDirectory: typeof rm;
|
|
31
|
+
}): typeof runAcceptanceStages;
|
|
32
|
+
//# sourceMappingURL=acceptance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acceptance.d.ts","sourceRoot":"","sources":["../../src/acceptance.js"],"names":[],"mappings":"AAEA,OAAO,EAAiB,EAAE,EAAY,MAAM,kBAAkB,CAAA;AAiB9D;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CAAC,KAAK,EAP5C;IAAkE,SAAS,EAAnE,OAAO,qBAAqB,EAAE,oBAAoB,CAC1D;IAA6D,WAAW,AAAxE,CACA,EADQ,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CACpD;IAAsJ,MAAM,EAApJ;QAAC,SAAS,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,EAAE,OAAO,qBAAqB,EAAE,eAAe,CAAC;QAAC,IAAI,EAAE,OAAO,qBAAqB,EAAE,mBAAmB,CAAA;KAAC,EAAE,CAC9I;IAAsB,MAAM,EAApB,MAAM,CACd;IAAuB,SAAS,AAAhC,CACA,EADQ,MAAM,CACd;CAE4C,GAFlC,OAAO,CAAC,OAAO,qBAAqB,EAAE,gBAAgB,CAAC,CAInE;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,EAAC,eAAe,EAAC,EAHrD;IAAgC,eAAe,EAAvC,OAAO,EAAE,CACjB;CAEqD,GAF3C,OAAO,mBAAmB,CAItC"}
|