Macaulay2 grammar for tree-sitter.
- Highlighting (
highlights.scm) - Indentation (
indents.scm) - Symbol Tags (
tags.scm) - Folds (
folds.scm) - Local variables and scopes (
locals.scm)
The repository includes a Macaulay2-based test generation script that automates the creation of Tree-sitter corpus tests by using Macaulay2's internal disassemble function to obtain the ground-truth AST.
Note: This script requires Macaulay2 to be installed and available in your PATH as M2.
- Add expressions: Place Macaulay2 code in
.m2files withintest/test_generator/test_expressions/. Each non-empty line is treated as a separate test case. - Generate tests: Run the generation script from the project root:
bash test/test_generator/generate_tests.sh
- Verify: Run the Tree-sitter test suite:
tree-sitter test
The script generates .txt corpus files in test/corpus/ prefixed with auto_generated_. This ensures the parser's output exactly matches the behavior of the real Macaulay2 parser.
MIT (see LICENCE)