-
Notifications
You must be signed in to change notification settings - Fork 5
Add Zig parser support (.zig) #140
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
Ix does not currently parse .zig files. Zig source files are treated as unrecognized and excluded from analysis, meaning systems-level logic, memory management patterns, and build configurations written in Zig are invisible to the system.
Proposed solution
Add a Zig parser that can identify and extract:
- Function definitions (e.g.
fn main() void {}) - Struct, union, and enum definitions
- Variable and constant declarations (
var,const) - Import statements (e.g.
@import("std")) - Comptime expressions and comptime blocks
- Error handling patterns (e.g.
try,catch, error unions) - Build system definitions (
build.zig)
Support the following file patterns: *.zig
Why it matters
Zig is an emerging systems programming language gaining traction as a modern alternative to C, particularly for performance-critical and low-level code. It also serves as a cross-compilation toolchain used beyond Zig projects themselves. Without parsing Zig, Ix cannot reason about systems-level code or build logic in codebases that have adopted it.
Merge requirements
Before this can be merged to main, the following must pass:
- Tested on 3 repos
- No regressions on existing parsers (
ix mapon a known TS/JS repo, verify counts unchanged) - Unit + smoke tests pass (
npm testinix-cli) - Function definitions (
fn) ingested as entities - Struct, union, and enum definitions ingested
-
varandconstdeclarations ingested -
@importstatements resolved -
comptimeblocks ingested as entities - CONTAINS chains correctly: file → struct/enum → field/method
-
build.zigingested and build-level declarations visible -
ix textreturns results withlanguage: zig -
ix containsreturns members for a known Zig struct or enum
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request