Skip to content
CAI
Software that uses CAICheck a score

WhatsApp/tree-sitter-erlang

60.3

Adequate · 2 October 2026

1.1k

lines of production code

JavaScript

with C

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a Tree-sitter grammar for the Erlang programming language, designed to parse Erlang source code into an abstract syntax tree. It provides core parsing capabilities, including support for modern Erlang syntax features like triple-quoted strings and map comprehensions, along with syntax highlighting queries for editor integration. The project also includes language bindings for C, Go, Node.js, Python, Rust, and Swift, enabling developers to utilize the parser within various software ecosystems.

Features

Added syntax highlighting for Erlang code

A new \queries/highlights.scm\ file has been added to provide syntax highlighting for Erlang source files. This configuration defines how various language constructs—such as primitive types, functions, attributes, reserved words, and operators—are visually categorized in editors that support Tree-sitter, improving code readability and navigation.

queries · high confidence

Expanded Erlang language support with new syntax features and SSR

The parser now supports several new Erlang syntax features, including triple-quoted strings (with optional sigils), nominal types, native records (EEP 79), and map comprehensions. It also introduces Server-Side Rendering (SSR) definitions using the \ssr:\ form, shebang support for escripts, and updated attributes for deprecation and feature flags. These changes enhance the parser's ability to handle modern Erlang code constructs and improve compatibility with OTP 29 features.

src · high confidence

Initial release of Erlang language bindings

This change introduces the initial set of language bindings for the Erlang grammar across C, Go, Node.js, Python, Rust, and Swift, enabling developers to parse Erlang source code using their preferred language's tree-sitter integration. The Rust binding has been updated to use the modern \tree-sitter-language\ crate and exposes the \HIGHLIGHTS\_QUERY\ constant, while the Node.js binding has been migrated from the legacy \nan\ library to \node-api-napi\ for improved compatibility and performance.

bindings · high confidence

Behavioural changes

Erlang grammar updated to version 0.20.0 with operator precedence fixes and new top-level expression support

This release updates the Erlang tree-sitter grammar to version 0.20.0, introducing significant parsing improvements. The operator precedence constants have been restructured to align with the Erlang compiler, specifically fixing the precedence of \andalso\, \orelse\, \?=\, and \catch\ to prevent misparsing. The grammar now supports parsing bare expressions as top-level forms, allowing it to handle files like \rebar.config\ or escripts that contain expressions rather than just standard Erlang forms. Additionally, the build system has been modernized by switching from Ruby to Python3 for post-processing generated files, and the Makefile now uses \npx tree-sitter-cli\ directly.

(repo-wide) · high confidence

Tree-sitter parser API updated to ABI version 2 with new language metadata and lexer capabilities

The vendored tree-sitter library has been upgraded, introducing a new ABI version (2) and significant structural changes to the parser API. The TSLanguage struct now includes metadata for versioning, support for reserved words and supertypes, and a new logging function for the lexer. Additionally, the API introduces new macros like ADVANCE\_MAP for lexer state transitions and updates the REDUCE macro signature to include precedence and production ID, while renaming internal types such as TSFieldMapSlice to TSMapSlice and TSLexMode to TSLexerMode.

_src/tree\sitter · high confidence

Test coverage

Added Erlang syntax highlighting tests

Added new test files in the \test/highlight\ directory to verify syntax highlighting for Erlang source code. The new tests cover attributes (e.g., \-module\, \-export\, \-spec\), compilation-related constructs, and various expression types, ensuring that keywords, functions, types, and operators are correctly identified by the highlighter.

test/highlight · high confidence

Dependencies

Upgrade to tree-sitter 0.25 and update build tooling

This release upgrades the underlying tree-sitter library from version 0.20 to 0.25 across all language bindings (Node.js, Rust, Python, Go, Swift). To support this major version jump, the Node.js binding has replaced the deprecated \nan\ package with \node-addon-api\ and \node-gyp-build\, and the Rust binding now uses the \tree-sitter-language\ crate alongside the main \tree-sitter\ dev dependency. Additionally, the Node.js build process now includes prebuilds via \prebuildify\ and pins \tar-fs\ to version 3.1.1 or higher to address a known security vulnerability.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 60 → 60 (+0.2)
  • Rubric changed (rubric-2026.09.12 → rubric-2026.09.18) — scores are not directly comparable.

Lenses

  • Code Health 100 → 100 (+0.0)
  • Architecture 69 → 69 (+0.0)
  • Maturity 42 → 42 (+0.0)
  • Readiness 69 → 70 (+1.6)
  • Security 100 → 100 (+0.1)

Resolved (1)

  • Off-boarding risk: anonymized user #1

New (3)

  • Documentation: no licence statement (README.md)
  • Documentation: no usage examples (README.md)
  • Off-boarding risk: anonymized user #1

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

WhatsApp/tree-sitter-erlang was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 2 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 6ba4c762eb3065495e3db85697ffeecdf364ce35 — the exact code this score is about.
  • Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-e569280dd5e2.