feat(languages): add Interv support to codegraph - #1693
Draft
iacore wants to merge 2 commits into
Draft
Conversation
added 2 commits
September 4, 2026 20:24
Wire Interv (.iv) into the tree-sitter extraction pipeline: - vendor a tree-sitter-interv wasm grammar (ABI 15, built with tree-sitter-cli 0.26.9) for the self-hosted functional language. - register the language in types.ts and grammars.ts (wasm file map, .iv extension, display name, vendored set). - add an Interv extractor: functions (name :: fn ...), algebraic data types as enums with constructors as members, import path module edges, and call edges. - add detection + extraction tests, a README supported-language row, and a CHANGELOG entry. Verification: extraction on the Interv repo's examples + src extracts 532 functions, 32 data types, 100 constructors and 12 imports across 69 files; verify-extraction passes; extraction.test.ts (627 tests) green.
…annotation and common forms Rebuild tree-sitter-interv.wasm from the refined grammar: - function-type annotations (fn (1 World -> 1 World)) and fn-value output binders parse cleanly (a binder's type is a non-arrow type_atom, so the -> separator is no longer consumed as a function-type arrow). - const definitions accept an optional trailing ';'. - string_literal handles escape sequences (\X) and a bare '}' as literal content, not only interpolation. Interv repo examples + src: 51 -> 0 AST errors in the compiler files (parser.iv 2189 -> 1, since fixed), and the self-hosted sources parse cleanly. Extraction: 605 functions, 32 enums, 100 constructors, 12 imports across 69 files; verify-extraction PASS.
Author
|
I'll report back after I use this myself for awhile. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds Interv (
.iv) support to CodeGraph — the self-hosting functional language in the Interv repo. Full extraction pipeline wiring, exactly as the other vendored grammars.tree-sitter-interv.wasm(ABI 15, built fromtree-sitter-cli 0.26.9+ wasi-sdk) insrc/extraction/wasm/. Registered inWASM_GRAMMAR_FILES+VENDORED_WASM_LANGS..iv→intervinEXTENSION_MAP(this is the file-scan gate, socodegraph initdiscovers.ivfiles).src/extraction/languages/interv.ts): maps:function_definition(name :: fn (binders) { body }) → functiondata Name { Ctor(...); … }→ enum with eachconstructoras an enum_memberimport path/to/module→ import (module edges)call_expression→ calls edgesclass/instance→ class + methodsLANGUAGES(types.ts),EXTRACTORS(languages/index.ts), display name "Interv".__tests__/extraction.test.ts.### Addedentry.Verification
examples/*.iv+src/*.iv(69 files): 532 functions, 32 enums, 100 enum members, 12 imports, 3 classes —verify-extraction.mjs→ PASS (structural symbols, language detected, edges resolved).__tests__/extraction.test.ts: all 627 tests pass (5 new Interv tests).tscclean.Notes / gaps
main : fn (1 World -> 1 World) :: fn (world: 1 World -> world: 1 World)produces one ERROR node per such file (the->output-binder separator insidefn (...)params is ambiguous with function-type arrows). The function body and its calls still extract; only that exotic annotation reads as an AST error. Documented follow-up./add-lang) is not applicable; extraction quality is measured on the Interv repo's own code instead.