C# grammar for tree-sitter (tree-sitter/tree-sitter-c-sharp v0.23.5), for the MoonBit port of Tree-sitter (moonbit-community/treesitter).
| MoonBit | Rust |
|---|---|
| language() -> @treesitter.Language | LANGUAGE |
| node_types : String | NODE_TYPES (src/node-types.json) |
| highlights_query : String | HIGHLIGHTS_QUERY (queries/highlights.scm) |
| tags_query : String | TAGS_QUERY (queries/tags.scm) |
moon add moonbit-community/tree-sitter-c-sharpimport {
"moonbit-community/treesitter",
"moonbit-community/tree-sitter-c-sharp" @tree_sitter_c_sharp,
}///|
test "parse c-sharp" {
let language = @tree_sitter_c_sharp.language()
let parser = @treesitter.Parser::new()
parser.set_language(language)
let source =
#|[assembly: Single]
#|[module: A, C()]
#|
guard parser.parse(@utf8.encode(source)) is Some(tree) else {
fail("parse failed")
}
let root = tree.root_node()
assert_false(root.has_error())
assert_false(root.to_sexp().contains("ERROR"))
}let highlights_query : Stringlet node_types : Stringlet tags_query : StringInstall
Download zipC# grammar for tree-sitter (tree-sitter/tree-sitter-c-sharp v0.23.5), for the MoonBit port of Tree-sitter (moonbit-community/treesitter).