Markdown grammar for tree-sitter (tree-sitter-grammars/tree-sitter-markdown v0.5.4), for the MoonBit port of Tree-sitter (moonbit-community/treesitter).
| MoonBit | Rust |
|---|---|
| language() -> @treesitter.Language | LANGUAGE |
| inline_language() -> @treesitter.Language | INLINE_LANGUAGE |
| highlight_query_block : String | HIGHLIGHT_QUERY_BLOCK (tree-sitter-markdown/queries/highlights.scm) |
| injection_query_block : String | INJECTION_QUERY_BLOCK (tree-sitter-markdown/queries/injections.scm) |
| highlight_query_inline : String | HIGHLIGHT_QUERY_INLINE (tree-sitter-markdown-inline/queries/highlights.scm) |
| injection_query_inline : String | INJECTION_QUERY_INLINE (tree-sitter-markdown-inline/queries/injections.scm) |
| node_types_block : String | NODE_TYPES_BLOCK (tree-sitter-markdown/src/node-types.json) |
| node_types_inline : String | NODE_TYPES_INLINE (tree-sitter-markdown-inline/src/node-types.json) |
moon add moonbit-community/tree-sitter-markdownimport {
"moonbit-community/treesitter",
"moonbit-community/tree-sitter-markdown" @tree_sitter_markdown,
}///|
test "parse markdown" {
let language = @tree_sitter_markdown.language()
let parser = @treesitter.Parser::new()
parser.set_language(language)
let source =
#|| foo | bar |
#|| --- | --- |
#|| baz | bim |
#|
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 highlight_query_block : Stringlet highlight_query_inline : Stringlet injection_query_block : Stringlet injection_query_inline : Stringlet node_types_block : Stringlet node_types_inline : StringInstall
Download zipMarkdown grammar for tree-sitter (tree-sitter-grammars/tree-sitter-markdown v0.5.4), for the MoonBit port of Tree-sitter (moonbit-community/treesitter).