#parser #incremental #gomod

tree-sitter-gomod

gomod grammar for the tree-sitter parsing library

2 stable releases

1.0.1 Dec 18, 2023
1.0.0 Jul 31, 2023

#210 in Text editors

Download history 1/week @ 2024-03-14 21/week @ 2024-03-28 11/week @ 2024-04-04 51/week @ 2024-04-11 3/week @ 2024-04-18 1009/week @ 2024-05-23 2448/week @ 2024-05-30 2400/week @ 2024-06-06 3132/week @ 2024-06-13 2813/week @ 2024-06-20 2116/week @ 2024-06-27

10,883 downloads per month

MIT license

110KB
4K SLoC

C 3.5K SLoC JavaScript 130 SLoC Scheme 40 SLoC Rust 31 SLoC // 0.5% comments

tree-sitter-gomod

tree-sitter grammar for go.mod files.

Status

The grammar is fairly small, and has been working well for highlighting for me. I expect it to evolve slightly to better fit tree-sitter best practices, but there shouldn't be anything major.


lib.rs:

This crate provides gomod language support for the tree-sitter parsing library.

Typically, you will use the language function to add this language to a tree-sitter Parser, and then use the parser to parse some code:

let code = "";
let mut parser = tree_sitter::Parser::new();
parser.set_language(tree_sitter_gomod::language()).expect("Error loading gomod grammar");
let tree = parser.parse(code, None).unwrap();

Dependencies

~2.7–4MB
~72K SLoC