JSDoc grammar for tree-sitter (tree-sitter/tree-sitter-jsdoc v0.23.2), 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) |
moon add moonbit-community/tree-sitter-jsdocimport {
"moonbit-community/treesitter",
"moonbit-community/tree-sitter-jsdoc" @tree_sitter_jsdoc,
}///|
test "parse jsdoc" {
let language = @tree_sitter_jsdoc.language()
let parser = @treesitter.Parser::new()
parser.set_language(language)
let source =
#|/** This is {something} that should not {error}. */
#|
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 : StringInstall
Download zipJSDoc grammar for tree-sitter (tree-sitter/tree-sitter-jsdoc v0.23.2), for the MoonBit port of Tree-sitter (moonbit-community/treesitter).