tree-sitter-v

June 17, 2026 · View on GitHub

crates.io GitHub

Tree-sitter grammar for V language.

Maintained fork of nedpals/tree-sitter-v. The original is unmaintained since 2023 — this fork keeps it up to date with modern tree-sitter releases and fixes.

Usage

use tree_sitter_v::LANGUAGE;

let mut parser = tree_sitter::Parser::new();
parser.set_language(&LANGUAGE.into())?;

let tree = parser.parse("fn main() { println(\"hello\") }", None)?;

Install

cargo add tree-sitter-v

Features

  • 244 node types covering V syntax
  • Functions, structs, generics, interfaces, enums
  • Arrays, slices, maps, closures
  • Comptime blocks and selectors
  • Match expressions, sum types, or-patterns
  • String interpolation with format specifiers
  • SQL expressions, C/JS interop
  • VSH mode
  • Syntax highlighting queries

Compared to upstream

nedpals/tree-sitter-vThis fork
tree-sitter API0.17 (legacy)0.26+ (tree-sitter-language)
Rust bindingsLanguage enumLanguageFn
Published on crates.ioNoYes
MaintenanceLast updated 2023Active

License

MPL-2.0 — see LICENSE.

Original grammar by Ned Palacios and contributors.