diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7989f7..3cc0a26 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - name: Set up tree-sitter - uses: tree-sitter/setup-action/cli@v1 + uses: tree-sitter/setup-action/cli@v2 - name: Run tests uses: tree-sitter/parser-test-action@v2 with: diff --git a/Cargo.toml b/Cargo.toml index e4f9c8d..87bbda1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,10 @@ include = [ path = "bindings/rust/lib.rs" [dependencies] -tree-sitter = "~0.20.10" +tree-sitter-language = "0.1" [build-dependencies] cc = "1.0" + +[dev-dependencies] +tree-sitter = "0.25" diff --git a/README.md b/README.md index b908a0d..2f3fce3 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,44 @@ [![matrix][matrix]](https://matrix.to/#/#tree-sitter-chat:matrix.org) [![npm][npm]](https://www.npmjs.com/package/tree-sitter-glimmer-typescript) +A tree-sitter grammar for Glimmer-flavored JavaScript (`.gjs`). Wraps +[tree-sitter-javascript][ts-js] and adds the `` +syntax used by Ember/Glimmer. + +## Source vs. generated files + +The single source of truth for the grammar is `grammar.js`. Most of the +files under `src/` are produced by `tree-sitter generate` and **must not +be edited by hand** — any change there will be overwritten on the next +generation, and CI verifies that committed artifacts match what +generation produces. + +**Hand-written (edit these):** + +- `grammar.js` — grammar definition +- `src/scanner.c` — external scanner (handles `