Zig AST explorer Kurt Wagner released Zlinter, a static website that packages Zig's AST parser to let developers explore tokenizer and parser output, targeting Zig 0.14.1. The tool, built with plain JS and CSS, has been praised by Zig compiler contributor matklad for aiding work on a new resilient parser experiment. A known issue is that file-level doc comments (//!) are not tokenized. Kurt https://ziggit.dev/u/Kurt 1 Hello all, I was poking about writing a linter between projects for personal use when I get even more distracted linter was already a distraction by the idea of packaging zigs AST parser into a static website to explore what the tokeniser and parser were producing Zlinter - Zig AST explorer https://kurtwagner.github.io/zlinter/explorer/ currently targeting 0.14.1 - also builds for master on a different branch but I’m not sure how to deploy both through GitHub Actions so sticking with 0.14.x as it’s more stable It’s plain JS and CSS no bundling or polyfills or whatever web devs do these days so mileage may vary on some browsers I’ve only tested on desktop Maybe once Zig is stable I will upstream something to the astexplorer.net http://astexplorer.net project, OR maybe it’s not that useful and was more of a recreational programming exercise, which is also fine by me I will probably update it to provide more interpreted context about the nodes instead of the raw data… unless I get distracted by something else… 18 Likes I noticed one minor thing, not sure if it is even noteworthy or worth any effort to “fix”, but while it tokenizes standard doc comments /// , file-level documentation with // doesn’t seem to be included. But either way, very neat, and thanks for sharing 1 Like Kurt https://ziggit.dev/u/Kurt 3 Thanks for pointing this out This bug made me question whether all nodes like tokens for comments were being visited when walking the tree, and I think this catches another bug - fn proto aren’t included under fn decl , which looks like a bug in ZLS where fn decl is being treated like a proto, instead of first walking the .fn decl and then the fn proto in data.lhs / node and node.@"0" It looks simple enough to fix, assuming this isn’t by design. I’ll take a better look tomorrow. 1 Like matklad https://ziggit.dev/u/matklad 4 Just wanted to say thanks for building this, the tool saved me quite a few headaches right now when dealing with assignments in our new Zig parser experiment: compiler Zig Resilient Parser @ https://zsf.zulipchat.com/ narrow/channel/454360-compiler/topic/Zig.20Resilient.20Parser/near/622093883 2 Likes