| Crates.io | tree-sitter-cfengine |
| lib.rs | tree-sitter-cfengine |
| version | 1.0.12 |
| created_at | 2024-10-18 12:44:44.70751+00 |
| updated_at | 2025-08-07 12:44:34.604733+00 |
| description | CFEngine grammar for tree-sitter |
| homepage | |
| repository | https://github.com/olehermanse/tree-sitter-cfengine |
| max_upload_size | |
| id | 1414221 |
| size | 148,952 |
This tree-sitter grammar parses CFEngine policy language and turns it into an abstract syntax tree. It is used to provide syntax highlighting in the Zed editor, via this extension:
https://github.com/olehermanse/zed-cfengine
The grammar currently supports all major features of the language, including:
$() and @())Before contributing for the first time, it's recommended to go through the tree-sitter tutorial for getting familiar with how everything works:
https://tree-sitter.github.io/tree-sitter/creating-parsers
Inspired by Lars Erik Wik's initial implementation available here:
https://github.com/larsewi/tree-sitter-cfengine
docker build --tag tree-sitter-cfengine .
After making changes to grammar.js, run the the commands below to generate, build, and test:
tree-sitter generate && tree-sitter build && tree-sitter test
In tree-sitter projects, it is normal to commit the files generated / edited by the tree-sitter tooling.
Once it is working and tests are passing, commit the changes (including src/ folder with generated files).
Creating a release in GitHub will not work. To create a new release, you need to make a commit and tag locally, and push it. First ensure you have a clean git repo without any uncommitted changes. Then, run the following commands:
tree-sitter version 1.2.3
git add -A
git commit -S -s -m "Bump to version 1.2.3"
git tag -s -a 1.2.3 -m 1.2.3
git push --tags
GitHub Actions will start when a tag is pushed, and the action will create the "Release" in GitHub, as well as pypi, npm, and crates.io: