Macaulay2 grammar for tree-sitter.
Showcase of the tree-sitter parser used in mdbook with mdbook-tsitter preprocessor for m2 code + comparison between tree-sitter and highlightjs parser on a Rust example. (I'll make this app accessible soon and paste the link below)
- Highlighting (
highlights.scm) - Indentation (
indents.scm) - Symbol Tags (
tags.scm) - Folds (
folds.scm) - Node and Rust bindings
- WebAssembly parser (
tree-sitter-macaulay2.wasm)
This release supports Node and Rust bindings. C/C++, Go, Python, and Swift bindings are not shipped yet.
The WebAssembly parser is committed as tree-sitter-macaulay2.wasm for tools
that load Tree-sitter languages in Wasm form.
The npm package is published as tree-sitter-macaulay2.
npm install tree-sitter-macaulay2Install dependencies:
npm installRegenerate the parser and run the corpus tests:
npm run checkRebuild the WebAssembly parser:
npm run build:wasmThe generated corpus files are committed, so normal testing does not require Macaulay2. The Macaulay2-based generator is only needed when changing the generated-test inputs; see CONTRIBUTING.md for that maintainer workflow.
Until this parser is available through a registry, it can be installed manually
with a local parser configuration. If Neovim disagrees with tree-sitter parse,
rebuild/reinstall the compiled parser first; stale compiled parser artifacts are
the most common source of editor-only mismatches.
MIT (see LICENCE)