semantifold 0.5.0 → 0.7.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 +15 -9
- package/build/index.d.ts +8 -8
- package/build/index.d.ts.map +1 -1
- package/build/index.js +6 -6
- package/build/src/backends/android.js +8 -4
- package/build/src/backends/dart.d.ts +19 -0
- package/build/src/backends/dart.d.ts.map +1 -1
- package/build/src/backends/dart.js +28 -16
- package/build/src/backends/flutter.d.ts +51 -0
- package/build/src/backends/flutter.d.ts.map +1 -0
- package/build/src/backends/flutter.js +1362 -0
- package/build/src/backends/identifiers.d.ts +6 -0
- package/build/src/backends/identifiers.d.ts.map +1 -1
- package/build/src/backends/identifiers.js +28 -5
- package/build/src/backends/ios.js +2 -2
- package/build/src/backends/native-validation.d.ts +2 -2
- package/build/src/backends/native-validation.d.ts.map +1 -1
- package/build/src/backends/native-validation.js +2 -2
- package/build/src/backends/program.d.ts +4 -4
- package/build/src/backends/program.d.ts.map +1 -1
- package/build/src/backends/program.js +4 -4
- package/build/src/backends/scalars.d.ts.map +1 -1
- package/build/src/backends/scalars.js +2 -1
- package/build/src/backends/shared.d.ts +7 -0
- package/build/src/backends/shared.d.ts.map +1 -1
- package/build/src/backends/shared.js +14 -9
- package/build/src/backends/zig-runtime.d.ts +5 -0
- package/build/src/backends/zig-runtime.d.ts.map +1 -0
- package/build/src/backends/zig-runtime.js +92 -0
- package/build/src/backends/zig-validation.d.ts +9 -0
- package/build/src/backends/zig-validation.d.ts.map +1 -0
- package/build/src/backends/zig-validation.js +73 -0
- package/build/src/backends/zig.d.ts +42 -0
- package/build/src/backends/zig.d.ts.map +1 -0
- package/build/src/backends/zig.js +584 -0
- package/build/src/frontends/scalars.d.ts.map +1 -1
- package/build/src/frontends/scalars.js +2 -1
- package/build/src/frontends/zig-parser.d.ts +31 -0
- package/build/src/frontends/zig-parser.d.ts.map +1 -0
- package/build/src/frontends/zig-parser.js +17 -0
- package/build/src/frontends/zig.d.ts +14 -0
- package/build/src/frontends/zig.d.ts.map +1 -0
- package/build/src/frontends/zig.js +970 -0
- package/build/src/language-registry.d.ts.map +1 -1
- package/build/src/language-registry.js +40 -1
- package/build/src/mapping.js +2 -2
- package/build/src/semantic/provenance.js +3 -3
- package/build/src/semantic/types.d.ts +154 -4
- package/build/src/semantic/types.d.ts.map +1 -1
- package/build/src/semantic/types.js +39 -3
- package/build/src/semantic/validate.js +2 -2
- package/build/src/toolchains.d.ts +6 -0
- package/build/src/toolchains.d.ts.map +1 -1
- package/build/src/toolchains.js +2 -1
- package/build/src/zig-bindings.d.ts +10 -0
- package/build/src/zig-bindings.d.ts.map +1 -0
- package/build/src/zig-bindings.js +54 -0
- package/docs/android.md +7 -3
- package/docs/architecture.md +13 -5
- package/docs/flutter.md +47 -0
- package/docs/goals.md +1 -1
- package/docs/language-support.md +16 -5
- package/docs/parser-qualification.md +31 -1
- package/docs/source-maps.md +7 -3
- package/docs/testing.md +47 -4
- package/docs/zig.md +33 -0
- package/index.js +5 -5
- package/node_modules/semantifold-tree-sitter-zig-internal/LICENSE +15 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/README.md +5 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/LICENSE +21 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/README.md +21 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/binding.gyp +29 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/bindings/node/binding.cc +20 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/bindings/node/binding_test.js +9 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/bindings/node/index.d.ts +28 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/bindings/node/index.js +11 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/grammar.js +900 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/package.json +57 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/prebuilds/darwin-arm64/@tree-sitter-grammars+tree-sitter-zig.node +0 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/prebuilds/darwin-x64/@tree-sitter-grammars+tree-sitter-zig.node +0 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/prebuilds/linux-arm64/@tree-sitter-grammars+tree-sitter-zig.node +0 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/prebuilds/linux-x64/@tree-sitter-grammars+tree-sitter-zig.node +0 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/prebuilds/win32-arm64/@tree-sitter-grammars+tree-sitter-zig.node +0 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/prebuilds/win32-x64/@tree-sitter-grammars+tree-sitter-zig.node +0 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/queries/folds.scm +23 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/queries/highlights.scm +291 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/queries/indents.scm +22 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/queries/injections.scm +10 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/src/grammar.json +6570 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/src/node-types.json +3178 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/src/parser.c +169829 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/src/tree_sitter/alloc.h +54 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/src/tree_sitter/array.h +291 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/src/tree_sitter/parser.h +266 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/tree-sitter-zig.wasm +0 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/@tree-sitter-grammars/tree-sitter-zig/tree-sitter.json +38 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/LICENSE +21 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/README.md +128 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/binding.gyp +80 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/index.js +916 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/package.json +76 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/prebuilds/darwin-arm64/tree-sitter.node +0 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/prebuilds/darwin-x64/tree-sitter.node +0 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/prebuilds/linux-arm64/tree-sitter.node +0 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/prebuilds/linux-x64/tree-sitter.node +0 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/prebuilds/win32-arm64/tree-sitter.node +0 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/prebuilds/win32-x64/tree-sitter.node +0 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/addon_data.h +47 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/binding.cc +35 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/conversions.cc +140 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/conversions.h +22 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/language.cc +106 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/language.h +17 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/logger.cc +70 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/logger.h +19 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/lookaheaditerator.cc +122 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/lookaheaditerator.h +33 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/node.cc +1088 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/node.h +30 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/parser.cc +306 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/parser.h +35 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/query.cc +397 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/query.h +40 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/tree.cc +316 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/tree.h +45 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/tree_cursor.cc +213 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/src/tree_cursor.h +52 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/tree-sitter.d.ts +1042 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/include/tree_sitter/api.h +1318 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/alloc.c +48 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/alloc.h +41 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/array.h +291 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/atomic.h +68 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/clock.h +146 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/error_costs.h +11 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/get_changed_ranges.c +501 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/get_changed_ranges.h +36 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/host.h +21 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/language.c +223 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/language.h +297 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/length.h +52 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lexer.c +435 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lexer.h +49 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lib.c +12 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/node.c +920 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/parser.c +2165 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/parser.h +266 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/point.h +62 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/portable/endian.h +206 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/query.c +4187 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/reduce_action.h +34 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/reusable_node.h +95 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/stack.c +899 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/stack.h +130 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/subtree.c +1066 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/subtree.h +399 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree.c +170 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree.h +31 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree_cursor.c +712 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree_cursor.h +48 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/ts_assert.h +11 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/ICU_SHA +1 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/LICENSE +414 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/README.md +29 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/ptypes.h +1 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/umachine.h +448 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/urename.h +1 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf.h +1 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf16.h +733 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf8.h +881 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode.h +83 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/stdlib-symbols.txt +24 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/stdlib.c +109 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/wasm-stdlib.h +1302 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm_store.c +1859 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm_store.h +31 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/package.json +21 -0
- package/node_modules/semantifold-tree-sitter-zig-internal/src/zig.js +134 -0
- package/package.json +11 -6
- package/src/backends/android.js +7 -3
- package/src/backends/dart.js +28 -15
- package/src/backends/flutter.js +1465 -0
- package/src/backends/identifiers.js +28 -4
- package/src/backends/ios.js +1 -1
- package/src/backends/native-validation.js +1 -1
- package/src/backends/program.js +3 -3
- package/src/backends/scalars.js +1 -0
- package/src/backends/shared.js +15 -11
- package/src/backends/zig-runtime.js +93 -0
- package/src/backends/zig-validation.js +68 -0
- package/src/backends/zig.js +579 -0
- package/src/frontends/scalars.js +1 -0
- package/src/frontends/zig-parser.js +20 -0
- package/src/frontends/zig.js +994 -0
- package/src/language-registry.js +40 -0
- package/src/mapping.js +1 -1
- package/src/semantic/provenance.js +2 -2
- package/src/semantic/types.js +41 -2
- package/src/semantic/validate.js +1 -1
- package/src/toolchains.js +1 -0
- package/src/zig-bindings.js +46 -0
package/docs/language-support.md
CHANGED
|
@@ -20,11 +20,13 @@ The immutable registry is authoritative for both dispatch and discovery:
|
|
|
20
20
|
| `rust` | yes | yes | no | no | no | no | no | no | no | no | no | no | no | no | no | no | multiple | yes | rich + v3 | parse, generate, compile, validate, execute (`rustc`, `cargo`) |
|
|
21
21
|
| `swift` | yes | yes | no | no | no | no | no | no | no | no | no | no | no | no | no | no | single | yes | rich + v3 | parse, generate, compile, execute (`swiftc`) |
|
|
22
22
|
| `dart` | yes | yes | no | no | no | yes | no | no | no | no | no | no | no | no | no | no | multiple | yes | rich + v3 | parse, generate, restore, compile, validate, execute (`dart`) |
|
|
23
|
+
| `zig` | yes | yes | no | no | no | yes | no | no | no | no | no | no | no | no | no | no | multiple | yes | rich + v3 | parse, generate, compile, validate, execute (`zig`) |
|
|
23
24
|
| `wasm` | no | no | yes | yes | no | no | no | no | no | no | no | no | no | no | no | no | multiple | no | rich text + v3 + byte ranges | generate, validate, instantiate, execute (`wasm-validate`, `node`, `chromium`) |
|
|
24
25
|
| `ios` | no | no | no | yes | no | no | no | no | no | no | no | no | no | no | no | no | multiple | no | rich text + v3 + byte ranges | generate (Apple acceptance deferred) |
|
|
25
26
|
| `android` | no | no | no | yes | no | no | no | no | no | no | no | no | no | no | no | no | multiple | no | rich text + v3 + byte ranges | generate, compile, validate, instantiate, execute (`android`, TensorBuzz KVM) |
|
|
27
|
+
| `flutter` | no | no | no | yes | no | no | no | no | no | no | no | no | no | no | no | no | multiple | no | rich text + v3 + byte ranges | generate, restore, compile, validate, instantiate, execute (`flutter`, `android`; Android qualified, iOS deferred) |
|
|
26
28
|
|
|
27
|
-
`languageCapabilities` exposes all
|
|
29
|
+
`languageCapabilities` exposes all nineteen records as frozen data, including `features.generalFunctionsAndCalls`, `features.immutableCollections`, `features.optionalValues`, `features.orderedListIteration`, `features.orderedMapIteration`, `features.conditionControlledLoops`, `features.referenceClasses`, `features.effectfulCapabilitiesAndResources`, `features.closedRecords`, `features.typedErrors`, and `features.typeParametersAndGenerics`. A role or semantic feature is not inferred from another role: browser Wasm has binary/application backends without a frontend or text backend, while `ios`, `android`, and `flutter` have only application backends. None has a source round trip or general interoperability role; Android retains the Kotlin/JVM Tasks 001–004 function subset, while Flutter consumes the independent Dart Tasks 001–005 capability subset and both add resolved Task 010 linkage in their application shells. `supportedLanguages` is the derived list of fifteen records with both frontend and text generation. C#, Go, C, and Zig return two text artifacts; Rust and Dart return three; Wasm returns one binary and three text artifacts; iOS, Android, and Flutter return deterministic multi-artifact application projects. Their callers use `generateArtifactSet()`; the legacy single-artifact APIs reject unavailable roles with `UNSUPPORTED_ROLE`.
|
|
28
30
|
|
|
29
31
|
## Task 026 iOS application generation
|
|
30
32
|
|
|
@@ -38,6 +40,12 @@ The `android` registry row is an application-only target over the independent Ko
|
|
|
38
40
|
|
|
39
41
|
The generated build declares only exact non-transitive `testImplementation("junit:junit:4.13.2")` and `testRuntimeOnly("org.hamcrest:hamcrest-core:1.3")`; Kotlin's implicit stdlib dependency is disabled and no library enters the application runtime classpath. Official tool/cache preparation is online, but lint, unit, application APK, instrumentation APK, dependency inspection, and APK leakage checks execute with Gradle offline. TensorBuzz's `/dev/kvm` lane performs two fresh accelerated API-35 emulator boots with exact labelled-text and lifecycle assertions. No local software-emulator fallback, public writer, signing/store route, permission, service, Compose, WebView, NDK/JNI, source runtime, or platform channel exists. See [Android application target](android.md).
|
|
40
42
|
|
|
43
|
+
## Task 030 Flutter application generation
|
|
44
|
+
|
|
45
|
+
The `flutter` registry row is application-only and does not add a sixteenth frontend. It accepts exactly the semantic project subset supported by the Dart backend, emits mapped per-module Dart plus a synthetic stateless Material shell, and owns a versioned Android Flutter template below `generated/flutter-app`. Exact package identity, the SDK-only pubspec/lock, assets, paths, hashes, configuration causality, semantic provenance, and platform/toolchain status are validated before any artifact set is returned.
|
|
46
|
+
|
|
47
|
+
Flutter stable 3.47.4 with bundled Dart 3.13.3 is checksum-pinned. Offline restore uses only its archive preload cache; format, analyzer, Flutter widget tests, Android lint/build, and exact labelled Unicode UI assertion are real. The one Task 028 Gradle cache advances to 8.14 for Flutter compatibility, while its JDK/AGP/API/build-tools/emulator values and exactly two KVM boots remain shared. No plugin, platform channel, permission, external pub package download, source runtime, public writer, or second Android topology exists. iOS runner artifacts are deliberately omitted and every Apple build/launch/UI gate remains deferred rather than silently skipped. See [Flutter application target](flutter.md).
|
|
48
|
+
|
|
41
49
|
## Task 025 core expanded-language acceptance
|
|
42
50
|
|
|
43
51
|
Python, C#, C, C++, Rust, Swift, Kotlin/JVM, and Go share one data-driven Tasks 001–004 acceptance gate. Their five base/scalar/local/operator/statement fixtures normalize to the same location-neutral semantic corpus; the pre-existing `select`/`choose` spelling difference is treated as a reserved-word adaptation only, not different behavior. Each backend generates, reparses, and runs the complete operator profile through its real registered toolchain. Python and Swift emit one source file; C++ emits one source file; C# and C emit two-file projects; Rust emits `Cargo.toml`, `Cargo.lock`, and `src/main.rs`; Kotlin emits mapped `Program.kt` with runnable-JAR metadata; and Go emits `go.mod` plus `main.go`.
|
|
@@ -50,7 +58,7 @@ The shared negative corpus covers parser recovery, missing types, truthiness, mi
|
|
|
50
58
|
|
|
51
59
|
## Task 005 general functions and calls
|
|
52
60
|
|
|
53
|
-
PHP, Ruby, JavaScript with JSDoc, TypeScript, Java, and
|
|
61
|
+
PHP, Ruby, JavaScript with JSDoc, TypeScript, Java, Dart, and Zig accept any number of required positional parameters, including zero. The module resolver collects every unique function signature before validating bodies, assigns declarations deterministic `function:N` identities, and binds each direct call to that identity plus its ordered parameter and return types. This permits forward calls, nested calls, direct recursion, and unambiguous mutual recursion without overload or dynamic dispatch. Arity and every positional scalar type must match exactly.
|
|
54
62
|
|
|
55
63
|
Function returns are `integer`, `boolean`, `string`, or `void`. A non-void function has an expression on every reachable return and returns on every reachable path. A void function may fall through or use a bare return, and its call is legal only as an `ExpressionStatement`. Void is never a value: it cannot type a parameter or local, initialize or assign a binding, become an argument or operand, be printed, or be returned as a value. Generation revalidates declaration identities and complete resolved signatures in externally supplied IR. Function names, parameters, return annotations, callees, arguments, and resolution references retain deterministic parser-backed provenance and mappings.
|
|
56
64
|
|
|
@@ -61,6 +69,7 @@ The source profiles remain deliberately exact:
|
|
|
61
69
|
- PHP accepts simple typed by-value required parameters, an explicit scalar or `void` return, and unqualified direct calls. Defaults, variadics, named/unpacked/by-reference arguments, by-reference parameters or returns, methods, dynamic/qualified calls, implicit nullability, and missing types are rejected; Task 007 adds only its exact explicit nullable profile.
|
|
62
70
|
- Java accepts the established private-static semantic method profile with explicit supported parameter and scalar-or-void result types inside `public final class Main`, plus receiver-free direct calls and the exact entry method. Generated zero-parameter signatures named `getClass`, `hashCode`, `clone`, `toString`, `notify`, `notifyAll`, `wait`, or `finalize` conflict with inherited `java.lang.Object` instance methods and are rejected before emission; nonconflicting scalar-parameter overloads of those names remain available. Overload sets, instance/receiver/qualified/static-import ambiguity, varargs, bounded/defaulted/wildcard/raw generics, constructors, throws clauses, and non-static semantic methods are rejected.
|
|
63
71
|
- Dart accepts synchronous top-level functions with exact explicit `int`, `bool`, `String`, or `void` returns, explicitly typed required positional parameters, initialized typed locals, direct calls, and exact `void main()`/`print`. Inference, `var`, inferred `final`, optional/named/default arguments, methods/classes, generics, imports, dynamic/nullability, collections, exceptions, async, and isolates are rejected. Generated Dart alone may contain formatter-added trailing commas and the complete canonical private runtime prefix; neither grants those forms to ordinary source. See [Dart source and target](dart.md).
|
|
72
|
+
- Zig accepts top-level functions with exact explicit `i64`, `bool`, `[]const u8`, or `void` returns, explicitly typed required positional parameters, initialized typed `const`/`var` locals, direct calls, and the exact generated support/`pub fn main()` shell. Inference, optional/default/rest parameters, methods, containers, user slices/pointers/allocators, imports beyond the canonical standard-library support, error unions, `comptime`, generics, reflection, FFI, async, and concurrency are rejected. See [Zig source and target](zig.md).
|
|
64
73
|
|
|
65
74
|
Python, C#, C, C++, Rust, Swift, Kotlin/JVM, Go, and browser Wasm remain on their Task 025 Tasks 001–004 profile. Their registry feature flag is false, their existing exact-two/scalar-return behavior is unchanged, and a Task-005-only arity, void return, or void call statement is a located `UNSUPPORTED_CAPABILITY` before source, bytes, or a partial artifact set is exposed. This boundary does not broaden the future Task 013 aggregate acceptance.
|
|
66
75
|
|
|
@@ -220,6 +229,8 @@ This acceptance remains original-five-only and does not itself expand to the lat
|
|
|
220
229
|
| C++ | exact `std::int64_t`, `bool`, and owned `std::string` | checked scalar print helpers in `int main()` |
|
|
221
230
|
| Rust | exact `i64`, `bool`, owned `String`; typed `let`/`let mut`, canonical safe decimal `i64` literal suffix | exact scalar print helpers in `fn main()` |
|
|
222
231
|
| Swift | exact `Int64`, `Bool`, and `String`; explicitly typed `let`/`var` | direct top-level `print(…)` in `program.swift` |
|
|
232
|
+
| Dart | exact `int`, `bool`, and `String`; explicitly typed `final`/typed mutable locals | exact `void main()` and `print(…)` in `bin/program.dart` |
|
|
233
|
+
| Zig | exact `i64`, `bool`, and immutable UTF-8 `[]const u8`; explicitly typed `const`/`var` | checked scalar output helpers in exact `pub fn main() void` in `src/main.zig` |
|
|
223
234
|
|
|
224
235
|
C uses the unchanged private root-bundled legacy CST boundary and the [complete C17 profile](c.md). It generates deterministic `program.c` plus `semantifold_runtime.h`, checks signed integer arithmetic and arena sizes, and sequences every call and nontrivial expression through exact versioned regions. Caller-authored nested calls with unspecified C order are rejected. Generated regions reparse only after whole-CST comparison verifies types, numbering, uses, order, consumers, prototypes and cleanup. No user pointer, ownership, preprocessing, general FFI or C++ behavior enters semantic IR. Real Clang O0/O2 execution and ASan/UBSan/leak checks are mandatory on the qualified Linux lane.
|
|
225
236
|
|
|
@@ -296,7 +307,7 @@ Binary/application generation returns `program.wasm`, `program.wasm.map`, `seman
|
|
|
296
307
|
|
|
297
308
|
### Bounded standard-library portability
|
|
298
309
|
|
|
299
|
-
The registered language roles cover only the semantic subset documented above. `semantifold@0.
|
|
310
|
+
The registered language roles cover only the semantic subset documented above. The `semantifold@0.6.0` release contains the Task 032 condition-controlled loops, Task 033 bounded reference classes, Task 034 effect/resource foundation, Task 035 versioned canonical contract/provider-linking hub, Task 036 neutral facade qualification layer, Task 037 bounded TCP vertical slice, Task 028 Android application target, and Task 031 Zig target. Task 030 is the subsequent bounded Flutter application candidate described above; it does not broaden standard-library portability.
|
|
300
311
|
|
|
301
312
|
Task 037 adds exactly one concrete lane: Ruby source targeting PHP. The Ruby frontend accepts only literal `require "socket"`, genuine `TCPSocket.new(host, port)`, zero-argument receiver `gets` and `close`, and exactly one string argument to unqualified `puts` or `Kernel.puts`. The output builtin is resolved only inside that same parser-proved socket profile, preserving legacy Ruby program-mode `puts` elsewhere. User-defined/shadowed/reopened/monkey-patched identities, dynamic require/send, blocks, other members, extra arguments, coercive or multi-value output, and timeout or socket options fail at their parser-backed locations.
|
|
302
313
|
|
|
@@ -304,9 +315,9 @@ The two executable compiler-owned Ruby facades compile through ordinary semantic
|
|
|
304
315
|
|
|
305
316
|
Line reads block without a configurable timeout, decode incremental UTF-8, retain LF and CRLF, return the final unterminated line once, and use absence only for clean EOF. Output adds LF only when missing. Connect/read/decode/write/close failures remain typed, and either outcome of the first close attempt makes the resource terminal. TCP servers, TLS, UDP, Unix sockets, nonblocking or async I/O, cancellation, arbitrary encodings/framing, other Ruby APIs/output forms, other source facades, and other target providers remain unsupported. See the [standard-library portability design](standard-library-portability.md) and [dependency-ordered implementation plan](plans/2026-09-05-standard-library-portability.md).
|
|
306
317
|
|
|
307
|
-
All
|
|
318
|
+
All fifteen frontends preserve exact input content and parser-backed semantic token ranges in module provenance. The original-six 36-combination matrix remains byte-characterized; Tasks 017–020, 022–024, and 031 add their own native/managed and original-five crossing coverage. Go's `main.go` has complete range-based rich/v3 mappings; manifest-first `go.mod` has synthetic configuration provenance related to the module root. CPP, Rust, Swift, Kotlin, Dart, and Zig map original occurrences and synthetic target support. Output text uses LF deterministically. Only JavaScript and TypeScript may opt into inline or external `sourceMappingURL` directives; C#, Go, C, CPP, Rust, Swift, Kotlin, Dart, and Zig reject unsupported mapping directive/filename options instead of silently dropping them. Mapping does not imply lossless formatting or support for syntax outside the semantic subset. See [source provenance and mappings](source-maps.md).
|
|
308
319
|
|
|
309
|
-
`UNSUPPORTED_LANGUAGE` is exclusive to unknown or misspelled IDs. `UNSUPPORTED_ROLE` reports a known ID without the requested frontend, text/binary/application backend, artifact, or interoperability role, including C#, Go, C, Rust, and
|
|
320
|
+
`UNSUPPORTED_LANGUAGE` is exclusive to unknown or misspelled IDs. `UNSUPPORTED_ROLE` reports a known ID without the requested frontend, text/binary/application backend, artifact, or interoperability role, including C#, Go, C, Rust, Dart, and Zig through a legacy single-artifact API. `UNSUPPORTED_CAPABILITY` reports a role that exists but cannot represent the requested semantic module or target feature. `UNSUPPORTED_SYNTAX` reports parsed constructs outside the subset with the best parser-provided source location. Missing public annotations use `MISSING_TYPE`; a present unsupported type is `UNSUPPORTED_SYNTAX` at that annotation. Parser failures use `PARSE_ERROR`. Semantic resolution/type failures use `DUPLICATE_BINDING`, `UNRESOLVED_BINDING`, `USE_BEFORE_DECLARATION`, `IMMUTABLE_ASSIGNMENT`, and `TYPE_MISMATCH`; Task 005 additionally uses `VOID_AS_VALUE`, `VOID_RETURN_VALUE`, and `MISSING_RETURN_VALUE`. Task 033 adds `DUPLICATE_CLASS`, `DUPLICATE_PRIVATE_FIELD`, `DUPLICATE_CONSTRUCTOR`, `DUPLICATE_METHOD`, `INCOMPLETE_INITIALIZATION`, `ILLEGAL_PRIVATE_ACCESS`, `UNKNOWN_CLASS`, `INVALID_METHOD_RECEIVER`, `UNKNOWN_METHOD`, `CONSTRUCTOR_ARITY_MISMATCH`, and `METHOD_ARITY_MISMATCH`. Task 034 adds `MISSING_CAPABILITY_AUTHORITY`, `INVALID_CAPABILITY_AUTHORITY`, `UNDECLARED_EFFECT`, `UNDECLARED_FAILURE`, `INVALID_EFFECT_ORDER`, `RESOURCE_TYPE_MISMATCH`, `RESOURCE_MOVE_REQUIRED`, `INVALID_RESOURCE_TRANSFER`, `RESOURCE_ALIAS`, `INVALID_RESOURCE_BORROW`, `BORROW_ESCAPE`, `USE_AFTER_MOVE`, `USE_AFTER_CLOSE`, `RESOURCE_STATE_MISMATCH`, `LEAKED_RESOURCE`, and `FAILURE_ABSENCE_CONFLATION`; a repeated close in the bounded probe uses its declared terminal failure rather than `DOUBLE_CLOSE`. Task 035 adds `STDLIB_CONTRACT_INVALID`, `STDLIB_MODULE_UNKNOWN`, `STDLIB_OPERATION_UNDECLARED`, `STDLIB_VERSION_INCOMPATIBLE`, `STDLIB_VERSION_MALFORMED`, `STDLIB_PROVIDER_INVALID`, `STDLIB_PROVIDER_MISSING`, `STDLIB_PROVIDER_AMBIGUOUS`, `STDLIB_PROVIDER_DEPENDENCY_MISSING`, `STDLIB_PROVIDER_CYCLE`, `STDLIB_LINK_FAILURE`, and `STDLIB_NAME_COLLISION`. Task 036 adds `STDLIB_FACADE_INVALID`, `STDLIB_FACADE_IDENTITY_UNPROVED`, `STDLIB_FACADE_MEMBER_UNSUPPORTED`, `STDLIB_FACADE_VERSION_MALFORMED`, `STDLIB_FACADE_VERSION_INCOMPATIBLE`, `STDLIB_FACADE_DYNAMIC_REFERENCE`, `STDLIB_FACADE_REFLECTION_UNSUPPORTED`, `STDLIB_FACADE_NATIVE_EXTENSION_UNSUPPORTED`, `STDLIB_FACADE_SHADOWED`, `STDLIB_FACADE_REOPENED`, `STDLIB_FACADE_AUTHORITY_FORGED`, `STDLIB_FACADE_NAME_COLLISION`, `STDLIB_FACADE_DECLARATION_MISMATCH`, and `STDLIB_FACADE_DESCRIPTOR_INVALID`; Task 037 additionally uses `STDLIB_PROTECTED_BINDING_ACCESS` for portable attempts to reach canonical operations directly. Resolution failures retain parser locations, while descriptor/link failures are transactional. Flow failures use `NON_BOOLEAN_CONDITION`, `MISSING_RETURN`, `UNREACHABLE_STATEMENT`, `ILLEGAL_RETURN_CONTEXT`, `ILLEGAL_BREAK_CONTEXT`, `ILLEGAL_CONTINUE_CONTEXT`, `INVALID_LOOP_TARGET`, `CROSS_FUNCTION_LOOP_TARGET`, and `UNSUPPORTED_STATEMENT`. Backends validate complete recursive block shape, flow, scalar payloads, binding/type agreement, call resolutions, mutability, loop context, identifiers, target bounds, and fixed artifact contracts before emission. Missing or structurally invalid caller IR reports located `UNSUPPORTED_CAPABILITY` rather than leaking a native error or producing partial source. A non-`Main.java` Java basename, non-`Program.cs` C# filename, non-`main.go` Go filename, non-`program.c` C filename, non-`src/main.rs` Rust filename, non-`bin/program.dart` Dart filename, or non-`src/main.zig` Zig filename uses that same contract. Artifact-set generation requires a non-empty string language/target ID and accepts only the explicit `text`, `binary`, and `application` backend-role strings; malformed IDs or roles report `INVALID_ARTIFACT_SET` without coercing caller input, while an unknown string ID reports `UNSUPPORTED_LANGUAGE` and a valid role absent from a known registry record reports `UNSUPPORTED_ROLE`. Optional registry roles and backend metadata may be omitted with `undefined`; present malformed values, including `null`, report `INVALID_REGISTRY`. Invalid registry, artifact-set, byte-map, discovery, and runner inputs have their own normalized diagnostics rather than leaking native type or subprocess errors.
|
|
310
321
|
|
|
311
322
|
Boxed or coercive types, inferred public types, TypeScript literal/enum/`any`/`unknown`/arbitrary-union types, PHP aliases or implicit nullable declarations, Ruby `boolish`, Java `Boolean`/`char`, universal null values, floating point, decimal, bigint, symbols, regex values, byte strings, and interpolation are unsupported. Division, remainder, exponentiation, bitwise/shift/update/compound operations, Ruby/PHP `and`/`or`, loose equality, ternary/nullish forms, optional/safe navigation, ranges, general casts/assertions, collection/object equality, operator overloading, implicit coercion, and constant folding are also excluded; the sole assertion exception is Task 006's exact TypeScript `Map#get(...)!` wrapper, whose lookup must be independently total. Task 007 supplies only the exact explicit optional model, Task 008 only exact ordered list loops, Task 010 only explicit supplied source projects, Task 011 only the exact nominal unchecked-error model above, Task 012 only the exact unbounded invariant generic profile above, Task 014 only the exact ordered-map pair loop above, Task 032 only the exact strict-Boolean precondition loop above, Task 033 only the exact closed reference-class profile above, and Task 034 only the explicit single-module probe effect/resource profile above. There is no truthiness, implicit-return or general statement-value model, async/generator model, open/inherited/virtual class model, implicit import discovery, post-condition/basic/range loops, arbitrary or ordinary-map iteration, switches, exception behavior beyond Task 011 and declared Task 034 failures, overloads, advanced generic/effect type systems, implicit resource cleanup, unsafe native handles, package-manager resolution, or source-format preservation. The sole value-free expression statements are resolved void function and method calls in the original-five cohort. Ruby type comments remain a bounded RBS-style convention rather than a full signature parser, and single-module Java generation retains the fixed `Main.java` contract.
|
|
312
323
|
|
|
@@ -35,7 +35,7 @@ All Tree-sitter languages use the official `tree-sitter` Node binding. The langu
|
|
|
35
35
|
| 023 | Kotlin/JVM | community grammar through the exact Semantifold packaging fork plus differential `kotlinc` checks | passed for immutable tag `v0.4.0-semantifold.1`, commit `57c35ad1a80ccd2a0ebd8fffe852f0d13a20acd0`, ABI 14, Node24, and Kotlin/JVM 2.4.20; see below |
|
|
36
36
|
| 024 | Go | official [`tree-sitter/tree-sitter-go`](https://github.com/tree-sitter/tree-sitter-go) grammar package | passed for exact `tree-sitter-go@0.25.0`; see the checked-in record below |
|
|
37
37
|
| 029 | Dart | exact public registry grammar plus differential Dart SDK checks | passed for `tree-sitter-dart-orchard@0.7.0`, Node 24/Tree-sitter 0.25.1, packed consumers, and exact Dart 3.13.3 Linux x64 format/analyze/VM/native acceptance |
|
|
38
|
-
| 031 | Zig |
|
|
38
|
+
| 031 | Zig | exact public registry grammar in a private compatible runtime plus official Zig differential | passed for `@tree-sitter-grammars/tree-sitter-zig@1.1.2`, isolated Tree-sitter 0.22.4, Node 24/ABI 14, packed consumers, and exact Zig 0.15.2 Linux x86-64 |
|
|
39
39
|
|
|
40
40
|
Swift or Kotlin qualification failure leaves Task 022 or 023 blocked until its roadmap/source decision is explicitly revised. Parser archives produced by CI or release pages are not an alternative dependency route. Tasks022 and 023 record narrow amendments: the selected registry packages lack the required install-safe Node24 contract, so Semantifold uses full-SHA GitHub source archives from its public packaging forks rather than generated release assets or mutable Git references.
|
|
41
41
|
|
|
@@ -80,6 +80,36 @@ The retained corpus SHA-256 values are:
|
|
|
80
80
|
|
|
81
81
|
Run `npx velocious-test spec/dart-parser-qualification.spec.js` for retained Node/CST evidence, `npx velocious-test spec/tree-sitter-legacy-packed-consumer.spec.js` for ordinary-install plus clean-`npm ci` packed-consumer proof, and the individual `spec/dart-cross-language-acceptance.spec.js` and `spec/dart-native-execution.spec.js` files for the real SDK differential. All pass in the rebuilt canonical lane; review, exact-head CI, merge, and post-merge verification remain separate delivery gates.
|
|
82
82
|
|
|
83
|
+
## Task 031 Zig grammar qualification — 2026-09-16
|
|
84
|
+
|
|
85
|
+
The Task 031 hard gate completed in an isolated scratch installation before the feature branch or tracked-file mutation. Exact `@tree-sitter-grammars/tree-sitter-zig@1.1.2` is a real maintained native Node grammar, but its optional peer requires Tree-sitter `^0.22.1`; root 0.25.1 cannot satisfy that contract. The selected route therefore uses an ordinary private `file:` production dependency with its own exact Tree-sitter 0.22.4 subtree, following the established runtime-isolation boundary without exposing a parser package publicly. No force/legacy-peer override, mutable source dependency, compiler-output AST, `zig ast-check`, source scan, runtime fetch, or vendored parser payload is used.
|
|
86
|
+
|
|
87
|
+
| Evidence | Qualified result |
|
|
88
|
+
| --- | --- |
|
|
89
|
+
| npm distribution | Exact registry package `@tree-sitter-grammars/tree-sitter-zig@1.1.2`, tarball `https://registry.npmjs.org/@tree-sitter-grammars/tree-sitter-zig/-/tree-sitter-zig-1.1.2.tgz`, integrity `sha512-J0L31HZ2isy3F5zb2g5QWQOv2r/pbruQNL9ADhuQv2pn5BQOzxt80WcEJaYXBeuJ8GHxVT42slpCna8k1c8LOw==`. Its exact compatible binding is registry `tree-sitter@0.22.4`, integrity `sha512-usbHZP9/oxNsUY65MQUsduGRqDHQOou1cagUSwjhoSYAmSahjQDAVsh9s+SlZkn8X8+O1FULRGwHu7AFP3kjzg==`. Both are bundled only beneath the private runtime. |
|
|
90
|
+
| upstream identity | Authoritative [`tree-sitter-grammars/tree-sitter-zig`](https://github.com/tree-sitter-grammars/tree-sitter-zig) lightweight tag `v1.1.2` resolves to full commit `b670c8df85a1568f498aa5c8cae42f51a90473c0`. The package repository metadata names that upstream. Registry signature/provenance verification passed during the credential-free scratch audit. |
|
|
91
|
+
| legal and lifecycle | Grammar and binding declare MIT and retain their licenses. Each native package uses the standard local `node-gyp-build` install route with shipped prebuilds/source fallback; load/install code contains no tool or package downloader. Semantifold ships only the npm-installed dependency payload inside its root bundle, not a copied archive or hand-built native binary. |
|
|
92
|
+
| ABI and typed Node API | The generated parser declares grammar ABI 14; Tree-sitter 0.22.4 accepts and loads it on Node 24. The grammar declaration exports its language handle and 242 typed node descriptions. `Parser#setLanguage`, parse, indexed child access, and `fieldNameForChild` work through one narrow grammar-handle assertion contained entirely inside the private package; public code receives only frozen plain data. |
|
|
93
|
+
| corpus and traversal | Seven checked-in fixtures cover Tasks 001–005 function/parameter/void forms, exact scalar/slice types, typed `const`/`var`, assignment, calls, returns, output/helper shapes, all operators, nested/fallthrough branches, comments, support builtins/fields/indexing, unused/unmutated scaffolds, Unicode, escapes, and CRLF. Every named/anonymous/extra node and field-bearing edge is serialized; malformed braces, parameters, imports, and calls preserve explicit error/missing/propagated recovery state. |
|
|
94
|
+
| coordinates and bounds | The boundary normalizes native parser offsets/points to UTF-16 and independently verifies every UTF-8 byte boundary. An astral comment plus CRLF places the following declaration at UTF-16 offset 7 while nine UTF-8 bytes precede it. Lone surrogates reject before adaptation. The product owns a 1,000,000-UTF-16 source limit and a 512-level CST traversal limit rather than inferring capacity from compiler acceptance. |
|
|
95
|
+
| syntax version and compiler differential | The grammar release parses the complete selected Zig 0.15.2 Task-031 corpus. Upstream has later open Zig 0.16 grammar work, so the implementation does not claim moving 0.16 coverage. The official exact compiler reports `0.15.2`; generated projects pass canonical format, test, build, and execution in Debug, ReleaseSafe, and ReleaseFast with identical status/output/overflow boundaries. Compiler diagnostics are acceptance evidence only and never supply syntax trees or semantic recovery. |
|
|
96
|
+
| official tool distribution | Official Linux x86-64 archive `https://ziglang.org/download/0.15.2/zig-x86_64-linux-0.15.2.tar.xz`, size `53733924`, SHA-256 `02aa270f183da276e5b5920b1dac44a63f1a49e55050ebde3aecc9eb82f93239`; qualified executable SHA-256 `2858dc89dbbfdd08cceda1b841e7fd0a793a1a67b49f150bc3d0d1de44ed7f51`. Docker and TensorBuzz verify those values and install source-independently; tests use isolated caches and never fetch a compiler or package. |
|
|
97
|
+
| package/consumer boundary | Root scripts build and typecheck the private workspace, compare every installed shipped byte with its `file:` source, and bundle the complete isolated dependency subtree. The credential-free packed consumer proves default `install-links=false`, ordinary install, full dependency listing, clean `npm ci`, simultaneous root/legacy/Zig binding loading, strict public typing, frozen Zig parsing, and Zig frontend/backend round trip. |
|
|
98
|
+
|
|
99
|
+
Retained corpus hashes are:
|
|
100
|
+
|
|
101
|
+
| Corpus path | SHA-256 |
|
|
102
|
+
| --- | --- |
|
|
103
|
+
| `spec/fixtures/zig-qualification/base.zig` | `5394714b6b08f1352cf93aa12c5e94ab4270f51c864bb9e3c5f1c0e9a43d313a` |
|
|
104
|
+
| `spec/fixtures/zig-qualification/scalars.zig` | `f5a9a9a17df3c8597ba5510f638226d3703ce72d4ea704740c30dea36c31ea08` |
|
|
105
|
+
| `spec/fixtures/zig-qualification/locals.zig` | `ee7dd618a362945de52529258945e3205f33e9060cfbbb483e3aa8e05d94d489` |
|
|
106
|
+
| `spec/fixtures/zig-qualification/operators.zig` | `cd3c11c84bdc49abb453c8eb9fd5110f19f309d2248f311121c081491745ee9d` |
|
|
107
|
+
| `spec/fixtures/zig-qualification/statements.zig` | `b39c89b2c414f7dfdb7221c1ccf788dc3d68e47f75095840f7e9bc05539d874f` |
|
|
108
|
+
| `spec/fixtures/zig-qualification/scaffolds.zig` | `d2db6d9059e25a431fe6491bb192b3d0a6f94846c85689e6d64f5e6b1cec0825` |
|
|
109
|
+
| `spec/fixtures/zig-qualification/coordinates.zig` | `59ea9c03ec5b50c9c246354fa44f2283ed2b2af86f49e5d94768474ffe87c68f` |
|
|
110
|
+
|
|
111
|
+
Run `npx velocious-test spec/zig-parser-qualification.spec.js` for the retained package/ABI/CST/coordinate proof and exact `zig fmt --check` plus `zig test` acceptance of every corpus file, `npx velocious-test spec/tree-sitter-zig-install-consistency.spec.js` and the packed-consumer spec for the distribution boundary, and the Zig native/cross-language specs for generated-project compiler execution.
|
|
112
|
+
|
|
83
113
|
## Task 016 Python qualification
|
|
84
114
|
|
|
85
115
|
Qualification passed on the canonical Node `v24.18.1`, npm `11.16.0`, Linux lane with Python `3.14.4`. Task 016 therefore uses exact registry dependencies `tree-sitter@0.25.1` and the official `tree-sitter-python@0.25.0`; neither dependency is a Git URL, tarball path, copied archive, or vendored repository artifact.
|
package/docs/source-maps.md
CHANGED
|
@@ -70,7 +70,7 @@ artifact.sourceMap // encoded Source Map v3 object
|
|
|
70
70
|
artifact.sourceMapFilename
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
Default filenames for single-text targets include `program.php`, `program.rb`, `program.js`, `program.ts`, `Main.java`, `Program.kt`, `program.py`, `program.cpp`, and `program.swift`. Defaults apply only when `filename` or `sourceMapFilename` is omitted (`undefined`); an explicitly supplied `null` remains invalid. Java artifacts may include directories but must retain the basename `Main.java`. Kotlin is stricter: its only accepted path is exact `Program.kt`, matching the runnable-JAR recipe; alternate filenames, map directives, and alternate map names are located `UNSUPPORTED_CAPABILITY` diagnostics. Python artifacts may include directories but retain `program.py`. C# is available only through `generateArtifactSet()`: `filename` must be omitted or exact `Program.cs`, and `mapDirective`/`sourceMapFilename` must be omitted. It returns mapped `Program.cs` first and fixed synthetic `Semantifold.csproj` second. Go likewise returns fixed synthetic `go.mod` before mapped `main.go`. Dart returns fixed synthetic `pubspec.yaml` and `pubspec.lock` before mapped `bin/program.dart`; it accepts only that exact entry path and no map-directive or map-filename override. `sources` may supply exact content for legacy or caller-assembled multi-source IR:
|
|
73
|
+
Default filenames for single-text targets include `program.php`, `program.rb`, `program.js`, `program.ts`, `Main.java`, `Program.kt`, `program.py`, `program.cpp`, and `program.swift`. Defaults apply only when `filename` or `sourceMapFilename` is omitted (`undefined`); an explicitly supplied `null` remains invalid. Java artifacts may include directories but must retain the basename `Main.java`. Kotlin is stricter: its only accepted path is exact `Program.kt`, matching the runnable-JAR recipe; alternate filenames, map directives, and alternate map names are located `UNSUPPORTED_CAPABILITY` diagnostics. Python artifacts may include directories but retain `program.py`. C# is available only through `generateArtifactSet()`: `filename` must be omitted or exact `Program.cs`, and `mapDirective`/`sourceMapFilename` must be omitted. It returns mapped `Program.cs` first and fixed synthetic `Semantifold.csproj` second. Go likewise returns fixed synthetic `go.mod` before mapped `main.go`. Dart returns fixed synthetic `pubspec.yaml` and `pubspec.lock` before mapped `bin/program.dart`; it accepts only that exact entry path and no map-directive or map-filename override. Zig returns synthetic `build.zig` before mapped `src/main.zig`; it likewise accepts only its exact entry path and no mapping override. `sources` may supply exact content for legacy or caller-assembled multi-source IR:
|
|
74
74
|
|
|
75
75
|
```js
|
|
76
76
|
generateArtifact({
|
|
@@ -83,7 +83,7 @@ generateArtifact({
|
|
|
83
83
|
})
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
-
`generateArtifactSet()` wraps every single-text result in one generated entry artifact, plus the referenced serialized mapping artifact when an external JavaScript-family directive is requested. Kotlin's set additionally carries deeply frozen compiler/run metadata for exact Kotlin 2.4, API 2.4, JVM target 25, `-Werror`, runnable `Program.jar`, and `java -jar`; the metadata is configuration, not another generated file. For C#, the set contains mapped `Program.cs` and synthetic `Semantifold.csproj`; Go returns `go.mod` before `main.go`; Dart returns its two manifests before `bin/program.dart`. `createGeneratedArtifactSet()` validates these and other single-module target shapes without introducing Task 010's source-project semantics. Its dense artifact array preserves caller/backend order and requires unique safe relative POSIX paths without file/directory prefix collisions, non-empty text or bytes, media types, one of `entry`/`source`/`manifest`/`support`/`mapping`/`resource`/`loader`, generated ownership, provenance, and exactly one entry. Binary storage remains private and every `content` read returns a detached `Uint8Array`, so mutations cannot alter the validated artifact or drift from byte provenance. Backends return no iterable or partial files: the complete set is validated before it becomes observable. Generation and set construction never write files.
|
|
86
|
+
`generateArtifactSet()` wraps every single-text result in one generated entry artifact, plus the referenced serialized mapping artifact when an external JavaScript-family directive is requested. Kotlin's set additionally carries deeply frozen compiler/run metadata for exact Kotlin 2.4, API 2.4, JVM target 25, `-Werror`, runnable `Program.jar`, and `java -jar`; the metadata is configuration, not another generated file. For C#, the set contains mapped `Program.cs` and synthetic `Semantifold.csproj`; Go returns `go.mod` before `main.go`; Dart returns its two manifests before `bin/program.dart`; Zig returns synthetic `build.zig` before mapped `src/main.zig`. `createGeneratedArtifactSet()` validates these and other single-module target shapes without introducing Task 010's source-project semantics. Its dense artifact array preserves caller/backend order and requires unique safe relative POSIX paths without file/directory prefix collisions, non-empty text or bytes, media types, one of `entry`/`source`/`manifest`/`support`/`mapping`/`resource`/`loader`, generated ownership, provenance, and exactly one entry. Binary storage remains private and every `content` read returns a detached `Uint8Array`, so mutations cannot alter the validated artifact or drift from byte provenance. Backends return no iterable or partial files: the complete set is validated before it becomes observable. Generation and set construction never write files.
|
|
87
87
|
|
|
88
88
|
All outputs have deterministic LF newlines. Returned rich mappings are detached from caller-owned semantic locations and provenance before they are deeply frozen and internally indexed after trust-boundary validation. Freezing an artifact mapping therefore never freezes the mutable semantic module used to generate it. The rich map's `generated.content` is the exact returned code and its ordered, non-empty spans cover every UTF-16 code unit without gaps or overlaps:
|
|
89
89
|
|
|
@@ -124,10 +124,14 @@ Text artifact provenance embeds the validated rich mapping and Source Map v3 pro
|
|
|
124
124
|
|
|
125
125
|
Dart's `bin/program.dart` maps function names, parameter and local types/names, assignments, operators, calls/arguments, print, literals, returns, and entry statements through the same exact/anchor/synthetic span model. The complete safe-integer and analyzer-stability runtime prefix plus fixed `main` shell are synthetic with related semantic origins. Both manifest artifacts use artifact-level synthetic configuration provenance. The embedded Source Map v3 `file` is `bin/program.dart`; no `.map` artifact or Dart source directive is emitted.
|
|
126
126
|
|
|
127
|
+
Zig's `src/main.zig` maps function names, parameter and local types/names, assignments, operators/helper calls, calls/arguments, output, literals, returns, conditions, and entry statements through that same model. The exact arena/UTF-8/output/checked-arithmetic runtime, necessary unused-binding scaffolds, punctuation, and fixed `main` shell are synthetic with related semantic origins. `build.zig` uses artifact-level synthetic configuration provenance. The embedded Source Map v3 `file` is `src/main.zig`; no `.map` artifact or Zig source directive is emitted.
|
|
128
|
+
|
|
127
129
|
The iOS project manifest adds an application-specific provenance index without widening the generic mapping schemas. Mapped per-module semantic Swift retains the ordinary rich/v3 chain to its original Task 010 sources, including Ruby. Synthetic project, SwiftUI, runtime, test, configuration, and base asset-catalog files carry explicit source-free reasons. `SemantifoldIosProject` version 1 records renderer-owned configuration-field citations by manifest pointer and causal output ranges, exact caller asset representation/media type/SHA-256, source hashes and participating Swift artifacts, complete ordered owned paths, and exclusions. Its nested `SemantifoldIosSemanticProgram` version 1 section preserves caller-order source identities/ownership/hashes, dependency-order module IDs and dependencies, generated namespaces/artifacts, and the selected entry module/function linkage. Binary assets retain byte provenance across their exact full content. See [iOS application target](ios.md).
|
|
128
130
|
|
|
129
131
|
The Android project uses the same separation without sharing platform syntax with iOS. Every per-module semantic Kotlin artifact has authoritative rich/v3 mappings to all Task 010 source identities and filenames. Gradle, manifest, Activity, lifecycle, layout, resources, runtime, and test artifacts are synthetic or configuration-derived. `SemantifoldAndroidProject` version 1 records field-owned output ranges, exact input and output hashes, fixed-root ownership/exclusions, semantic module/dependency/source/entry linkage, and exact toolchain pins. Binary caller inputs retain full byte provenance. See [Android application target](android.md).
|
|
130
132
|
|
|
133
|
+
The Flutter project preserves the same separation through the independent Dart lowering. Each generated semantic Dart part retains rich mappings and a Source Map v3 projection to all originating Task 010 files, while the shared output sink, Material widget shell, SDK/package configuration, Android runner, resources, and tests are synthetic or configuration-derived. `SemantifoldFlutterProject` version 1 records configuration-owned output ranges, exact asset and artifact hashes, fixed-root ownership/exclusions, semantic module/dependency/source/entry linkage, exact Flutter/Android toolchains, and the explicit omission/deferment of iOS artifacts and proof. See [Flutter application target](flutter.md).
|
|
134
|
+
|
|
131
135
|
## Source Map v3 and directives
|
|
132
136
|
|
|
133
137
|
`artifact.sourceMap` exists for all single-text target artifacts and mapped multi-artifact text outputs; browser Wasm additionally has the external binary projection described above. Maps are generated with `@jridgewell/gen-mapping`, while lookup, import, artifact validation, and independent test decoding use `@jridgewell/trace-mapping`. Semantifold does not hand-code VLQ or tracing. Text artifact validation requires dense `sources`, `names`, and optional `sourcesContent` arrays, canonical standard segments, valid indexes, and equality with the authoritative rich mapping projection. The v3 map contains deterministic `file`, `sources`, `sourcesContent`, `names`, and `mappings` fields.
|
|
@@ -139,7 +143,7 @@ generateArtifact({language: "javascript", module, mapDirective: "external"})
|
|
|
139
143
|
generateArtifact({language: "typescript", module, mapDirective: "inline"})
|
|
140
144
|
```
|
|
141
145
|
|
|
142
|
-
`external` appends `//# sourceMappingURL=<relative-map-url>`. `artifact.sourceMapFilename` remains the map artifact's literal logical filename, while the directive is relative to `artifact.filename`'s directory and URL-encodes each filesystem path segment without encoding structural slashes. Both logical paths resolve against one synthetic artifact root before relativization, so mixed leading-parent depths do not become false common segments; for example, generated `../../dist/out.js` and map `../maps/out.js.map` emit `../maps/out.js.map`. `dist/program.js` still advertises `dist/program.js.map` and emits `sourceMappingURL=program.js.map`; a literal `#` or `?` in the sidecar filename is emitted as `%23` or `%3F`. Names containing any ECMAScript line terminator—LF, CR, U+2028, or U+2029—are rejected before emission. `generateArtifactSet()` makes that reference materializable by adding the LF-terminated deterministic JSON serialization of `artifact.sourceMap` at the advertised safe path with role `mapping`; `generateArtifact()` retains its existing sidecar-object contract. `inline` appends a UTF-8 base64 data URL. The default is `none`. PHP, Ruby, Java, and Python still receive sidecar map objects but never receive non-native map comments. C#, Go, and
|
|
146
|
+
`external` appends `//# sourceMappingURL=<relative-map-url>`. `artifact.sourceMapFilename` remains the map artifact's literal logical filename, while the directive is relative to `artifact.filename`'s directory and URL-encodes each filesystem path segment without encoding structural slashes. Both logical paths resolve against one synthetic artifact root before relativization, so mixed leading-parent depths do not become false common segments; for example, generated `../../dist/out.js` and map `../maps/out.js.map` emit `../maps/out.js.map`. `dist/program.js` still advertises `dist/program.js.map` and emits `sourceMappingURL=program.js.map`; a literal `#` or `?` in the sidecar filename is emitted as `%23` or `%3F`. Names containing any ECMAScript line terminator—LF, CR, U+2028, or U+2029—are rejected before emission. `generateArtifactSet()` makes that reference materializable by adding the LF-terminated deterministic JSON serialization of `artifact.sourceMap` at the advertised safe path with role `mapping`; `generateArtifact()` retains its existing sidecar-object contract. `inline` appends a UTF-8 base64 data URL. The default is `none`. PHP, Ruby, Java, and Python still receive sidecar map objects but never receive non-native map comments. C#, Go, Dart, and Zig reject even an explicitly supplied `none`, because multi-backend options must not be silently consumed and their fixed multi-artifact projects have no source-map directive contract. Native Java debugger mapping, C# portable-PDB integration, Go compiler source-map integration, and Dart/Zig compiler integration would require compiler-artifact integration and are not part of v1.
|
|
143
147
|
|
|
144
148
|
The directive itself is an unmapped synthetic rich-map span. `artifact.sourceMap` is computed for the program before that self-referential comment is appended; this is required for a stable inline data URL and is the conventional v3 behavior. Use the rich mapping when the directive span itself matters. Rich registries may distinguish same-named sources by `sourceId`; Source Map v3 identifies sources by filename, so callers should use unique filenames when exporting such an assembled registry to v3.
|
|
145
149
|
|
package/docs/testing.md
CHANGED
|
@@ -326,11 +326,11 @@ The unchanged legacy parser has a measured 32,767-UTF-16-code-unit source limit
|
|
|
326
326
|
|
|
327
327
|
The five C Tasks 001–004 fixtures generate/reparse/execute all original-five targets using real PHP, Ruby, Node, TypeScript/Node and Java compiler/runtime commands. One original-five source rotates through each C profile. Rich/v3 tests verify token origins, synthetic context, shared occurrences, stale metadata and UTF-16 coordinates. Negative corpora cover parser recovery, preprocessing/declarators, ownership/pointers, collisions, malformed IR and every ordered-region boundary. [The C profile](c.md) specifies the exact source, memory and overflow contracts.
|
|
328
328
|
|
|
329
|
-
For these deliveries, local testing
|
|
329
|
+
For these earlier deliveries, local testing was restricted to explicitly named changed/affected files. The current aggregate `npm test` gate covers fifteen source languages and includes Zig Debug/ReleaseSafe/ReleaseFast, Kotlin/JVM, Dart VM/native, Rust debug/release, and mandatory C/CPP O0/O2 sanitizers. Existing generic aggregate examples below describe that CI gate. Coordinator-owned independent review, exact-head CI and merge remain separate from local implementation delivery; publication/version/tag/release is not part of the language candidates.
|
|
330
330
|
|
|
331
331
|
Specs use the released `@velocious/testing@0.0.0` framework and standalone `velocious-test` runner with one top-level `describe` per file. Direct value checks use the framework's `expect` API where it improves clarity; predicate-rich diagnostic assertions retain `node:assert/strict`. Frontend tests load real fixtures through Babel, php-parser, Prism, Lezer, and the qualified official Tree-sitter Python/C#/Go routes and compare modeled meaning after removing source locations and the separately tested provenance index. They separately assert normalized annotations, complete named/anonymous/comment/directive traversal, parser recovery rejection, and exact UTF-16 locations.
|
|
332
332
|
|
|
333
|
-
The private `packages/tree-sitter-legacy`
|
|
333
|
+
The private `packages/tree-sitter-legacy` and `packages/tree-sitter-zig` workspaces own source checking and parser-neutral declaration generation for their internal runtimes; none of those packages is independently publishable. Direct specs assert versioned frozen plain-data C/CPP/Rust/Zig CSTs, ordered field-bearing children, error/missing/extra state, UTF-16 indices and positions, and declaration surfaces without native types. The distribution spec runs the root package's real `prepack` from a disposable copy of package inputs and installed dependencies, so a clean build cannot replace shared workspace declarations while another spec reads them. It checks that the root tarball physically contains root `tree-sitter@0.25.1`, the legacy package's isolated exact `tree-sitter@0.21.1` with C/CPP/Rust grammars, and the Zig package's isolated exact `tree-sitter@0.22.4` with grammar 1.1.2, including licenses, platform prebuilds, and source fallbacks. It installs only that root tarball into a consumer with cleaned npm configuration and a fresh npm cache, resolves exact `tree-sitter-kotlin@0.4.0` from its integrity-locked full-SHA HTTPS archive, verifies the installed lock and full npm tree, compiles a root API type consumer, and runs modern Kotlin/Go beside legacy C/CPP/Rust and isolated Zig in one Node24 process. The temporary package copy, tarball, cache, lockfile, dependencies, and consumer are always removed; no packed archive or dependency build is committed.
|
|
334
334
|
|
|
335
335
|
`tree-sitter-legacy-install-consistency.spec.js` reproduces source edits after `npm ci` in unique isolated npm fixtures, using the real pretest/prepack hooks and a semantic change to the serializer. Each shipped file must cause a stale-payload rejection until ordinary `npm ci` refreshes the installed copy; real tar extraction proves that subsequent packs contain the edited bytes. The shared gate uses npm's source pack inventory, checks the complete installed payload except its dependency subtree, and compares bytes before runtime specs, lint, and packing. The consumer spec independently compares every bundled internal file with source. Its configuration regression uses only synthetic registry and credential settings, removes all inherited `npm_config_*` inputs and token/module-path variables case-insensitively, isolates both user and global configuration files, and checks npm's effective public registry/config/cache settings before the real fresh-cache installation.
|
|
336
336
|
|
|
@@ -408,7 +408,7 @@ Run `npx velocious-test spec/repository-contract.spec.js` for the focused reposi
|
|
|
408
408
|
|
|
409
409
|
## Task019 CPP acceptance
|
|
410
410
|
|
|
411
|
-
The CPP lane selects `/usr/bin/clang++-21` through `SEMANTIFOLD_CLANGPP`; C retains `SEMANTIFOLD_CLANG`. The development image pins libstdc++-15-dev 15.2.0-16ubuntu1 and already obtains clang++ from the exact clang-21 package. Noble TensorBuzz reuses the signed LLVM21 setup above, explicitly installs g++-13/libstdc++ headers, probes clang++ and libstdc++, and runs framework-native discovery of all
|
|
411
|
+
The CPP lane selects `/usr/bin/clang++-21` through `SEMANTIFOLD_CLANGPP`; C retains `SEMANTIFOLD_CLANG`. The development image pins libstdc++-15-dev 15.2.0-16ubuntu1 and already obtains clang++ from the exact clang-21 package. Noble TensorBuzz reuses the signed LLVM21 setup above, explicitly installs g++-13/libstdc++ headers, probes clang++ and libstdc++, and runs framework-native discovery of all fifteen source languages. [The CPP profile](cpp.md) lists every compile/link, encoding, warning, exception/RTTI and sanitizer flag. Full-suite discovery is repeated by TensorBuzz for the exact candidate head.
|
|
412
412
|
|
|
413
413
|
```sh
|
|
414
414
|
export SEMANTIFOLD_CLANG=/usr/bin/clang-21
|
|
@@ -452,6 +452,28 @@ The packed-consumer test installs the single root tarball, retains only plain fr
|
|
|
452
452
|
|
|
453
453
|
Required local gates remain runtime consistency, focused named specs, lint, root/workspace strict typecheck and build, high-severity audit, production/all dependency listings, pack dry-run and diff check. TensorBuzz alone owns full/native aggregate discovery for the exact candidate head. Review, external package boundary, CI, merge and post-merge evidence remain coordinator-owned.
|
|
454
454
|
|
|
455
|
+
## Task031 Zig acceptance
|
|
456
|
+
|
|
457
|
+
The parser qualification fixes `@tree-sitter-grammars/tree-sitter-zig@1.1.2` and its isolated compatible `tree-sitter@0.22.4` runtime inside the private Zig workspace. The qualification spec proves package integrity/license/provenance, Node24 loading, ABI-14 typed metadata, full frozen child/field snapshots, recovery flags, UTF-16 coordinates, and exact Zig 0.15.2 `fmt --check` plus `zig test` acceptance of every retained syntax-corpus file under isolated caches. Runtime consistency and the packed-consumer proof cover both the source workspace and the installed/bundled ordinary `file:` payload; no separately published adapter or parser object enters the public API.
|
|
458
|
+
|
|
459
|
+
Run the focused Zig files with the exact qualified `SEMANTIFOLD_ZIG` executable when it is not already the canonical PATH command:
|
|
460
|
+
|
|
461
|
+
```sh
|
|
462
|
+
npx velocious-test spec/zig-parser-qualification.spec.js
|
|
463
|
+
npx velocious-test spec/zig-registry-toolchain.spec.js
|
|
464
|
+
npx velocious-test spec/zig-frontend-validation.spec.js
|
|
465
|
+
npx velocious-test spec/zig-backend-validation.spec.js
|
|
466
|
+
npx velocious-test spec/zig-native-execution.spec.js
|
|
467
|
+
npx velocious-test spec/zig-provenance.spec.js
|
|
468
|
+
npx velocious-test spec/zig-cross-language-acceptance.spec.js
|
|
469
|
+
npx velocious-test spec/tree-sitter-zig-install-consistency.spec.js
|
|
470
|
+
npx velocious-test spec/tree-sitter-legacy-packed-consumer.spec.js
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
Native acceptance creates a fresh project for every case, blocks package/network proxy variables, assigns distinct empty local and global caches to Debug, ReleaseSafe, and ReleaseFast, and runs `zig fmt --check src/main.zig build.zig`, `zig build test`, `zig build`, and the installed executable in each mode. It requires exact stdout/stderr/status, byte-stable input artifacts, canonical generated reparse, Unicode and embedded NUL strings, lifetime-sensitive call chains, arbitrary required arity/void calls, all scalar operators, signed-64-bit extrema, and status 70 for add/subtract/multiply/negate overflow in every mode. Focused frontend differentials prove that exact Zig rejects invalid native slice operators before Semantifold rejects the same operator/helper substitution at its source occurrence. Backend and native regressions require complete signed ordered-expression regions, typed left-to-right eager temporaries, nested call and helper ordering, first-failure ordering, and conditional right-hand evaluation for `and` and `or`; malformed or partial scaffolds are rejected. Crossings exercise managed semantics through Zig and Zig-derived semantics through real C, Rust, and Java toolchains. Compiler or formatter rejection is a backend failure; tests never install or download Zig or packages.
|
|
474
|
+
|
|
475
|
+
The complete repository gate remains `LANG=C.UTF-8 LC_ALL=C.UTF-8 npm test`, lint, root and workspace typecheck/build, high-severity audit, both dependency trees, pack dry-run/manifest, and `git diff --check`. TensorBuzz repeats the aggregate at the exact candidate head with the source-independent checksum-pinned Zig installation. Independent review, exact-head CI, merge, and any release remain coordinator-owned.
|
|
476
|
+
|
|
455
477
|
## Task026 iOS application generation acceptance
|
|
456
478
|
|
|
457
479
|
Task 026's implemented Linux generation/provenance scope is kept in two focused files. Run them individually and sequentially; do not replace them with local spec-directory discovery or a broad suite:
|
|
@@ -482,7 +504,28 @@ npx velocious-test spec/android-packed-consumer.spec.js
|
|
|
482
504
|
|
|
483
505
|
Generation coverage validates multi-module/Unicode capture, mappings, configuration causality, deterministic fixed-root ownership, manifest/UI/dependency shape, resources/assets, collisions, and preflight diagnostics. Materialization is repository-private acceptance support: it requires an empty mode-0700 non-symlink directory, creates files exclusively, verifies checksum readback, and is neither exported nor packed. The packed proof uses clean public-registry npm install/ci and strict TypeScript consumption.
|
|
484
506
|
|
|
485
|
-
TensorBuzz's Android lane runs `scripts/bootstrap-android.sh` online to checksum and prefetch only the qualified official toolchain/cache, including the exact Kotlin 2.2.10 compiler distribution used as a
|
|
507
|
+
TensorBuzz's Android lane runs `scripts/bootstrap-android.sh` online to checksum and prefetch only the qualified official toolchain/cache, including the exact Kotlin 2.2.10 compiler distribution used as a direct compiler input while implicit Gradle stdlib resolution stays disabled. The same pinned stdlib file is the sole Kotlin runtime packaged into the generated instrumentation APK. `scripts/accept-android.sh` then creates a fresh project and runs lint, JUnit, application/instrumentation assembly, dependency inspection, and APK leakage checks with `--offline`. It requires an empty application runtime graph; the unit-test graph must contain exactly non-transitive JUnit 4.13.2 at implementation scope and Hamcrest Core 1.3 at runtime scope because the JUnit runner loads Hamcrest before test code. Neither unit-test dependency nor Kotlin runtime implementation namespaces may appear in the app APK, while the instrumentation APK must contain `kotlin.jvm.internal.Intrinsics`. `scripts/android-emulator-acceptance.sh` requires usable `/dev/kvm`, forces acceleration, installs/launches/asserts exact base64-encoded UTF-8 output through platform instrumentation, then performs the Task 030 Flutter launch/UI proof on the same boot before destroying the emulator and repeating everything on one fresh boot. Missing tools/cache/KVM are infrastructure failures, never skips. Do not run this emulator script locally without KVM or substitute software emulation.
|
|
508
|
+
|
|
509
|
+
## Task030 Flutter application acceptance
|
|
510
|
+
|
|
511
|
+
Run the Flutter files individually and sequentially:
|
|
512
|
+
|
|
513
|
+
```sh
|
|
514
|
+
npx velocious-test spec/flutter-application.spec.js
|
|
515
|
+
npx velocious-test spec/flutter-materialization.spec.js
|
|
516
|
+
npx velocious-test spec/flutter-ui-assertion.spec.js
|
|
517
|
+
npx velocious-test spec/flutter-toolchain-contract.spec.js
|
|
518
|
+
npx velocious-test spec/flutter-packed-consumer.spec.js
|
|
519
|
+
npx velocious-test spec/language-registry.spec.js
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
Generation coverage includes Ruby- and Dart-originating programs, multiple modules, Unicode, exact widget output, registry/public-role separation, package/plugin/permission closure, deterministic ownership and hashes, rich source/configuration provenance, asset snapshots, unsafe identifiers/configuration/paths/collisions, unsupported semantics, and transactional rejection. Private materialization requires a fresh real mode-0700 root and verifies every byte without creating a public or packed writer. The packed proof repeats credential-free ordinary install and clean `npm ci` plus strict TypeScript consumption.
|
|
523
|
+
|
|
524
|
+
Real local SDK qualification uses exact Flutter 3.47.4 revision `9584c6713b324636289d067944a46fd6b49df14b` and its bundled Dart 3.13.3. Seed a fresh isolated `PUB_CACHE` only with the checksum-qualified archive's `.pub-preload-cache/*.tar.gz`; then the generated project must pass `dart pub get --offline --enforce-lockfile`, `dart format --output=none --set-exit-if-changed lib test`, Flutter analyze with `--no-pub --fatal-infos --fatal-warnings`, and Flutter test with `--no-pub`. No command may invoke `flutter create`, download a pub package, or rewrite the owned lockfile.
|
|
525
|
+
|
|
526
|
+
TensorBuzz retains one `android` build and exactly `/dev/kvm:/dev/kvm`. After the Task 028 bootstrap, `scripts/bootstrap-flutter.sh` verifies the official SDK archive's size/SHA/revision, seeds its isolated pub cache, and warms the same Gradle cache with a disposable project. `scripts/accept-flutter.sh` repeats restore, format, analyze, widget tests, lint, assembly, package graph, embedding, and APK-permission checks offline. The existing emulator script then installs and launches the Flutter APK during each of its two Task 028 fresh boots, requires exact `hé😀\nhé😀!\nhé😀!?` output under `semantifold-output`, and captures Flutter UI XML/screenshots. Flutter 3.47.4 requires the single shared Gradle 8.14 baseline; bypassing dependency validation or creating a second cache/emulator topology is forbidden.
|
|
527
|
+
|
|
528
|
+
These checks qualify only Android. No local or TensorBuzz step provisions or invokes macOS, Xcode, Apple SDK, CocoaPods, signing, or an iOS Simulator. No omitted Apple prerequisite is reported as a skip or success; dual-platform Task 030 completion remains deferred.
|
|
486
529
|
|
|
487
530
|
## Task022 Swift acceptance
|
|
488
531
|
|
package/docs/zig.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Zig source and target
|
|
2
|
+
|
|
3
|
+
Task 031 adds `zig` as a first-class source and deterministic native-project target for Tasks 001–005. It is one registry/backend spoke over the shared semantic model: there is no Zig-to-language adapter, source scan, compiler-diagnostic parser, or Zig-specific public IR.
|
|
4
|
+
|
|
5
|
+
## Qualified parser and compiler
|
|
6
|
+
|
|
7
|
+
The private `packages/tree-sitter-zig` boundary owns exact `@tree-sitter-grammars/tree-sitter-zig@1.1.2` (MIT, npm integrity `sha512-J0L31HZ2isy3F5zb2g5QWQOv2r/pbruQNL9ADhuQv2pn5BQOzxt80WcEJaYXBeuJ8GHxVT42slpCna8k1c8LOw==`) with its compatible isolated `tree-sitter@0.22.4`. The grammar release corresponds to authoritative upstream `tree-sitter-grammars/tree-sitter-zig` tag `v1.1.2` and commit `b670c8df85a1568f498aa5c8cae42f51a90473c0`. Node 24 loads its ABI-14 native grammar. Only schema-1, deeply frozen, parser-neutral CST data crosses the private runtime boundary; the one native grammar-handle assertion stays inside that boundary.
|
|
8
|
+
|
|
9
|
+
Qualification covers ordered field-bearing children, anonymous tokens, extras, error/missing/recovery state, typed node metadata, UTF-8 byte to UTF-16 conversion including CRLF and astral scalars, and the Task-031 syntax corpus. The adapter recursively accounts for every edge and rejects parser recovery, doc/container-directive comments, or unmodeled nodes. The grammar's tracked Zig 0.16 work is not part of release 1.1.2, so this profile deliberately selects exact Zig 0.15.2 rather than claiming moving-language coverage.
|
|
10
|
+
|
|
11
|
+
The canonical Linux x86-64 compiler is the official `zig-x86_64-linux-0.15.2.tar.xz`, size `53733924`, SHA-256 `02aa270f183da276e5b5920b1dac44a63f1a49e55050ebde3aecc9eb82f93239`; its qualified `zig` executable hashes to `2858dc89dbbfdd08cceda1b841e7fd0a793a1a67b49f150bc3d0d1de44ed7f51`. Docker and TensorBuzz require AMD64, fetch that source-independent archive during environment preparation, verify all metadata, install `/opt/zig-0.15.2/zig`, and require `zig version` to equal `0.15.2`. Runtime tests neither fetch nor install anything. `SEMANTIFOLD_ZIG` may select only an absolute executable that passes exact 0.15.2 discovery; the canonical Docker/TensorBuzz installation separately owns the Linux x86-64 architecture and archive-integrity proof.
|
|
12
|
+
|
|
13
|
+
## Exact source subset
|
|
14
|
+
|
|
15
|
+
The source is a complete canonical `src/main.zig` entry: the exact Semantifold-owned standard-library support prelude, the generated profile marker, zero or more top-level `fn` declarations, and one exact `pub fn main() void` shell with arena cleanup. Every semantic statement is enclosed by a deterministic signed ordered-expression region. Those regions bind effectful eager operands and call arguments to typed temporaries in semantic left-to-right order; `and` and `or` instead place their right-hand regions inside the generated conditional branch. Semantic functions accept any number of required positional parameters, including zero, and return `i64`, `bool`, `[]const u8`, or `void`. Parameters and initialized locals are explicitly typed; locals use `const` or `var`; only mutable locals may be assigned. A void function may fall through or use bare `return`, while non-void functions require explicit path-complete returns. Direct calls, void expression statements, strict-Boolean `if`/`else`, and scalar output are accepted.
|
|
16
|
+
|
|
17
|
+
Integer literals retain the semantic safe-integer source bound. Operations are checked `i64` add, subtract, multiply, and negate plus integer comparisons; Booleans support equality, inequality, `!`, `and`, and `or`; strings support concatenation, equality, and inequality. The frontend retains each source operator or helper occurrence through type resolution: native operators must be valid for the resolved Zig types, and every generated helper must exactly match its normalized operation and signature. Cross-family helper substitutions and native slice arithmetic or equality are rejected at the substituted source occurrence instead of being normalized into valid semantics. Evaluation is left-to-right at the semantic boundary and Boolean operators short-circuit. String literals are Unicode scalar text with canonical escapes, including embedded NUL. Identifiers must be ordinary non-reserved Zig names and cannot enter the `semantifold_` helper namespace.
|
|
18
|
+
|
|
19
|
+
Inference, optional/default/rest parameters, overloading, methods, containers, imports beyond the exact generated `std` import, user builtins, `comptime`, `anytype`, generics, optionals, error unions/sets, `try`/`catch`, `defer`/`errdefer`, wrapping or saturating arithmetic, casts, pointers, user slices/arrays/structs/unions/enums, allocators, C imports/FFI, assembly, reflection, async/concurrency, undefined values, and `unreachable` are rejected with parser-backed locations. Inputs with lone surrogates, more than 1,000,000 UTF-16 code units, or CST nesting beyond 512 also fail. No compiler message or text pattern repairs rejected syntax.
|
|
20
|
+
|
|
21
|
+
## Project, lifetime, and failures
|
|
22
|
+
|
|
23
|
+
`generateArtifactSet({language: "zig"})` returns exactly two ordered LF artifacts: synthetic `build.zig`, then rich-mapped sole-entry `src/main.zig`. Zig 0.15.2 needs no `build.zig.zon` for this dependency-free standard-library-only native-host build. Generation validates the full semantic graph, names, types, calls, flow, mutability, known integer/string bounds, source size/depth, fixed paths/options, complete ordered-expression plan, final CST, and complete artifact set before anything is returned. The frontend regenerates the canonical project and compares the complete significant CST so a missing, reordered, retyped, or partially copied ordering scaffold cannot be accepted. Generation performs no filesystem, compiler, cache, package-manager, or network operation.
|
|
24
|
+
|
|
25
|
+
Strings are immutable `[]const u8`. Literals borrow static storage; concatenation allocates into one generated global arena; the exact `main` defer releases that arena only after every semantic statement completes. No semantic operation observes pointer identity, sentinel termination, capacity, mutation, allocation ownership, or transfer. Allocation and output failures write a fixed diagnostic and exit 70. Checked arithmetic uses Zig overflow intrinsics and exits 70 with `semantifold: integer overflow\n`; Debug, ReleaseSafe, and ReleaseFast therefore have identical observable overflow boundaries and never rely on target overflow or undefined behavior.
|
|
26
|
+
|
|
27
|
+
`build.zig` exposes only Zig's standard optimization option and the host target. Acceptance copies validated artifacts to a fresh temporary project, uses distinct empty local/global caches per mode, blocks proxy/package-fetch variables, runs `zig fmt --check src/main.zig build.zig`, `zig build test`, `zig build`, and the installed executable in Debug, ReleaseSafe, and ReleaseFast, and verifies that input artifact hashes never change. Cross-compilation and package dependencies are outside this profile.
|
|
28
|
+
|
|
29
|
+
## Provenance and diagnostics
|
|
30
|
+
|
|
31
|
+
Function, parameter, local, type, assignment, operator/helper, callee, argument, literal, return, condition, output, and entry-statement occurrences retain exact or anchored semantic provenance in `src/main.zig`. The runtime, arena, output helpers, punctuation, ordered-region markers and signatures, typed ordering temporaries, conditional-right-hand plumbing, necessary unused/unmutated binding scaffolds, and entry shell are synthetic with related semantic origins. `build.zig` has artifact-level synthetic configuration provenance. The embedded Source Map v3 names `src/main.zig`; Zig source-map directives and alternate filenames are rejected.
|
|
32
|
+
|
|
33
|
+
Recovery uses `PARSE_ERROR`; missing or inferred types use `MISSING_TYPE`; excluded source syntax uses located `UNSUPPORTED_SYNTAX`; ordinary shared resolution/type/flow diagnostics remain unchanged. Backend graph, target, option, bound, or artifact failures use `UNSUPPORTED_CAPABILITY` transactionally. `generate()` and `generateArtifact()` report `UNSUPPORTED_ROLE` because Zig is deliberately a multi-artifact backend.
|
package/index.js
CHANGED
|
@@ -97,8 +97,8 @@ export function generateArtifact(input) {
|
|
|
97
97
|
* @param {import("./src/semantic/types.js").BackendLanguage} input.language - Registered program target.
|
|
98
98
|
* @param {import("./src/semantic/types.js").SemanticProgram} input.program - Complete resolved program.
|
|
99
99
|
* @param {"text" | "application"} [input.role] - Explicit role; omitted preserves text generation.
|
|
100
|
-
* @param {import("./src/semantic/types.js").IosApplicationConfigurationInput | import("./src/semantic/types.js").AndroidApplicationConfigurationInput} [input.configuration] - Application configuration.
|
|
101
|
-
* @param {import("./src/semantic/types.js").IosApplicationAssetInput[] | import("./src/semantic/types.js").AndroidApplicationInputFile[]} [input.assets] - Exact caller assets.
|
|
100
|
+
* @param {import("./src/semantic/types.js").IosApplicationConfigurationInput | import("./src/semantic/types.js").AndroidApplicationConfigurationInput | import("./src/semantic/types.js").FlutterApplicationConfigurationInput} [input.configuration] - Application configuration.
|
|
101
|
+
* @param {import("./src/semantic/types.js").IosApplicationAssetInput[] | import("./src/semantic/types.js").AndroidApplicationInputFile[] | import("./src/semantic/types.js").FlutterApplicationAssetInput[]} [input.assets] - Exact caller assets.
|
|
102
102
|
* @param {import("./src/semantic/types.js").AndroidApplicationInputFile[]} [input.resources] - Exact Android caller resources.
|
|
103
103
|
* @returns {import("./src/semantic/types.js").GeneratedArtifactSet} Complete generated set.
|
|
104
104
|
*/
|
|
@@ -116,8 +116,8 @@ export function generateProgramArtifactSet(input) {
|
|
|
116
116
|
* @param {"none" | "external" | "inline"} [input.mapDirective] - JavaScript-family map directive.
|
|
117
117
|
* @param {string} [input.sourceMapFilename] - External map filename.
|
|
118
118
|
* @param {{filename: string, content: string, language?: import("./src/semantic/types.js").SemanticLanguage}[]} [input.sources] - Original sources.
|
|
119
|
-
* @param {import("./src/semantic/types.js").IosApplicationConfigurationInput | import("./src/semantic/types.js").AndroidApplicationConfigurationInput} [input.configuration] - Application configuration.
|
|
120
|
-
* @param {import("./src/semantic/types.js").IosApplicationAssetInput[] | import("./src/semantic/types.js").AndroidApplicationInputFile[]} [input.assets] - Exact caller assets.
|
|
119
|
+
* @param {import("./src/semantic/types.js").IosApplicationConfigurationInput | import("./src/semantic/types.js").AndroidApplicationConfigurationInput | import("./src/semantic/types.js").FlutterApplicationConfigurationInput} [input.configuration] - Application configuration.
|
|
120
|
+
* @param {import("./src/semantic/types.js").IosApplicationAssetInput[] | import("./src/semantic/types.js").AndroidApplicationInputFile[] | import("./src/semantic/types.js").FlutterApplicationAssetInput[]} [input.assets] - Exact caller assets.
|
|
121
121
|
* @param {import("./src/semantic/types.js").AndroidApplicationInputFile[]} [input.resources] - Exact Android caller resources.
|
|
122
122
|
* @returns {import("./src/semantic/types.js").GeneratedArtifactSet} Complete generated set.
|
|
123
123
|
*/
|
|
@@ -221,6 +221,6 @@ export function generateArtifactSet(input) {
|
|
|
221
221
|
const registryRole = role == "binary" ? "binaryBackend" : "applicationBackend"
|
|
222
222
|
const backend = languageRegistry.resolve(language, registryRole, module?.location)
|
|
223
223
|
|
|
224
|
-
return constructArtifactSet(backend(language == "android" ? input :
|
|
224
|
+
return constructArtifactSet(backend(language == "android" || language == "flutter" ? input :
|
|
225
225
|
{assets, configuration, filename, language, mapDirective, module, resources, sourceMapFilename, sources}))
|
|
226
226
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Semantifold contributors
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
15
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Semantifold internal Zig Tree-sitter runtime
|
|
2
|
+
|
|
3
|
+
This private implementation package is bundled only inside the root Semantifold distribution. It is not published or exported.
|
|
4
|
+
|
|
5
|
+
`parseCst(source)` serializes the exact `@tree-sitter-grammars/tree-sitter-zig@1.1.2` grammar through isolated `tree-sitter@0.22.4` into recursively frozen `semantifold.parser-cst` version 1 data with UTF-16 indices and positions. Parser, tree, syntax-node, and language handles never leave this package.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Amaan Qureshi <amaanq12@gmail.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# tree-sitter-zig
|
|
2
|
+
|
|
3
|
+
[![CI][ci]](https://github.com/tree-sitter-grammars/tree-sitter-zig/actions/workflows/ci.yml)
|
|
4
|
+
[![discord][discord]](https://discord.gg/w7nTvsVJhm)
|
|
5
|
+
[![matrix][matrix]](https://matrix.to/#/#tree-sitter-chat:matrix.org)
|
|
6
|
+
[![crates][crates]](https://crates.io/crates/tree-sitter-zig)
|
|
7
|
+
[![npm][npm]](https://www.npmjs.com/package/@tree-sitter-grammars/tree-sitter-zig)
|
|
8
|
+
[![pypi][pypi]](https://pypi.org/project/tree-sitter-zig)
|
|
9
|
+
|
|
10
|
+
Zig grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter).
|
|
11
|
+
|
|
12
|
+
## References
|
|
13
|
+
|
|
14
|
+
- [Zig Grammar](https://github.com/ziglang/zig-spec/blob/master/grammar/grammar.y)
|
|
15
|
+
|
|
16
|
+
[ci]: https://img.shields.io/github/actions/workflow/status/tree-sitter-grammars/tree-sitter-zig/ci.yml?logo=github&label=CI
|
|
17
|
+
[discord]: https://img.shields.io/discord/1063097320771698699?logo=discord&label=discord
|
|
18
|
+
[matrix]: https://img.shields.io/matrix/tree-sitter-chat%3Amatrix.org?logo=matrix&label=matrix
|
|
19
|
+
[npm]: https://img.shields.io/npm/v/@tree-sitter-grammars/tree-sitter-zig?logo=npm
|
|
20
|
+
[crates]: https://img.shields.io/crates/v/tree-sitter-zig?logo=rust
|
|
21
|
+
[pypi]: https://img.shields.io/pypi/v/tree-sitter-zig?logo=pypi&logoColor=ffd242
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"targets": [
|
|
3
|
+
{
|
|
4
|
+
"target_name": "tree_sitter_zig_binding",
|
|
5
|
+
"dependencies": [
|
|
6
|
+
"<!(node -p \"require('node-addon-api').targets\"):node_addon_api_except",
|
|
7
|
+
],
|
|
8
|
+
"include_dirs": [
|
|
9
|
+
"src",
|
|
10
|
+
],
|
|
11
|
+
"sources": [
|
|
12
|
+
"bindings/node/binding.cc",
|
|
13
|
+
"src/parser.c",
|
|
14
|
+
],
|
|
15
|
+
"conditions": [
|
|
16
|
+
["OS!='win'", {
|
|
17
|
+
"cflags_c": [
|
|
18
|
+
"-std=c11",
|
|
19
|
+
],
|
|
20
|
+
}, { # OS == "win"
|
|
21
|
+
"cflags_c": [
|
|
22
|
+
"/std:c11",
|
|
23
|
+
"/utf-8",
|
|
24
|
+
],
|
|
25
|
+
}],
|
|
26
|
+
],
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#include <napi.h>
|
|
2
|
+
|
|
3
|
+
typedef struct TSLanguage TSLanguage;
|
|
4
|
+
|
|
5
|
+
extern "C" TSLanguage *tree_sitter_zig();
|
|
6
|
+
|
|
7
|
+
// "tree-sitter", "language" hashed with BLAKE2
|
|
8
|
+
const napi_type_tag LANGUAGE_TYPE_TAG = {
|
|
9
|
+
0x8AF2E5212AD58ABF, 0xD5006CAD83ABBA16
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
Napi::Object Init(Napi::Env env, Napi::Object exports) {
|
|
13
|
+
exports["name"] = Napi::String::New(env, "zig");
|
|
14
|
+
auto language = Napi::External<TSLanguage>::New(env, tree_sitter_zig());
|
|
15
|
+
language.TypeTag(&LANGUAGE_TYPE_TAG);
|
|
16
|
+
exports["language"] = language;
|
|
17
|
+
return exports;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
NODE_API_MODULE(tree_sitter_zig_binding, Init)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
type BaseNode = {
|
|
2
|
+
type: string;
|
|
3
|
+
named: boolean;
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
type ChildNode = {
|
|
7
|
+
multiple: boolean;
|
|
8
|
+
required: boolean;
|
|
9
|
+
types: BaseNode[];
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
type NodeInfo =
|
|
13
|
+
| (BaseNode & {
|
|
14
|
+
subtypes: BaseNode[];
|
|
15
|
+
})
|
|
16
|
+
| (BaseNode & {
|
|
17
|
+
fields: { [name: string]: ChildNode };
|
|
18
|
+
children: ChildNode[];
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
type Language = {
|
|
22
|
+
name: string;
|
|
23
|
+
language: unknown;
|
|
24
|
+
nodeTypeInfo: NodeInfo[];
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
declare const language: Language;
|
|
28
|
+
export = language;
|