Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CI

on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:

concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true

jobs:
test:
name: Test parser
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Set up repository
uses: actions/checkout@v6

- name: Set up tree-sitter
uses: tree-sitter/setup-action@v2
with:
install-lib: false

- name: Run tests
uses: tree-sitter/parser-test-action@v2

query:
name: Validate queries
runs-on: ubuntu-latest
steps:
- name: Set up repository
uses: actions/checkout@v6

- name: Set up tree-sitter
uses: tree-sitter/setup-action@v2
with:
install-lib: false

- name: Build parser
run: tree-sitter build

- name: Set up ts_query_ls
run: curl -fL https://github.com/ribru17/ts_query_ls/releases/latest/download/ts_query_ls-x86_64-unknown-linux-gnu.tar.gz | tar -xz

- name: Check queries
run: ./ts_query_ls check -f queries/
19 changes: 19 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Create release

on:
push:
tags: ["*"]
workflow_dispatch:

concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true

permissions:
contents: write
id-token: write
attestations: write

jobs:
release:
uses: tree-sitter/workflows/.github/workflows/release.yml@main
6 changes: 6 additions & 0 deletions .tsqueryrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/ribru17/ts_query_ls/refs/heads/master/schemas/config.json",
"parser_install_directories": [
"."
]
}
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ Bits may be missing and/or inaccurate :)
* Decide about inline use (e.g. add some \_bare\_\* constructs? stop using?)
([#41](https://github.com/sogaiu/tree-sitter-clojure/issues/41))

### v0.0.14 - 2026-02-17

* Features and Fixes
* Add GitHub Actions workflows
* Update version info in package.json and tree-sitter.json
* Generate parser.c and friends with tree-sitter v0.26.5 (ABI version 15)

### v0.0.13 - 2024-05-15

* Features and Fixes
Expand Down
27 changes: 25 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,38 @@
{
"name": "tree-sitter-clojure",
"version": "0.0.13",
"version": "0.0.14",
"description": "Clojure grammar for tree-sitter",
"repository": "https://github.com/anomalyco/tree-sitter-clojure",
"license": "CC0-1.0",
"author": "sogaiu",
"keywords": [
"incremental",
"parsing",
"tree-sitter",
"clojure",
"edn"
],
"files": [
"grammar.js",
"tree-sitter.json",
"queries/*",
"src/**",
"*.wasm"
],
"scripts": {
"prestart": "tree-sitter build --wasm",
"start": "tree-sitter playground",
"test": "tree-sitter test"
},
"tree-sitter": [
{
"scope": "source.clojure",
"file-types": [
"bb",
"clj",
"cljc",
"cljs"
"cljs",
"edn"
]
}
]
Expand Down
23 changes: 10 additions & 13 deletions queries/highlights.scm
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
;; Literals

; Literals
(num_lit) @number

[
Expand All @@ -8,22 +7,20 @@
] @string

[
(bool_lit)
(nil_lit)
(bool_lit)
(nil_lit)
] @constant.builtin

(kwd_lit) @constant

;; Comments

; Comments
(comment) @comment

;; Treat quasiquotation as operators for the purpose of highlighting.

; Treat quasiquotation as operators for the purpose of highlighting.
[
"'"
"`"
"~"
"@"
"~@"
"'"
"`"
"~"
"@"
"~@"
] @operator
7 changes: 4 additions & 3 deletions src/grammar.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://tree-sitter.github.io/tree-sitter/assets/schemas/grammar.schema.json",
"name": "clojure",
"rules": {
"source": {
Expand Down Expand Up @@ -1934,6 +1935,6 @@
"_sym_qualified",
"_sym_unqualified"
],
"supertypes": []
}

"supertypes": [],
"reserved": {}
}
1 change: 1 addition & 0 deletions src/node-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -1911,6 +1911,7 @@
{
"type": "source",
"named": true,
"root": true,
"fields": {},
"children": {
"multiple": true,
Expand Down
Loading