#cuda #incremental #parser

tree-sitter-cuda

cuda grammar for the tree-sitter parsing library

8 releases

new 0.20.4 Apr 2, 2024
0.20.3 Jul 23, 2023
0.20.2 Oct 10, 2022
0.1.0 Dec 9, 2021
0.0.1 Jun 16, 2021

#317 in Text editors

Download history 15/week @ 2024-02-20 33/week @ 2024-02-27 3/week @ 2024-03-05 7/week @ 2024-03-12 7/week @ 2024-03-19

65 downloads per month
Used in tree-painter

MIT license

24MB
727K SLoC

C 727K SLoC // 0.0% comments JavaScript 41 SLoC Rust 34 SLoC // 0.1% comments

tree-sitter-cuda

This is a extension of tree-sitter-cpp to support CUDA storage and function specifiers (__shared__, __device__) and its kernel call syntax.


lib.rs:

This crate provides cuda 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_cuda::language()).expect("Error loading cuda grammar");
let tree = parser.parse(code, None).unwrap();

Dependencies

~2.7–4MB
~71K SLoC