Skip to content

Repository files navigation

tree-sitter-macaulay2

Macaulay2 grammar for tree-sitter.

screenshot-2026-06-18_07-40-19

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)

Features

  • Highlighting (highlights.scm)
  • Indentation (indents.scm)
  • Symbol Tags (tags.scm)
  • Folds (folds.scm)
  • Node and Rust bindings
  • WebAssembly parser (tree-sitter-macaulay2.wasm)

Supported Bindings

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.

Package

The npm package is published as tree-sitter-macaulay2.

npm install tree-sitter-macaulay2

Development

Install dependencies:

npm install

Regenerate the parser and run the corpus tests:

npm run check

Rebuild the WebAssembly parser:

npm run build:wasm

Generated Corpus

The 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.

Neovim

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.

References

License

MIT (see LICENCE)

About

tree-sitter parser for macaulay2

Topics

Resources

Contributing

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages