OCaml bindings for tree-sitter's JavaScript / WebAssembly implementation, using brr.
brr-web-tree-sitter works only with js_of_ocaml builds, not native code. The resulting javascript has two requirements:
- It includes
require('web-tree-sitter')
. You need to use a JavaScript build tool like Webpack or Parcel to link it. - When initialized, it will issue a request for
tree-sitter.wasm
(relative to where the js was loaded from).
> dune build
> cd _build/default/bin
> yarn install
> cp node_modules/web-tree-sitter/tree-sitter.wasm .
> yarn parcel demo.html