projects/tree-sitter-al
maintained tree-sitter-al order 05

tree-sitter-al

A Tree-sitter grammar for the AL programming language used in Microsoft Dynamics 365 Business Central, enabling syntax highlighting and code analysis in editors and tools.

Stack
C · JavaScript · Tree-sitter
Status
Maintained
Released
2024
License
MIT

Overview

A Tree-sitter grammar for the AL language used in Business Central development. Parses 99.59% of 15,358 tested AL files successfully.

Covers tables, pages, codeunits, enums, reports, XMLPorts, queries, interfaces, extensions, permission sets, and entitlements. Handles preprocessor directives, interface operators, multi-dimensional arrays, range expressions, namespace-qualified type references, ternary expressions, and the full AL property system.

Used as the parsing backend for the AL Call Hierarchy server. v2.0.0 promoted attributes to first-class statements, which is a breaking change for consumers relying on the old parse tree structure.

Highlights

Parses 99.59% of 15,358 tested AL files
Stateful external scanner, 8 specialized tokens
82 named keyword nodes for highlighting and nav
Queries for highlights, locals, tags, folds, indent
Runs on Linux, Windows, macOS, and WASM

Related writing

02