#tree-sitter #erlang #incremental-parser

tree-sitter-erlang

erlang grammar for the tree-sitter parsing library

15 breaking releases

0.15.0 Oct 7, 2025
0.14.0 Apr 8, 2025
0.13.0 Mar 11, 2025
0.9.0 Oct 21, 2024
0.0.1 Oct 20, 2022

#411 in Parser implementations

Download history 685/week @ 2025-07-17 390/week @ 2025-07-24 450/week @ 2025-07-31 548/week @ 2025-08-07 495/week @ 2025-08-14 863/week @ 2025-08-21 612/week @ 2025-08-28 544/week @ 2025-09-04 786/week @ 2025-09-11 1072/week @ 2025-09-18 1077/week @ 2025-09-25 2912/week @ 2025-10-02 1581/week @ 2025-10-09 1783/week @ 2025-10-16 1241/week @ 2025-10-23 832/week @ 2025-10-30

5,671 downloads per month
Used in 4 crates (3 directly)

MIT license

2MB
73K SLoC

C 71K SLoC // 0.0% comments JavaScript 1K SLoC // 0.0% comments Scheme 138 SLoC // 0.3% comments Rust 31 SLoC // 0.2% comments

This crate provides Erlang language support for the tree-sitter parsing library.

Typically, you will use the [LANGUAGE][] constant to add this language to a tree-sitter Parser, and then use the parser to parse some code:

let code = r#"
"#;
let mut parser = tree_sitter::Parser::new();
let language = tree_sitter_erlang::LANGUAGE;
parser
    .set_language(&language.into())
    .expect("Error loading Erlang parser");
let tree = parser.parse(code, None).unwrap();
assert!(!tree.root_node().has_error());

Tree Sitter Erlang

This represents tree-sitter grammar used for the Erlang language in the ELP project.

It started as a direct clone of https://github.com/AbstractMachinesLab/tree-sitter-erlang at 7b436e1ca50f0002f6765a9a2a00f6156b2cc881, but was later heavily modified for completeness.

Usage

Install the required toolchain with

make deps

Edit the grammar.js file and re-generate the code with:

make gen

Useful test command, parses foo.erl and opens a browser window to show the process, with pretty pictures of the generated AST.

npm run parse -- --debug-graph testdata/foo.erl

License

tree-sitter-erlang is Apache licensed.

Dependencies

~240KB