261024.30 · 39360dfe85a607de32e4f610cf82084a94f52212
Code pages show their syntax tree
?tree on a code page lists the named nodes of its tree-sitter syntax tree as nested folds, each row with its field, kind, text and a link to its lines. A helper parses it, built by make syntax from syntax/, a module of its own, so the main binary stays pure Go and needs no C compiler. Without the helper or a grammar the page says so above the plain code. Rendered trees are cached by content hash.
reading declarations
Changes to syntax/go.mod. All files
@@ -0,0 +1,23 @@+module syntax++go 1.25++require (+ github.com/tree-sitter/go-tree-sitter v0.25.0+ github.com/tree-sitter/tree-sitter-bash v0.25.1+ github.com/tree-sitter/tree-sitter-c v0.24.2+ github.com/tree-sitter/tree-sitter-c-sharp v0.23.5+ github.com/tree-sitter/tree-sitter-cpp v0.23.4+ github.com/tree-sitter/tree-sitter-css v0.25.0+ github.com/tree-sitter/tree-sitter-go v0.25.0+ github.com/tree-sitter/tree-sitter-html v0.23.2+ github.com/tree-sitter/tree-sitter-java v0.23.5+ github.com/tree-sitter/tree-sitter-javascript v0.25.0+ github.com/tree-sitter/tree-sitter-json v0.24.8+ github.com/tree-sitter/tree-sitter-python v0.25.0+ github.com/tree-sitter/tree-sitter-ruby v0.23.1+ github.com/tree-sitter/tree-sitter-rust v0.24.2+ github.com/tree-sitter/tree-sitter-typescript v0.23.2+)++require github.com/mattn/go-pointer v0.0.1 // indirect