Tree-sitter grammar for the Antlers templating language used by Statamic CMS.
| Feature | Status | Notes |
|---|---|---|
| Variables | ✅ | Simple, nested, and array access are supported. |
| Comments | ✅ | Both {{# ... #}} and {{!-- ... --}} styles are supported. |
| Data Types | ✅ | Strings, numbers (including hex and octal), and booleans are supported. |
| Operators | Most arithmetic, comparison, and logical operators are supported, but there are some precedence issues with or. |
|
| Control Structures | ✅ | if, elseif, else, and unless are supported. |
| Loops | ✅ | collection, nav, taxonomy, and form loops are supported. |
| Modifiers | ✅ | Modifiers with and without parameters are supported. |
| PHP Integration | ✅ | {{? ... ?}} and {{$ ... $}} are supported. |
| Interpolation | ✅ | Interpolation in parameters is supported. |
| Multi-statements | ✅ | Multiple statements separated by semicolons are supported. |
| Array Methods | ✅ | Array methods like orderby, groupby, etc. are supported. |
| Specialized Tags | ✅ | Most specialized tags like cache, session, markdown, etc. are supported. |
- ~80% Antlers specification coverage
- Comprehensive syntax highlighting and editor support
- Clone the repository:
git clone https://github.com/Robertsson/tree-sitter-antlers.git
cd tree-sitter-antlers- Install dependencies:
npm install- Generate the parser:
tree-sitter generate- Test the parser:
tree-sitter testContributions are welcome! Please see CONTRIBUTING.md for more information.
MIT License - see LICENSE for details.
- Tree-sitter - Incremental parsing library
- Antlers - Statamic's templating language
- Statamic CMS - The CMS that uses Antlers