package tree-sitter
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
OCaml bindings for Tree-sitter
Install
dune-project
Dependency
Authors
Maintainers
Sources
mosaic-0.1.0.tbz
sha256=9e4e90d17f9b2af1b07071fe425bc2c519c849c4f1d1ab73cde512be2d874849
sha512=06e9c4a741590942e81a27738d0b5c0413fafec8cf3b7dae047ad69f155e7b718aa4223818dc161b7d028efffcfd3365905e264d6fd31d453910ddfa91dcf9b9
doc/src/tree-sitter.ocaml/tree_sitter_ocaml.ml.html
Source file tree_sitter_ocaml.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39external ocaml_ptr : unit -> nativeint = "caml_tree_sitter_ocaml_language" external interface_ptr : unit -> nativeint = "caml_tree_sitter_ocaml_interface_language" external type_ptr : unit -> nativeint = "caml_tree_sitter_ocaml_type_language" let ocaml () = Tree_sitter.Language.of_address (ocaml_ptr ()) let interface () = Tree_sitter.Language.of_address (interface_ptr ()) let type_ () = Tree_sitter.Language.of_address (type_ptr ()) let ocaml_highlights_query = {| (comment) @comment (string) @string (character) @string (constructor_name) @type (type_constructor) @type (module_name) @type ["let" "in" "match" "with" "function" "fun" "if" "then" "else" "type" "module" "open" "struct" "end" "sig" "val" "and" "rec" "of" "true" "false"] @keyword (value_name) @variable (number) @number |} let interface_highlights_query = ocaml_highlights_query let mk_highlighter lang_fn query_str = let parser = lazy (Tree_sitter.Parser.create (lang_fn ())) in let query = lazy (Tree_sitter.Query.create (lang_fn ()) ~source:query_str) in fun content -> let parser = Lazy.force parser in let query = Lazy.force query in let tree = Tree_sitter.Parser.parse_string parser content in Tree_sitter.highlight query tree let highlight_ocaml = mk_highlighter ocaml ocaml_highlights_query let highlight_interface = mk_highlighter interface interface_highlights_query
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>