#tree-sitter #erlang #parser #incremental

tree-sitter-erlang

erlang grammar for the tree-sitter parsing library

12 breaking releases

new 0.12.0 Feb 7, 2025
0.10.0 Jan 21, 2025
0.9.0 Oct 21, 2024
0.7.0 Jul 15, 2024
0.0.1 Oct 20, 2022

#64 in Text editors

Download history 579/week @ 2024-10-20 382/week @ 2024-10-27 252/week @ 2024-11-03 205/week @ 2024-11-10 376/week @ 2024-11-17 347/week @ 2024-11-24 292/week @ 2024-12-01 489/week @ 2024-12-08 316/week @ 2024-12-15 36/week @ 2024-12-22 84/week @ 2024-12-29 147/week @ 2025-01-05 218/week @ 2025-01-12 563/week @ 2025-01-19 482/week @ 2025-01-26 605/week @ 2025-02-02

1,880 downloads per month
Used in utils-tree-sitter

MIT license

2MB
70K SLoC

C 69K SLoC // 0.0% comments JavaScript 1K SLoC // 0.0% comments Scheme 138 SLoC // 0.3% comments Rust 30 SLoC // 0.2% comments

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.


lib.rs:

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());

Dependencies

~4–310KB