projects/guix·blob java-team · refs

2321 lines · 80.3 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2022 Luis Henrique Gomes Higino <[email protected]>
3;;; Copyright © 2022, 2023 Pierre Langlois <[email protected]>
4;;; Copyright © 2022 muradm <[email protected]>
5;;; Copyright © 2022, 2024 Aleksandr Vityazev <[email protected]>
6;;; Copyright © 2023 Andrew Tropin <[email protected]>
7;;; Copyright © 2023, 2024 Nicolas Graves <[email protected]>
8;;; Copyright © 2023 Zheng Junjie <[email protected]>
9;;; Copyright © 2023-2025 Raven Hallsby <[email protected]>
10;;; Copyright © 2024 Foundation Devices, Inc. <[email protected]>
11;;; Copyright © 2025 Andrew Wong <[email protected]>
12;;; Copyright © 2025 Nguyễn Gia Phong <[email protected]>
13;;; Copyright © 2025 Evgenii Klimov <[email protected]>
14;;; Copyright © 2025 Felipe Silva <[email protected]>
15;;; Copyright © 2026 Cayetano Santos <[email protected]>
16;;;
17;;; This file is part of GNU Guix.
18;;;
19;;; GNU Guix is free software; you can redistribute it and/or modify it
20;;; under the terms of the GNU General Public License as published by
21;;; the Free Software Foundation; either version 3 of the License, or (at
22;;; your option) any later version.
23;;;
24;;; GNU Guix is distributed in the hope that it will be useful, but
25;;; WITHOUT ANY WARRANTY; without even the implied warranty of
26;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27;;; GNU General Public License for more details.
28;;;
29;;; You should have received a copy of the GNU General Public License
30;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
31
32(define-module (gnu packages tree-sitter)
33 #:use-module ((guix licenses) #:prefix license:)
34 #:use-module (gnu packages)
35 #:use-module (gnu packages check)
36 #:use-module (gnu packages graphviz)
37 #:use-module (gnu packages icu4c)
38 #:use-module (gnu packages node)
39 #:use-module (gnu packages python-build)
40 #:use-module (guix build-system cargo)
41 #:use-module (guix build-system gnu)
42 #:use-module (guix build-system pyproject)
43 #:use-module (guix build-system tree-sitter)
44 #:use-module (guix download)
45 #:use-module (guix gexp)
46 #:use-module (guix git-download)
47 #:use-module (guix i18n)
48 #:use-module (guix packages)
49 #:use-module (guix utils)
50 #:use-module (ice-9 exceptions))
51
52(define-public tree-sitter
53 (package
54 (name "tree-sitter")
55 (version "0.25.3")
56 (source (origin
57 (method git-fetch)
58 (uri (git-reference
59 (url "https://github.com/tree-sitter/tree-sitter")
60 (commit (string-append "v" version))))
61 (file-name (git-file-name name version))
62 (sha256
63 (base32
64 "0cck2wa17figxww7lb508sgwy9sbyqj89vxci07hiscr5sgdx9y5"))
65 (modules '((guix build utils)))
66 (snippet #~(begin
67 ;; Remove bundled ICU parts
68 (delete-file-recursively "lib/src/unicode")))))
69 (build-system gnu-build-system)
70 (inputs (list icu4c))
71 (arguments
72 (list #:phases
73 #~(modify-phases %standard-phases
74 (delete 'configure)
75 ;; The library uses -fvisibility=hidden to compile, but this
76 ;; symbol is needed by the Rust bindings.
77 (add-after 'unpack 'patch-_ts_dup-visibility
78 (lambda _
79 (substitute* "lib/src/tree.c"
80 (("int _ts_dup")
81 (string-append
82 "int __attribute__ ((visibility (\"default\"))) "
83 "_ts_dup"))))))
84 #:tests? #f ; there are no tests for the runtime library
85 #:make-flags
86 #~(list (string-append "PREFIX=" #$output)
87 (string-append "CC=" #$(cc-for-target)))))
88 (home-page "https://tree-sitter.github.io/tree-sitter/")
89 (synopsis "Incremental parsing system for programming tools")
90 (description
91 "Tree-sitter is a parser generator tool and an incremental parsing
92library. It can build a concrete syntax tree for a source file and
93efficiently update the syntax tree as the source file is edited.
94
95Tree-sitter aims to be:
96
97@itemize
98@item General enough to parse any programming language
99@item Fast enough to parse on every keystroke in a text editor
100@item Robust enough to provide useful results even in the presence of syntax errors
101@item Dependency-free so that the runtime library (which is written in pure C)
102can be embedded in any application
103@end itemize
104
105This package includes the @code{libtree-sitter} runtime library.")
106 (license license:expat)))
107
108(define-public tree-sitter-cli
109 (package
110 (inherit tree-sitter)
111 (name "tree-sitter-cli")
112 (source
113 (origin
114 (inherit (package-source tree-sitter))
115 (snippet
116 #~(begin
117 ;; Remove the runtime library code and dynamically link to it
118 ;; instead.
119 (for-each delete-file-recursively
120 (find-files
121 "lib/src"
122 (lambda (file stat)
123 ;; These files are required for building the binding.
124 (not
125 (or (string-contains file "parser.h")
126 (string-contains file "stdlib-symbols.txt"))))))
127 (delete-file "lib/binding_rust/build.rs")
128 (with-output-to-file "lib/binding_rust/build.rs"
129 (lambda _
130 (format #t "~
131use std::{env, fs, path::{Path, PathBuf}};
132fn main() {
133 let out_dir = PathBuf::from(env::var(\"OUT_DIR\").unwrap());
134 fs::copy(\"src/wasm/stdlib-symbols.txt\",
135 out_dir.join(\"stdlib-symbols.txt\")).unwrap();
136 println!(\"cargo:rustc-link-lib=tree-sitter\");
137}~%")))))))
138 (build-system cargo-build-system)
139 (inputs
140 (cons* tree-sitter graphviz node-lts (cargo-inputs 'tree-sitter-cli)))
141 (arguments
142 (list
143 #:cargo-test-flags
144 ''("--"
145 ;; Skip tests which rely on downloading grammar fixtures. It is
146 ;; difficult to support such tests given upstream does not encode
147 ;; which version of the grammars are expected.
148 ;; Instead, we do run some tests for each grammar in the tree-sitter
149 ;; build-system, by running `tree-sitter test'. This isn't as
150 ;; complete as running all tests from tree-sitter-cli, but it's a
151 ;; good compromise compared to maintaining two different sets of
152 ;; grammars (Guix packages vs test fixtures).
153 "--skip=tests::corpus_test"
154 "--skip=tests::highlight_test"
155 "--skip=tests::node_test"
156 "--skip=tests::parser_test"
157 "--skip=tests::pathological_test"
158 "--skip=tests::query_test"
159 "--skip=tests::tags_test"
160 "--skip=tests::test_highlight_test"
161 "--skip=tests::test_tags_test"
162 "--skip=tests::tree_test"
163 "--skip=tests::async_context_test"
164 "--skip=tests::text_provider_test"
165 "--skip=tests::detect_language"
166 "--skip=tests::language_test"
167 "--skip=tests::parser_hang_test")
168 ;; We're only packaging the CLI program so we do not need to install
169 ;; sources.
170 #:install-source? #f
171 #:cargo-install-paths ''("cli")
172 #:phases
173 #~(modify-phases %standard-phases
174 (add-after 'unpack 'patch-references
175 (lambda* (#:key inputs #:allow-other-keys)
176 (substitute* "cli/generate/src/lib.rs"
177 (("(js_runtime\\.unwrap_or\\(\")node(\"\\))" _ prefix suffix)
178 (string-append
179 prefix
180 (search-input-file inputs "bin/node")
181 suffix)))
182 (substitute* "cli/src/util.rs"
183 (("Command::new\\(\"dot\"\\)")
184 (string-append
185 "Command::new(\""
186 (search-input-file inputs "bin/dot")
187 "\")"))))))))
188 (description "Tree-sitter is a parser generator tool and an incremental
189parsing library. It can build a concrete syntax tree for a source file and
190efficiently update the syntax tree as the source file is edited.
191
192Tree-sitter aims to be:
193
194@enumerate
195@item General enough to parse any programming language.
196@item Fast enough to parse on every keystroke in a text editor.
197@item Robust enough to provide useful results even in the presence of syntax
198errors.
199@item Dependency-free so that the runtime library (which is written in pure C)
200can be embedded in any application.
201@end enumerate
202
203This package includes the @command{tree-sitter} command-line tool.")
204 (license license:expat)))
205
206(define (tree-sitter-delete-generated-files grammar-directories)
207 #~(begin
208 (use-modules (guix build utils))
209 (define (delete-file-if-exists file)
210 ;; Not every package has all files that we want to delete.
211 (catch 'system-error
212 (lambda () (delete-file-recursively file))
213 (lambda args
214 (unless (= ENOENT (system-error-errno args))
215 (apply throw args)))))
216 (delete-file-if-exists "binding.gyp")
217 (delete-file-if-exists "bindings")
218 (for-each
219 (lambda (lang)
220 (with-directory-excursion lang
221 (delete-file-if-exists "src/grammar.json")
222 (delete-file-if-exists "src/node-types.json")
223 (delete-file-if-exists "src/parser.c")
224 (delete-file-if-exists "src/tree_sitter")))
225 '#$grammar-directories)))
226
227(define* (tree-sitter-grammar
228 name text hash version
229 #:key
230 (commit (string-append "v" version))
231 (repository-url
232 (format #f "https://github.com/tree-sitter/tree-sitter-~a" name))
233 (grammar-directories '("."))
234 (article "a")
235 (inputs '())
236 (get-cleanup-snippet tree-sitter-delete-generated-files)
237 (license license:expat))
238 "Returns a package for Tree-sitter grammar. NAME will be used with
239tree-sitter- prefix to generate package name and also for generating
240REPOSITORY-URL value if it's not specified explicitly, TEXT is a string which
241will be used in description and synopsis. GET-CLEANUP-SNIPPET is a function,
242it receives GRAMMAR-DIRECTORIES as an argument and should return a G-exp,
243which will be used as a snippet in origin."
244 (let* ((multiple? (> (length grammar-directories) 1))
245 (grammar-names (string-append text " grammar" (if multiple? "s" "")))
246 (synopsis (string-append "Tree-sitter " grammar-names))
247 (description
248 (string-append "This package provides "
249 (if multiple? "" article) (if multiple? "" " ")
250 grammar-names " for the Tree-sitter library."))
251 (name (string-append "tree-sitter-" name)))
252 (package
253 (name name)
254 (version version)
255 (home-page repository-url)
256 (source (origin
257 (method git-fetch)
258 (uri (git-reference
259 (url repository-url)
260 (commit commit)))
261 (file-name (git-file-name name version))
262 (sha256 (base32 hash))
263 (snippet
264 (get-cleanup-snippet grammar-directories))))
265 (build-system tree-sitter-build-system)
266 (arguments (list #:grammar-directories grammar-directories))
267 (inputs (if (promise? inputs)
268 (force inputs)
269 inputs))
270 (synopsis synopsis)
271 (description description)
272 (license license))))
273
274;;; Language grammars (sort alphabetically)
275
276(define-public tree-sitter-actionscript
277 (let ((commit "24919034fc78fdf9bedaac6616b6a60af20ab9b5")
278 (revision "0"))
279 (tree-sitter-grammar
280 "actionscript" "ActionScript"
281 "0gdkb7hi6nc6d3rza247c66nzi04m471b6fv32adxqjw76w5bg1d"
282 (git-version "0.1.0" revision commit)
283 #:repository-url "https://github.com/Rileran/tree-sitter-actionscript"
284 #:commit commit
285 #:get-cleanup-snippet
286 (lambda (grammar-directories)
287 #~(begin
288 (use-modules (guix build utils))
289 (substitute* "grammar.js"
290 (("u\\{\\[0-9a-fA-F\\]\\+\\}")
291 "u\\{[0-9a-fA-F]+\\}"))
292 #$(tree-sitter-delete-generated-files grammar-directories))))))
293
294(define-public tree-sitter-ada
295 (let ((version "0.1.0") ; In package.json, but untagged.
296 (commit "b23672d313b4c994ab96fd54f1b7ff15eac68a55")
297 (revision "0"))
298 (tree-sitter-grammar
299 "ada" "Ada"
300 "0ly6zd2hbng5gbs14yq6riqw2mbzvh0shc7lp2smzbv9ran6chjy"
301 (git-version version revision commit)
302 #:repository-url "https://github.com/briot/tree-sitter-ada"
303 #:commit commit)))
304
305(define-public tree-sitter-agda
306 ;; Use a later commit because some tests fail with the v1.3.1 tag.
307 (let ((commit "e8d47a6987effe34d5595baf321d82d3519a8527")
308 (revision "0"))
309 (tree-sitter-grammar
310 "agda" "Agda"
311 "1x06a1c7k5lyw4803h514yibmzizszg8dc6r4wj9gjnr1vw7l7p6"
312 (git-version "1.3.1" revision commit)
313 #:commit commit)))
314
315(define-public tree-sitter-arduino
316 (tree-sitter-grammar
317 "arduino" "Arduino"
318 "1h0h61xhs511l6ahv0isj9v59ndz8q3948dw9mi9lc7cp24jshdp"
319 "0.24.0"
320 #:repository-url
321 "https://github.com/tree-sitter-grammars/tree-sitter-arduino"
322 #:inputs (delay (list tree-sitter-c tree-sitter-cpp))
323 #:article "an"))
324
325(define-public tree-sitter-asm
326 (tree-sitter-grammar
327 "asm" "ASM"
328 "0i5wxrwavhxqj04g6ix76q8vsggl9sq8jazasl9k53mag3rnchi5"
329 "0.24.0"
330 #:repository-url "https://github.com/RubixDev/tree-sitter-asm"))
331
332(define-public tree-sitter-astro
333 (let ((commit "213f6e6973d9b456c6e50e86f19f66877e7ef0ee")
334 (revision "0"))
335 (tree-sitter-grammar
336 "astro" "Astro"
337 "18asz2dsgkq4zj5frxigpzac00pgs4kvbp8l3x27z7yq6vgfr5af"
338 (git-version "0.0.1" revision commit)
339 #:repository-url "https://github.com/virchau13/tree-sitter-astro"
340 #:commit commit
341 #:inputs (delay (list tree-sitter-html))
342 #:get-cleanup-snippet
343 (lambda (grammar-directories)
344 #~(begin
345 (use-modules (guix build utils))
346 (mkdir-p "test/corpus")
347 (copy-recursively "corpus" "test/corpus")
348 #$(tree-sitter-delete-generated-files grammar-directories))))))
349
350(define-public tree-sitter-awk
351 (tree-sitter-grammar
352 "awk" "AWK"
353 "1bglimp46cggq9kx92h943wnq2r6ymp7anwynjnl42wrdssc0drh"
354 "0.7.2"
355 #:repository-url "https://github.com/Beaglefoot/tree-sitter-awk"))
356
357(define-public tree-sitter-bash
358 (tree-sitter-grammar
359 "bash" "Bash"
360 "1smlcfkxxknhya1b1h72zj3ccg35szbg9mii2xwh7iq9acnlzpgc"
361 "0.23.3"))
362
363(define-public tree-sitter-beancount
364 (tree-sitter-grammar
365 "beancount" "Beancount"
366 "0r2ql0n4wkwbcdjpklxhsk91xm8q8dl9n9rdlqk585xagmxf1w4b"
367 "2.4.1"
368 #:repository-url "https://github.com/polarmutex/tree-sitter-beancount"))
369
370(define-public tree-sitter-bibtex
371 (let ((commit "ccfd77db0ed799b6c22c214fe9d2937f47bc8b34")
372 (revision "0"))
373 (tree-sitter-grammar
374 "bibtex" "Bibtex"
375 "0m7f3dkqbmy8x1bhl11m8f4p6n76wfvh99rp46zrqv39355nw1y2"
376 (git-version "0.1.0" revision commit)
377 #:repository-url "https://github.com/latex-lsp/tree-sitter-bibtex"
378 #:commit commit
379 #:license license:expat)))
380
381(define-public tree-sitter-bicep
382 (tree-sitter-grammar
383 "bicep" "Bicep"
384 "0ydz1vf6n8ky0vcgcmihr6ddfdlswnz8xa59zjiwdcra0qkf3azs"
385 "1.1.0"
386 #:repository-url
387 "https://github.com/tree-sitter-grammars/tree-sitter-bicep"))
388
389(define-public tree-sitter-bitbake
390 (tree-sitter-grammar
391 "bitbake" "BitBake"
392 "1pfma482nyc88x56v6l6rmhdy44qbwibrqri38wkkh66a1fka8ix"
393 "1.1.0"
394 #:repository-url
395 "https://github.com/tree-sitter-grammars/tree-sitter-bitbake"
396 #:get-cleanup-snippet
397 (lambda (grammar-directories)
398 #~(begin
399 (use-modules (guix build utils))
400 ;; FIXME: Invalid node type INHERIT.
401 (substitute* "queries/highlights.scm"
402 (("^.*\"INHERIT\".*") ""))
403 #$(tree-sitter-delete-generated-files grammar-directories)))))
404
405(define-public tree-sitter-blueprint
406 (let ((commit "329699d55f3e3955091e13756563c3f320a561fc")
407 (revision "0"))
408 (tree-sitter-grammar
409 "blueprint" "Blueprint"
410 "0pdjka1sdw9dwilw3vjl3k3cn7pcyv7m57cmxqibashg316dygxm"
411 (git-version "0.0.0" revision commit) ; Upstream has not tagged any releases
412 #:repository-url "https://github.com/huanie/tree-sitter-blueprint"
413 #:commit commit
414 #:license license:expat)))
415
416(define-public tree-sitter-c
417 (tree-sitter-grammar
418 "c" "C"
419 "19yc4g5fdibfqbn49ggywk9k2by78s8lrsjp1cx2lagb1dvxnv42"
420 "0.24.1"))
421
422(define-public tree-sitter-cairo
423 (tree-sitter-grammar
424 "cairo" "Cairo"
425 "08ig80mqs0p00p09rfygrdfarqnn29xsgnlbqvnfdll4jlj5ilid"
426 "1.0.0"
427 #:repository-url
428 "https://github.com/tree-sitter-grammars/tree-sitter-cairo"))
429
430(define-public tree-sitter-capnp
431 (let ((commit "7b0883c03e5edd34ef7bcf703194204299d7099f")
432 (revision "0"))
433 (tree-sitter-grammar
434 "capnp" "Cap'n Proto"
435 "0ww98b15n9hr6afbnl0ckxs4q8y0c31cnga2pnjx369iwfwdkajq"
436 (git-version "1.5.0" revision commit)
437 #:commit commit
438 #:repository-url
439 "https://github.com/tree-sitter-grammars/tree-sitter-capnp")))
440
441(define-public tree-sitter-chatito
442 (tree-sitter-grammar
443 "chatito" "Chatito"
444 "16pfm7s9zxdskmn1vg5ba6ni91zm5xncbri9pm0cd8pmld5w37wz"
445 "0.5.0"
446 #:repository-url
447 "https://github.com/tree-sitter-grammars/tree-sitter-chatito"))
448
449(define-public tree-sitter-clarity
450 (tree-sitter-grammar
451 "clarity" "Clarity"
452 "14qprf98199rnlr6hrjmzvn6d3ch9z8yxgjxva6m6gk9hcyyfy84"
453 "0.0.5"
454 #:repository-url
455 "https://github.com/xlittlerag/tree-sitter-clarity"))
456
457(define-public tree-sitter-clisp
458 (tree-sitter-grammar
459 "clisp" "Common Lisp"
460 "0xg3ay8l62h7s35abkxi4gjfvndzdvvrpgh1z980q1ib5935sxf0"
461 "0.4.1"
462 #:inputs (delay (list tree-sitter-clojure))
463 #:repository-url
464 "https://github.com/tree-sitter-grammars/tree-sitter-commonlisp"))
465
466(define-public tree-sitter-clojure
467 (tree-sitter-grammar
468 "clojure" "Clojure"
469 "1j41ba48sid6blnfzn6s9vsl829qxd86lr6yyrnl95m42x8q5cx4"
470 "0.0.13"
471 #:repository-url "https://github.com/sogaiu/tree-sitter-clojure"))
472
473(define-public tree-sitter-cmake
474 (tree-sitter-grammar
475 "cmake" "CMake"
476 "0b30ci696iabk3hm03rm4c3qi72d7xsbipc6g0ixxxj2qihdl2fy"
477 "0.7.0"
478 #:repository-url "https://github.com/uyha/tree-sitter-cmake"))
479
480(define-public tree-sitter-comment
481 (tree-sitter-grammar
482 "comment" "comment tags (like TODO, FIXME)"
483 "1x0l8phr4x07n739z0ax8faxq0l6irmpkdprrv1z088zqdr43l1v"
484 "0.3.0"
485 #:repository-url "https://github.com/stsewd/tree-sitter-comment"))
486
487(define-public tree-sitter-cpon
488 (let ((commit "594289eadfec719198e560f9d7fd243c4db678d5")
489 (revision "0"))
490 (tree-sitter-grammar
491 "cpon" "ChainPack Object Notation (CPON)"
492 "0kzs3i62vrckwadp2z2gdfzj3mjparh1di0zcawy94635brvvgrn"
493 (git-version "1.0.0" revision commit)
494 #:repository-url
495 "https://github.com/tree-sitter-grammars/tree-sitter-cpon"
496 #:commit commit
497 #:get-cleanup-snippet
498 (lambda (grammar-directories)
499 #~(begin
500 (use-modules (guix build utils))
501 ;; FIXME: Language not found.
502 (delete-file-recursively "test/highlight")
503 #$(tree-sitter-delete-generated-files grammar-directories))))))
504
505(define-public tree-sitter-cpp
506 (tree-sitter-grammar
507 "cpp" "C++"
508 "0sbvvfa718qrjmfr53p8x3q2c19i4vhw0n20106c8mrvpsxm7zml"
509 "0.23.4"
510 #:inputs (list tree-sitter-c)))
511
512(define-public tree-sitter-c-sharp
513 (tree-sitter-grammar
514 "c-sharp" "C#"
515 "0w6xdb8m38brhin0bmqsdqggdl95xqs3lbwq7azm5gg94agz9qf1"
516 "0.23.1"))
517
518(define-public tree-sitter-css
519 (tree-sitter-grammar
520 "css" "CSS"
521 "0c5j9zyjcykmraix1agbc0gdk85zs2v379q0aykr10fi9w2r9z9c"
522 "0.23.2"))
523
524(define-public tree-sitter-csv
525 (tree-sitter-grammar
526 "csv" "CSV"
527 "0a1giyifli78chnshzzw4q6y7gqlfkg6mlmvb7kzbw9ss9hlx2rb"
528 "1.2.0"
529 #:repository-url
530 "https://github.com/tree-sitter-grammars/tree-sitter-csv"
531 #:grammar-directories '("csv" "psv" "tsv")))
532
533(define-public tree-sitter-cuda
534 (tree-sitter-grammar
535 "cuda" "Cuda"
536 "116fa26bjh6a88kdshqq5hp6fq4ik95dpaiidw8rn90xxwwl0zxi"
537 "0.21.1"
538 #:repository-url
539 "https://github.com/tree-sitter-grammars/tree-sitter-cuda"
540 #:inputs (list tree-sitter-c
541 tree-sitter-cpp)))
542
543(define-public tree-sitter-cypher
544 (let ((commit "7553c0d18cd41237a64653bb91a09d70988f7300")
545 (revision "0"))
546 (tree-sitter-grammar
547 "cypher" "Cypher"
548 "14acb8rn9s1ps7gnw0vsacy6dn0qq1qvpblakcdgf598w316p4xa"
549 "M23"
550 #:repository-url "https://github.com/taekwombo/tree-sitter-cypher"
551 #:commit commit)))
552
553(define-public tree-sitter-d
554 (let ((commit "45e5f1e9d6de2c68591bc8e5ec662cf18e950b4a")
555 (revision "0"))
556 (tree-sitter-grammar
557 "d" "D"
558 "1y0kczf4yvk5qbvl5dcc8vf5xjjf2md44v0h3iv8lcmbjn093pmb"
559 (git-version "0.8.2" revision commit)
560 #:commit commit
561 #:repository-url
562 "https://github.com/gdamore/tree-sitter-d"
563 #:get-cleanup-snippet
564 (lambda (grammar-directories)
565 #~(begin
566 (use-modules (guix build utils))
567 ;; FIXME: Language not found.
568 (delete-file-recursively "test/highlight")
569 #$(tree-sitter-delete-generated-files grammar-directories))))))
570
571(define-public tree-sitter-dart
572 (let ((version "1.0.0")
573 (commit "d4d8f3e337d8be23be27ffc35a0aef972343cd54")
574 (revision "0"))
575 (tree-sitter-grammar
576 "dart" "Dart"
577 "09k4nclfvclwcz6lza4p2rkm25dpdasj800dn47hvm1b5al5iyym"
578 (git-version version revision commit)
579 #:commit commit
580 #:repository-url "https://github.com/UserNobody14/tree-sitter-dart")))
581
582(define-public tree-sitter-devicetree
583 (tree-sitter-grammar
584 "devicetree" "Devicetree"
585 "13rm15p9mrdklys0d720xy386pnvirxxjswg0wi1m87hs8i49qns"
586 "0.11.1"
587 #:repository-url "https://github.com/joelspadin/tree-sitter-devicetree"
588 #:get-cleanup-snippet
589 (lambda (grammar-directories)
590 #~(begin
591 (for-each delete-file '("parser.exp" "parser.lib"))
592 #$(tree-sitter-delete-generated-files grammar-directories)))
593 #:license license:expat))
594
595(define-public tree-sitter-dockerfile
596 (tree-sitter-grammar
597 "dockerfile" "Dockerfile"
598 "09iw9mqlpgsi6ak4mxrv16anvmbyap6vf61r2pi2lqdp9h1mp7g0"
599 "0.2.0"
600 #:repository-url "https://github.com/camdencheek/tree-sitter-dockerfile"))
601
602(define-public tree-sitter-dot
603 ;; 0.1.6 is taken from Cargo.toml. The package.json has 0.1.5.
604 (let ((version "0.1.6")
605 (commit "9ab85550c896d8b294d9b9ca1e30698736f08cea")
606 (revision "0"))
607 (tree-sitter-grammar
608 "dot" "Dot"
609 "013brrljrhgpnks1r0cdvj93l303kb68prm18gpl96pvhjfci063"
610 (git-version version revision commit)
611 #:repository-url "https://github.com/rydesun/tree-sitter-dot"
612 #:commit commit)))
613
614(define-public tree-sitter-doxygen
615 (let ((version "1.1.0")
616 (commit "1e28054cb5be80d5febac082706225e42eff14e6")
617 (revision "0"))
618 (tree-sitter-grammar
619 "doxygen" "Doxygen"
620 "11xflk40xp7x7f4h9knhy997k79psrw3ik9m0xkc2vzqi57l9by2"
621 (git-version version revision commit)
622 #:commit commit
623 #:repository-url
624 "https://github.com/tree-sitter-grammars/tree-sitter-doxygen")))
625
626(define-public tree-sitter-elisp
627 (tree-sitter-grammar
628 "elisp" "Emacs Lisp"
629 "0xymhprxa7kamc9cvlprg8s2rm61qcvbfazggny9kw45yj8rqvak"
630 "1.5.0"
631 #:commit "1.5.0"
632 #:repository-url "https://github.com/Wilfred/tree-sitter-elisp"
633 #:get-cleanup-snippet
634 (lambda (grammar-directories)
635 #~(begin
636 (use-modules (guix build utils))
637 ;; FIXME: Language not found.
638 (delete-file-recursively "test/highlight")
639 #$(tree-sitter-delete-generated-files grammar-directories)))))
640
641(define-public tree-sitter-elixir
642 (tree-sitter-grammar
643 "elixir" "Elixir"
644 "12i0z8afdzcznn5dzrssr7b7jx4h7wss4xvbh3nz12j6makc7kzl"
645 "0.3.4"
646 #:article "an"
647 #:repository-url "https://github.com/elixir-lang/tree-sitter-elixir"
648 #:get-cleanup-snippet
649 (lambda (grammar-directories)
650 #~(begin
651 ;; FIXME: Failure - row: 18, column: 4, expected highlight
652 ;; 'comment.doc', actual highlights: none.
653 (delete-file "test/highlight/module.ex")
654 #$(tree-sitter-delete-generated-files grammar-directories)))
655 #:license (list license:asl2.0 license:expat)))
656
657(define-public tree-sitter-elm
658 (let ((commit "3b373a3ccb48f31aa4b7ddc9092e2f5e24ab7aed")
659 (revision "0"))
660 (tree-sitter-grammar
661 "elm" "Elm"
662 "1cfkqi1vgxg7bkdda1vy9wqz6ap61fwjcdv9qzkcfzxaqr5z8dbw"
663 (git-version "5.7.0" revision commit)
664 #:article "an"
665 #:repository-url "https://github.com/elm-tooling/tree-sitter-elm"
666 #:commit commit
667 #:get-cleanup-snippet
668 (lambda (grammar-directories)
669 #~(begin
670 (for-each
671 delete-file
672 '("docs/js/tree-sitter-elm.wasm" "docs/js/tree-sitter.wasm"))
673 #$(tree-sitter-delete-generated-files grammar-directories))))))
674
675(define-public tree-sitter-embedded-template
676 (tree-sitter-grammar
677 "embedded-template" "embedded template (like ERB and EJS)"
678 "1vq9dywd9vcy59f6i5mk5n7vwk67g8j5x77czg7avpznskgfhqhb"
679 "0.23.2"
680 #:article "an"))
681
682(define-public tree-sitter-erlang
683 (let ((commit "364e323b32d098ad0e7b29e7adb4005c2bb5cf34")
684 (revision "0"))
685 (tree-sitter-grammar
686 "erlang" "Erlang"
687 "17dkvygqrx4v3y568jg72q6rdli5bp55l3zfqxvq6b5ibw48kilq"
688 (git-version "0.14.0" revision commit)
689 #:repository-url "https://github.com/WhatsApp/tree-sitter-erlang"
690 #:commit commit
691 #:get-cleanup-snippet
692 (lambda (grammar-directories)
693 #~(begin
694 (use-modules (guix build utils))
695 ;; FIXME: Language not found.
696 (delete-file-recursively "test/highlight")
697 #$(tree-sitter-delete-generated-files grammar-directories))))))
698
699(define-public tree-sitter-firrtl
700 (let ((version "0.8.0")
701 (commit "8503d3a0fe0f9e427863cb0055699ff2d29ae5f5")
702 (revision "0"))
703 (tree-sitter-grammar
704 "firrtl" "FIRRTL"
705 "0mmnsks3b21b1dixi85jds31ykgrmzl3hkkc1r7c8k4vdrr0qq93"
706 (git-version version revision commit)
707 #:commit commit
708 #:repository-url
709 "https://github.com/tree-sitter-grammars/tree-sitter-firrtl"
710 #:license license:asl2.0)))
711
712(define-public tree-sitter-fish
713 (tree-sitter-grammar
714 "fish" "Fish"
715 "1l8qmmligfcpf4amqghdv9c4nvs5wbhiifhl7016l7793rfzl235"
716 "3.6.0"
717 #:commit "3.6.0"
718 #:repository-url
719 "https://github.com/ram02z/tree-sitter-fish"
720 #:get-cleanup-snippet
721 (lambda (grammar-directories)
722 #~(begin
723 (use-modules (guix build utils))
724 ;; FIXME: Language not found.
725 (delete-file-recursively "test/highlight")
726 #$(tree-sitter-delete-generated-files grammar-directories)))
727 #:license license:unlicense))
728
729(define-public tree-sitter-fortran
730 (let ((version "0.5.1")
731 ;; Can't use the tag above directly; the build at that tag is
732 ;; non‑deterministic, so pin to a later commit.
733 (commit "8334abca785db3a041292e3b3b818a82a55b238f")
734 (revision "0"))
735 (tree-sitter-grammar
736 "fortran" "Fortran"
737 "0iwjz7ks0barg6na966jbkvzi8whgys8qh6arxlaygr9b6mhq39i"
738 (git-version version revision commit)
739 #:repository-url
740 "https://github.com/stadelmanma/tree-sitter-fortran"
741 #:commit commit)))
742
743(define-public tree-sitter-f-sharp
744 (let ((commit "5141851c278a99958469eb1736c7afc4ec738e47")
745 (revision "0"))
746 (tree-sitter-grammar
747 "f-sharp" "F#"
748 "1mk3adn7q6zwrdxpzkvzmvpsqg5a6ijb50qhw5pd46p3scxmp6kh"
749 (git-version "0.1.0" revision commit)
750 #:commit commit
751 #:repository-url "https://github.com/ionide/tree-sitter-fsharp"
752 #:grammar-directories '("fsharp" "fsharp_signature"))))
753
754(define-public tree-sitter-func
755 (let ((version "1.0.0")
756 (commit "c1d2cc41b39760127a8cd5d4f4923e27114c373b")
757 (revision "0"))
758 (tree-sitter-grammar
759 "func" "FunC"
760 "066g8jn2snmcxwm74wqyxxz2nz2vsjlwhdc455l389czddnncf2j"
761 (git-version version revision commit)
762 #:commit commit
763 #:repository-url
764 "https://github.com/tree-sitter-grammars/tree-sitter-func")))
765
766(define-public tree-sitter-gdscript
767 (let ((version "6.0.0")
768 ;; Can't use the tag above directly; the build at that tag is
769 ;; non‑deterministic, so pin to a later commit.
770 (commit "839cd921c8aa8b79c9afe2eb71a6a7bfa809e995")
771 (revision "0"))
772 (tree-sitter-grammar
773 "gdscript" "GDScript"
774 "00icy0dpdmhz2lfa35npvj26y0m37f0l73asxn7f2prmpm2jsm8c"
775 (git-version version revision commit)
776 #:repository-url
777 "https://github.com/PrestonKnopp/tree-sitter-gdscript"
778 #:commit commit)))
779
780(define-public tree-sitter-gitattributes
781 (let ((commit "1b7af09d45b579f9f288453b95ad555f1f431645")
782 (revision "0"))
783 (tree-sitter-grammar
784 "gitattributes" "Git .gitattributes"
785 "1mmcxw3aqx7skgihl8mman5spjz4cmc0k06jca7fjng904kdqw3q"
786 (git-version "0.1.6" revision commit)
787 #:commit commit
788 #:repository-url
789 "https://github.com/tree-sitter-grammars/tree-sitter-gitattributes")))
790
791(define-public tree-sitter-gitcommit
792 (let ((commit "a716678c0f00645fed1e6f1d0eb221481dbd6f6d")
793 (revision "0"))
794 (tree-sitter-grammar
795 "gitcommit" "Git commit"
796 "0syrmx6icp5n2iyawzwmz7nvpzi5iabrvn138vs7dlv9vyrxr1r9"
797 (git-version "0.3.3" revision commit)
798 #:commit commit
799 #:repository-url
800 "https://github.com/gbprod/tree-sitter-gitcommit"
801 #:license license:wtfpl2)))
802
803(define-public tree-sitter-gitignore
804 (let ((version "0.1.0")
805 (commit "f4685bf11ac466dd278449bcfe5fd014e94aa504")
806 (revision "0"))
807 (tree-sitter-grammar
808 "gitignore" "Git .gitignore"
809 "17rar33y4dngmx69kjiw6wgrsd6kc0c8w4xa4rx06rjmv7b1hfij"
810 (git-version version revision commit)
811 #:commit commit
812 #:repository-url
813 "https://github.com/shunsambongi/tree-sitter-gitignore")))
814
815(define-public tree-sitter-gleam
816 (tree-sitter-grammar
817 "gleam" "Gleam"
818 "0d7z5bk6x0qi3wy4d8174a69wxsc4287c7fcdfabkn8dixpa920q"
819 "1.1.0"
820 #:repository-url
821 "https://github.com/gleam-lang/tree-sitter-gleam"
822 #:license license:asl2.0))
823
824(define-public tree-sitter-glsl
825 (tree-sitter-grammar
826 "glsl" "OpenGL Shading Language (GLSL)"
827 "0d0ymklms4a91b310f0vwl80yy50sji4qq9sdgly5qh42kyjnijb"
828 "0.2.0"
829 #:inputs (list tree-sitter-c)
830 #:repository-url
831 "https://github.com/tree-sitter-grammars/tree-sitter-glsl"))
832
833(define-public tree-sitter-gn
834 (let ((version "1.0.0")
835 (commit "bc06955bc1e3c9ff8e9b2b2a55b38b94da923c05")
836 (revision "0"))
837 (tree-sitter-grammar
838 "gn" "GN"
839 "0i6f0kar3c734ag5bli519ah3rmamsk8kihbw5ga5b0ihrxqfzja"
840 (git-version version revision commit)
841 #:commit commit
842 #:repository-url
843 "https://github.com/tree-sitter-grammars/tree-sitter-gn")))
844
845(define-public tree-sitter-go
846 (tree-sitter-grammar
847 "go" "Go"
848 "0yi8if9mqzzcs4qflflz90hhaxkzlq54wia3s0iiqzfqxk24a61g"
849 "0.23.4"))
850
851(define-public tree-sitter-gomod
852 (tree-sitter-grammar
853 "gomod" "Go .mod"
854 "1vbg4fn54a7lbwcrvjdx3nrwgw5y925chbbb7sd6kwms1434yyhb"
855 "1.1.0"
856 #:repository-url "https://github.com/camdencheek/tree-sitter-go-mod"))
857
858(define-public tree-sitter-gosum
859 (let ((version "1.0.0")
860 (commit "27816eb6b7315746ae9fcf711e4e1396dc1cf237")
861 (revision "0"))
862 (tree-sitter-grammar
863 "gosum" "Go .sum"
864 "13h690k9q8kf7mldcps10h0kj0bdnlkfml9zkcawdswx8r7wblzn"
865 (git-version version revision commit)
866 #:commit commit
867 #:repository-url
868 "https://github.com/tree-sitter-grammars/tree-sitter-go-sum")))
869
870(define-public tree-sitter-gpr
871 (let ((version "0.1.0") ; In package.json, but untagged
872 (commit "cea857d3c18d1385d1f5b66cd09ea1e44173945c")
873 (revision "0"))
874 (tree-sitter-grammar
875 "gpr" "GNAT Project"
876 "0mf6ghqdyn0qbani9hg67yr6a68cbbbvhn734ndygxm30vqdz9xn"
877 (git-version version revision commit)
878 #:repository-url "https://github.com/brownts/tree-sitter-gpr"
879 #:commit commit
880 ;; binding.gyp & bindings is not part of this grammar.
881 #:get-cleanup-snippet
882 (lambda (grammar-directories)
883 #~(begin
884 (use-modules (guix build utils))
885 (for-each
886 (lambda (lang)
887 (with-directory-excursion lang
888 (delete-file "src/grammar.json")
889 (delete-file "src/node-types.json")
890 (delete-file "src/parser.c")
891 (delete-file-recursively "src/tree_sitter")))
892 '#$grammar-directories))))))
893
894(define-public tree-sitter-graphql
895 (let ((commit "5e66e961eee421786bdda8495ed1db045e06b5fe")
896 (revision "0"))
897 (tree-sitter-grammar
898 "graphql" "GraphQL"
899 "0xvrd6p9rxdjpqfq575ap6hpl2f7dad5i4d4m05w1qk9jx33vw9n"
900 (git-version "0.0.1" revision commit)
901 #:commit commit
902 #:repository-url
903 "https://github.com/bkegley/tree-sitter-graphql"
904 #:get-cleanup-snippet
905 (lambda (grammar-directories)
906 #~(begin
907 (use-modules (guix build utils))
908 (mkdir-p "test/corpus")
909 (copy-recursively "corpus" "test/corpus")
910 ;; FIXME: Impossible pattern.
911 (substitute* "queries/graphql/formatter.scm"
912 (("(\\(input_value_definition(.*@name)?\\))" all value _)
913 (string-append "(input_fields_definition " value ")")))
914 #$(tree-sitter-delete-generated-files grammar-directories))))))
915
916(define-public tree-sitter-groovy
917 (let ((version "0.0.1")
918 (commit "86911590a8e46d71301c66468e5620d9faa5b6af")
919 (revision "0"))
920 (tree-sitter-grammar
921 "groovy" "Groovy"
922 "0vbsg5xkdja6xyp8nm7g9fs4ndaq3qz6lq8vk9c7l2znw6bb17gb"
923 (git-version version revision commit)
924 #:commit commit
925 #:repository-url
926 "https://github.com/murtaza64/tree-sitter-groovy")))
927
928(define-public tree-sitter-gstlaunch
929 (let ((version "0.1.0")
930 (commit "cf696c7f5e7265a7f6bd0cd1cc8864edd917a3de")
931 (revision "0"))
932 (tree-sitter-grammar
933 "gstlaunch" "gst-launch-1.0"
934 "0kd2pmh5jq0vc9mdzf2w12hn8qrcg3jybys1q4j2dnhqcalzmppa"
935 (git-version version revision commit)
936 #:commit commit
937 #:repository-url
938 "https://github.com/tree-sitter-grammars/tree-sitter-gstlaunch")))
939
940(define-public tree-sitter-hack
941 (let ((version "0.0.4")
942 (commit "bc5b3a10d6d27e8220a113a9a7fe9bec0a1574b0")
943 (revision "0"))
944 (tree-sitter-grammar
945 "hack" "Hack"
946 "08rmlbxhb79d4zb0rb5wwkm4cqgy4a2l8zh37p2kx9gr352wjl3m"
947 (git-version version revision commit)
948 #:commit commit
949 #:repository-url "https://github.com/slackhq/tree-sitter-hack")))
950
951(define-public tree-sitter-hare
952 (let ((version "0.0.1")
953 (commit "fb6ea01461441ec7c312e64e326649f5e9011a64")
954 (revision "0"))
955 (tree-sitter-grammar
956 "hare" "Hare"
957 "0c1zswqig2x0qxg5svd5r17vrwi282x6is9irll2vadkfpfm83r9"
958 (git-version version revision commit)
959 #:commit commit
960 #:repository-url "https://git.sr.ht/~ecs/tree-sitter-hare"
961 #:license license:expat)))
962
963(define-public tree-sitter-haskell
964 (tree-sitter-grammar
965 "haskell" "Haskell"
966 "08qzkvyc830k56j5lglfzmlp03ygixf9vlrpazbndqvqk20n56xa"
967 "0.15.0"
968 #:get-cleanup-snippet
969 (lambda (grammar-directories)
970 #~(begin
971 (delete-file "test/highlight/Basic.hs") ;FIXME: Language not found.
972 #$(tree-sitter-delete-generated-files grammar-directories)))))
973
974(define-public tree-sitter-haxe
975 (let ((commit "a55f3e2cf1e4449200fd089a80d3af642bcf5f94")
976 (revision "0"))
977 (tree-sitter-grammar
978 "haxe" "Haxe"
979 "0wyrc7l3xav805xmypfp9clgxacm080is598lr3raa2sb31rwdl3"
980 (git-version "0.13.0" revision commit)
981 #:commit commit
982 #:repository-url
983 "https://github.com/vantreeseba/tree-sitter-haxe"
984 #:get-cleanup-snippet
985 (lambda (grammar-directories)
986 #~(begin
987 (use-modules (guix build utils))
988 ;; FIXME: No language found.
989 (delete-file "queries/highlights.scm")
990 (delete-file-recursively "test/highlight")
991 #$(tree-sitter-delete-generated-files grammar-directories))))))
992
993(define-public tree-sitter-hcl
994 (let ((commit "de10d494dbd6b71cdf07a678fecbf404dbfe4398")
995 (revision "0"))
996 (tree-sitter-grammar
997 "hcl" "HCL"
998 "0dpxrr7m1k4kjasgz6v8kj7ldp0k6jcxlzcrr09qv7209v24s4x1"
999 (git-version "1.1.0" revision commit)
1000 #:article "an"
1001 #:repository-url "https://github.com/tree-sitter-grammars/tree-sitter-hcl"
1002 #:commit commit
1003 #:license license:asl2.0)))
1004
1005(define-public tree-sitter-heex
1006 (tree-sitter-grammar
1007 "heex" "Heex"
1008 "0d0ljmxrvmr8k1wc0hd3qrjzwb31f1jaw6f1glamw1r948dxh9xf"
1009 "0.8.0"
1010 #:repository-url "https://github.com/phoenixframework/tree-sitter-heex"))
1011
1012(define-public tree-sitter-hlsl
1013 (tree-sitter-grammar
1014 "hlsl" "HLSL"
1015 "0d850bxzxmbxgxjdh219ag2k3qvbphly1y0hdbs2zsqdsdgf0s05"
1016 "0.2.0"
1017 #:repository-url
1018 "https://github.com/tree-sitter-grammars/tree-sitter-hlsl"
1019 #:inputs (list tree-sitter-c
1020 tree-sitter-cpp)
1021 #:article "an"))
1022
1023(define-public tree-sitter-html
1024 (tree-sitter-grammar
1025 "html" "HTML"
1026 "0slhrmwcw2xax4ylyaykx4libkzlaz2lis8x8jmn6b3hbdxlrpix"
1027 "0.23.2"))
1028
1029(define-public tree-sitter-hyprlang
1030 (tree-sitter-grammar
1031 "hyprlang" "Hyprlang"
1032 "171p3hj36a1jqflg9xv138445j4m4m16na6bgpm1km3l67jhvl54"
1033 "3.1.0"
1034 #:repository-url
1035 "https://github.com/tree-sitter-grammars/tree-sitter-hyprlang"))
1036
1037(define-public tree-sitter-ini
1038 (let ((version "1.3.0")
1039 (commit "32b31863f222bf22eb43b07d4e9be8017e36fb31")
1040 (revision "0"))
1041 (tree-sitter-grammar
1042 "ini" "INI"
1043 "0sp9075fllimy6zrw2gx5mij0igl9zvcrakh23wn7m5wh0w9lq4i"
1044 (git-version version revision commit)
1045 #:commit commit
1046 #:repository-url "https://github.com/justinmk/tree-sitter-ini"
1047 #:article "an"
1048 #:license license:asl2.0)))
1049
1050(define-public tree-sitter-janet
1051 (tree-sitter-grammar
1052 "janet" "Janet"
1053 "1sg862gqxn5y86sqa4habyicsr1ax70i7w8ibnn2yyx1bzn99jqn"
1054 "0.1.0"
1055 #:repository-url "https://github.com/GrayJack/tree-sitter-janet"
1056 #:license license:bsd-3))
1057
1058(define-public tree-sitter-java
1059 (tree-sitter-grammar
1060 "java" "Java"
1061 "11j4ifhl5hsmb2sa651cp5xds9cjgjynl86yivvk6bnr2ba0xw9s"
1062 "0.23.5"))
1063
1064(define-public tree-sitter-java-properties
1065 (tree-sitter-grammar
1066 "java-properties" "Java properties"
1067 "0y2w3szzmn4y6m0fh0zi4xqfwr9lm849abrpsi3i3dlz9rnhcs71"
1068 "0.3.0"
1069 #:repository-url
1070 "https://github.com/tree-sitter-grammars/tree-sitter-properties"))
1071
1072(define-public tree-sitter-javascript
1073 (tree-sitter-grammar
1074 "javascript" "JavaScript(JSX)"
1075 "03v1gpr5lnifrk4lns690fviid8p02wn7hfdwp3ynp7lh1cid63a"
1076 "0.23.1"))
1077
1078(define-public tree-sitter-jsdoc
1079 (tree-sitter-grammar
1080 "jsdoc" "JSDoc"
1081 "1qrgan1xpj717qmwdbgb3lqjgffyhsw0qxhjwhdhqfv2lgkw4cn6"
1082 "0.25.0"))
1083
1084(define-public tree-sitter-json
1085 (tree-sitter-grammar
1086 "json" "JSON"
1087 "0p0fiqi5imxm13s1fs6bhqw6v11n79ri1af3d072zm7jqkcl5mhc"
1088 "0.24.8"))
1089
1090(define-public tree-sitter-jsonnet
1091 (let ((version "0.0.1")
1092 (commit "ddd075f1939aed8147b7aa67f042eda3fce22790")
1093 (revision "0"))
1094 (tree-sitter-grammar
1095 "jsonnet" "JSONNET"
1096 "1bfdjxp0h95d124bzlhlvc9b5q19cdj716aym41nyl6z5a992c9q"
1097 (git-version version revision commit)
1098 #:commit commit
1099 #:repository-url
1100 "https://github.com/sourcegraph/tree-sitter-jsonnet")))
1101
1102(define-public tree-sitter-julia
1103 (tree-sitter-grammar
1104 "julia" "Julia"
1105 "0xi04a48ly438gar25bkkvvr8by4dd013cnafbjdysqjfs04q2wg"
1106 "0.23.1"))
1107
1108(define-public tree-sitter-just
1109 (tree-sitter-grammar
1110 "just" "Just"
1111 "0zkdr09myjzp75cmyndzi70kzkbkr3l2hglyb79b1an8w49vkdcn"
1112 "0.2.0"
1113 #:repository-url
1114 "https://github.com/casey/tree-sitter-just"
1115 #:get-cleanup-snippet
1116 (lambda (grammar-directories)
1117 #~(begin
1118 (use-modules (guix build utils))
1119 ;; FIXME: test/highlight/statements.just fails
1120 (with-directory-excursion "test/highlight"
1121 (delete-file "statements.just"))
1122 #$(tree-sitter-delete-generated-files grammar-directories)))))
1123
1124(define-public tree-sitter-kconfig
1125 (tree-sitter-grammar
1126 "kconfig" "Kconfig"
1127 "1gjh5pz2hwccfcljz3qlg66b6rgv3wsv1bdml1gzrphca9xxz66a"
1128 "1.3.0"
1129 #:repository-url
1130 "https://github.com/tree-sitter-grammars/tree-sitter-kconfig"))
1131
1132(define-public tree-sitter-kdl
1133 (tree-sitter-grammar
1134 "kdl" "KDL"
1135 "1015x24ffrvzb0m0wbqdzmaqavpnjw0gvcagxi9b6vj3n1ynm0ps"
1136 "1.1.0"
1137 #:repository-url "https://github.com/tree-sitter-grammars/tree-sitter-kdl"))
1138
1139(define-public tree-sitter-kotlin
1140 (tree-sitter-grammar
1141 "kotlin" "Kotlin"
1142 "0bv21rcypi9dx87kgfr89mg8qfc7ik1g1fcb8am7ss17by8badwk"
1143 "0.3.8"
1144 #:repository-url "https://github.com/fwcd/tree-sitter-kotlin"
1145 #:commit "0.3.8"))
1146
1147(define-public tree-sitter-latex
1148 (tree-sitter-grammar
1149 "latex" "LaTeX"
1150 "18dyda7299imb6i2jnjpr7z2jdrjn804c3958nkkpxzzfhbq39h7"
1151 "0.4.0"
1152 #:repository-url "https://github.com/latex-lsp/tree-sitter-latex"))
1153
1154(define-public tree-sitter-linkerscript
1155 (let ((version "1.0.0")
1156 (commit "f99011a3554213b654985a4b0a65b3b032ec4621")
1157 (revision "0"))
1158 (tree-sitter-grammar
1159 "linkerscript" "Linker script"
1160 "004irhiaj5n4sgr0fqwqxnijsbalvn3ahc2ys4s9l33rr4hhr3qf"
1161 (git-version version revision commit)
1162 #:commit commit
1163 #:repository-url
1164 "https://github.com/tree-sitter-grammars/tree-sitter-linkerscript")))
1165
1166(define-public tree-sitter-llvm
1167 (let ((commit "2914786ae6774d4c4e25a230f4afe16aa68fe1c1")
1168 (revision "0"))
1169 (tree-sitter-grammar
1170 "llvm" "LLVM"
1171 "0k02dak264y57ng0mxdg9z9hcb4b0jgyd1xm88h4f1bcq6sah54c"
1172 (git-version "1.1.0" revision commit)
1173 #:commit commit
1174 #:repository-url
1175 "https://github.com/benwilliamgraham/tree-sitter-llvm")))
1176
1177(define-public tree-sitter-lua-0.4
1178 (tree-sitter-grammar
1179 "lua" "Lua"
1180 "082hc274h96sa98n3vxicjmjvnbdhrpjaimxsh002xl69rdl80jm"
1181 "0.4.0"
1182 #:repository-url "https://github.com/tree-sitter-grammars/tree-sitter-lua"
1183 #:get-cleanup-snippet
1184 (lambda (grammar-directories)
1185 #~(begin
1186 (use-modules (guix build utils))
1187 (delete-file-recursively "test/highlight") ;FIXME
1188 #$(tree-sitter-delete-generated-files grammar-directories)))))
1189
1190(define-public tree-sitter-lua
1191 (tree-sitter-grammar
1192 "lua" "Lua"
1193 "1mhlwpj4ajqajgjw99l9xhiqnyg9hwn7zdgvdw037vk3k8vrldjp"
1194 "0.5.0"
1195 #:repository-url "https://github.com/tree-sitter-grammars/tree-sitter-lua"
1196 #:get-cleanup-snippet
1197 (lambda (grammar-directories)
1198 #~(begin
1199 (use-modules (guix build utils))
1200 (delete-file-recursively "test/highlight") ;FIXME
1201 #$(tree-sitter-delete-generated-files grammar-directories)))))
1202
1203(define-public tree-sitter-luadoc
1204 (let ((version "1.1.0")
1205 (commit "818acda56809f994274de64a42f97f509b3c0ad2")
1206 (revision "0"))
1207 (tree-sitter-grammar
1208 "luadoc" "Luadoc/LuaCATS"
1209 "1sb0zgd2gk0x18c45f5y9pz5fr8mil9adsspa9q7kbd2hwrf14gi"
1210 (git-version version revision commit)
1211 #:commit commit
1212 #:repository-url
1213 "https://github.com/tree-sitter-grammars/tree-sitter-luadoc")))
1214
1215(define-public tree-sitter-lua-patterns
1216 (let ((version "1.0.1")
1217 (commit "31461ae9bd0866cb5117cfe5de71189854fd0f3e")
1218 (revision "0"))
1219 (tree-sitter-grammar
1220 "lua-patterns" "Lua patterns"
1221 "1wfsfh44jn7m9kx0lfsbrf0hqavad142wl2pffab3mvpmrnawva9"
1222 (git-version version revision commit)
1223 #:commit commit
1224 #:repository-url
1225 "https://github.com/tree-sitter-grammars/tree-sitter-luap")))
1226
1227(define-public tree-sitter-luau
1228 (tree-sitter-grammar
1229 "luau" "Luau"
1230 "00j60425gp0pzrfds0wzr0k1wynbp0zq1saagpnglkmid41xk9p6"
1231 "1.2.0"
1232 #:repository-url
1233 "https://github.com/tree-sitter-grammars/tree-sitter-luau"
1234 #:inputs (list tree-sitter-lua-0.4)
1235 #:get-cleanup-snippet
1236 (lambda (grammar-directories)
1237 #~(begin
1238 (use-modules (guix build utils))
1239 (substitute* "grammar.js"
1240 (("@muniftanjim/") "@tree-sitter-grammars/"))
1241 #$(tree-sitter-delete-generated-files grammar-directories)))))
1242
1243(define-public tree-sitter-magik
1244 (let ((version "0.0.1")
1245 (commit "1fd4c5502fd375c157bbe0916834f697c97704bb")
1246 (revision "0"))
1247 (tree-sitter-grammar
1248 "magik" "Magik"
1249 "07zdsilaa97c4hq1pj0qiyhrkbzhawnqc7sbsvr0nsz6n5jj3gwx"
1250 (git-version version revision commit)
1251 #:commit commit
1252 #:repository-url
1253 "https://github.com/krn-robin/tree-sitter-magik")))
1254
1255(define-public tree-sitter-make
1256 (tree-sitter-grammar
1257 "make" "Makefile"
1258 "0g8k9rfmc979lza2cx5xwla1ic2p9hpvm0h2sgfs4r29kw1a2ass"
1259 "1.1.1"
1260 #:repository-url
1261 "https://github.com/tree-sitter-grammars/tree-sitter-make"))
1262
1263(define-public tree-sitter-markdown
1264 (tree-sitter-grammar
1265 "markdown" "Markdown (CommonMark Spec v0.30)"
1266 "0vz9r1dbbdj8vwf45izmbajhjbl98ww2dvlk1faqy33kx7plsiar"
1267 "0.5.3"
1268 #:repository-url "https://github.com/MDeiml/tree-sitter-markdown"
1269 #:grammar-directories '("tree-sitter-markdown"
1270 "tree-sitter-markdown-inline")
1271 #:get-cleanup-snippet
1272 (lambda (grammar-directories)
1273 #~(begin
1274 (use-modules (guix build utils))
1275 ;; FIXME
1276 (with-directory-excursion "tree-sitter-markdown-inline/test/corpus"
1277 (for-each delete-file
1278 '("extension_wikilink.txt" "spec.txt" "tags.txt")))
1279 #$(tree-sitter-delete-generated-files grammar-directories)))))
1280
1281(define-public tree-sitter-matlab
1282 (tree-sitter-grammar
1283 "matlab" "Matlab"
1284 "1kcg16aa9swk4a73klp72rib15ljz7zjlr97rr134laym4x0fnvl"
1285 "1.0.4"
1286 #:repository-url "https://github.com/acristoffers/tree-sitter-matlab"
1287 #:license license:expat))
1288
1289(define-public tree-sitter-mermaid
1290 (let ((version "0.0.2") ; In package.json, but untagged
1291 (commit "90ae195b31933ceb9d079abfa8a3ad0a36fee4cc")
1292 (revision "0"))
1293 (tree-sitter-grammar
1294 "mermaid" "Mermaid"
1295 "1wfdsz3ikdbpym14aljgy80jhr06cgwhhg72rr8d3rsbm8z5ppaf"
1296 (git-version version revision commit)
1297 #:commit commit
1298 #:repository-url "https://github.com/monaqa/tree-sitter-mermaid")))
1299
1300(define-public tree-sitter-meson
1301 (tree-sitter-grammar
1302 "meson" "Meson"
1303 "10v1d22wgkc9m33b7zfl712q7zrpn17l1xyprj4wwasqjvg29l03"
1304 "1.3.0"
1305 #:repository-url "https://github.com/Decodetalkers/tree-sitter-meson"
1306 #:license license:expat))
1307
1308(define-public tree-sitter-netlinx
1309 (tree-sitter-grammar
1310 "netlinx" "NetLinx"
1311 "09q2w9g4bb8v603b4ykxn5g8ndqjfhrgskslsmzhy095r3jysb2q"
1312 "1.0.4"
1313 #:repository-url "https://github.com/Norgate-AV/tree-sitter-netlinx"))
1314
1315(define-public tree-sitter-nim
1316 (let ((version "0.6.2")
1317 (commit "4ad352773688deb84a95eeaa9872acda5b466439")
1318 (revision "0"))
1319 (tree-sitter-grammar
1320 "nim" "Nim"
1321 "17wgv8lv6v3wgsjhwcmrqpvdj0bj69ldmr62j588vsppn2cwqabn"
1322 (git-version version revision commit)
1323 #:commit commit
1324 #:repository-url "https://github.com/alaviss/tree-sitter-nim"
1325 #:license license:mpl2.0)))
1326
1327(define-public tree-sitter-ninja
1328 (let ((version "0.1.0")
1329 (commit "0a95cfdc0745b6ae82f60d3a339b37f19b7b9267")
1330 (revision "0"))
1331 (tree-sitter-grammar
1332 "ninja" "Ninja"
1333 "1vmfx2k6bxfwcz319vskjhyszc6hz3j32bw4lgj72l7p890ykwkv"
1334 (git-version version revision commit)
1335 #:commit commit
1336 #:repository-url "https://github.com/alemuller/tree-sitter-ninja")))
1337
1338(define-public tree-sitter-nix
1339 (tree-sitter-grammar
1340 "nix" "Nix"
1341 "0rkvr64fvawblpg39rr0mrigf1rhsk30vng2vxviwb7fk50iww0i"
1342 "0.0.2"
1343 #:repository-url "https://github.com/nix-community/tree-sitter-nix"
1344 #:get-cleanup-snippet
1345 (lambda (grammar-directories)
1346 #~(begin
1347 (use-modules (guix build utils))
1348 ;; FIXME: Language not found.
1349 (delete-file-recursively "test/highlight")
1350 #$(tree-sitter-delete-generated-files grammar-directories)))))
1351
1352(define-public tree-sitter-nqc
1353 (let ((commit "14e6da1627aaef21d2b2aa0c37d04269766dcc1d")
1354 (revision "0"))
1355 (tree-sitter-grammar
1356 "nqc" "NQC"
1357 "0gpai34vlcdbkyj4a7j2wm36g14p84aj0vldh1146b0n8zbvizhr"
1358 (git-version "1.0.0" revision commit)
1359 #:repository-url
1360 "https://github.com/tree-sitter-grammars/tree-sitter-nqc"
1361 #:commit commit
1362 #:inputs (list tree-sitter-c)
1363 #:get-cleanup-snippet
1364 (lambda (grammar-directories)
1365 #~(begin
1366 (use-modules (guix build utils))
1367 ;; Adjust to the change in tree-sitter-c
1368 (substitute* "grammar.js"
1369 (("\\$\\._statement") "$.statement")
1370 (("\\$\\._expression") "$.expression"))
1371 (delete-file "queries/highlights.scm") ;FIXME
1372 #$(tree-sitter-delete-generated-files grammar-directories))))))
1373
1374(define-public tree-sitter-objc
1375 (tree-sitter-grammar
1376 "objc" "Objective-C"
1377 "1fryxjjxjq7lz93vvcm3lswshb4drywf64knbvjxrr3lq5zh5bv8"
1378 "3.0.2"
1379 #:repository-url
1380 "https://github.com/tree-sitter-grammars/tree-sitter-objc"
1381 #:inputs (list tree-sitter-c)
1382 #:article "an"))
1383
1384(define-public tree-sitter-ocaml
1385 (tree-sitter-grammar
1386 "ocaml" "OCaml (.ml and .mli)"
1387 "17g2ynqhjf1nyhdidz9j9s0s12iys3b2vbywxkygwyccj7rb8zdi"
1388 "0.24.0"
1389 #:grammar-directories '("grammars/interface" "grammars/ocaml" "grammars/type")))
1390
1391(define-public tree-sitter-odin
1392 (tree-sitter-grammar
1393 "odin" "Odin"
1394 "05ljga1gqhx8hr7ldpcbrz79ixni5qyz6ckyyh7chxnkl5fkjp5y"
1395 "1.3.0"
1396 #:repository-url "https://github.com/tree-sitter-grammars/tree-sitter-odin"
1397 #:article "an"))
1398
1399(define-public tree-sitter-org
1400 ;; There are a lot of additions, the last tag was placed a while ago
1401 (let ((commit "64cfbc213f5a83da17632c95382a5a0a2f3357c1")
1402 (revision "1"))
1403 (tree-sitter-grammar
1404 "org" "Org"
1405 "1l62p4a3b22pa7b5mzmy497pk5b8w01hx6zinfwpbnzg2rjdwkgz"
1406 (git-version "1.3.1" revision commit)
1407 #:repository-url "https://github.com/milisims/tree-sitter-org"
1408 #:commit commit)))
1409
1410(define-public tree-sitter-pascal
1411 (tree-sitter-grammar
1412 "pascal" "Pascal"
1413 "0wxg6k1vvp32c5grvrw1xihb1zr0idfmc4p07rmv99f7f472djhj"
1414 "0.10.0"
1415 #:repository-url "https://github.com/Isopod/tree-sitter-pascal"))
1416
1417(define-public tree-sitter-pem
1418 (let ((version "0.1.1")
1419 (commit "e525b177a229b1154fd81bc0691f943028d9e685")
1420 (revision "0"))
1421 (tree-sitter-grammar
1422 "pem" "PEM"
1423 "02g17ki5da7iams576qxyc01r1c95y5ycd7yhap9fhyxc8a6my6r"
1424 (git-version version revision commit)
1425 #:commit commit
1426 #:repository-url
1427 "https://github.com/tree-sitter-grammars/tree-sitter-pem")))
1428
1429(define-public tree-sitter-perl
1430 (let ((commit "ad74e6db234c35d537de9358799a8e0cc4f5dee0")
1431 (revision "0"))
1432 (tree-sitter-grammar
1433 "perl" "Perl"
1434 "0k6p3hij98vqa6b6iyswlyij69cggbnzgwi2zh64mj3faisblgzj"
1435 (git-version "1.0.0" revision commit)
1436 #:commit commit
1437 #:repository-url
1438 "https://github.com/tree-sitter-perl/tree-sitter-perl"
1439 #:get-cleanup-snippet
1440 (lambda (grammar-directories)
1441 #~(begin
1442 (use-modules (guix build utils))
1443 ;; FIXME
1444 (delete-file "test/highlight/literals.pm")
1445 #$(tree-sitter-delete-generated-files grammar-directories))))))
1446
1447(define-public tree-sitter-pgn
1448 (tree-sitter-grammar
1449 "pgn" "Chess Portable Game Notation (PGN)"
1450 "0mazy9y80pd20a3a76b0nfxswh7xxdsnya0y0lzl86sh4w95f52p"
1451 "1.2.12"
1452 #:repository-url "https://github.com/rolandwalker/tree-sitter-pgn"
1453 #:license license:bsd-2))
1454
1455(define-public tree-sitter-php
1456 (tree-sitter-grammar
1457 "php" "PHP"
1458 "05qhz14vvqgwpxgdfr1skwgrv041zwc3wxjyx6y679965nn0lrji"
1459 "0.23.12"
1460 #:grammar-directories '("php" "php_only")))
1461
1462(define-public tree-sitter-phpdoc
1463 (tree-sitter-grammar
1464 "phpdoc" "PHPDoc"
1465 "1m5fsbl4zv44rjxv21jzcv64mz9gs702m9s6qjkb0c0rill2bqaz"
1466 "0.1.8"
1467 #:repository-url "https://github.com/claytonrcarter/tree-sitter-phpdoc"
1468 #:inputs (list tree-sitter-php)))
1469
1470(define-public tree-sitter-plantuml
1471 ;; No tags
1472 (let ((commit "c7361a1d481dc1ff6700b14ea1d5efc549b72713")
1473 (revision "1"))
1474 (tree-sitter-grammar
1475 "plantuml" "PlantUML"
1476 "0apmv0dad58ixhxhzxkwlm9wgbphj7lxilbh427rpxy1y5hrml0f"
1477 (git-version "1.0.0" revision commit)
1478 #:repository-url "https://github.com/Decodetalkers/tree_sitter_plantuml"
1479 #:commit commit
1480 #:get-cleanup-snippet
1481 (lambda (grammar-directories)
1482 #~(begin
1483 (use-modules (guix build utils))
1484 (substitute* "grammar.js"
1485 (("u\\{\\[0-9a-fA-F\\]\\+\\}")
1486 "u\\{[0-9a-fA-F]+\\}"))
1487 #$(tree-sitter-delete-generated-files grammar-directories))))))
1488
1489(define-public tree-sitter-po
1490 (let ((version "0.0.1")
1491 (commit "bd860a0f57f697162bf28e576674be9c1500db5e")
1492 (revision "0"))
1493 (tree-sitter-grammar
1494 "po" "GNU gettext translation file (PO/POT)"
1495 "1d28lyg0sx9xs09y68618cxnhi5sacfschcrv4xmy06k21bp8azx"
1496 (git-version version revision commit)
1497 #:commit commit
1498 #:repository-url
1499 "https://github.com/tree-sitter-grammars/tree-sitter-po")))
1500
1501(define-public tree-sitter-pony
1502 (let ((commit "73ff874ae4c9e9b45462673cbc0a1e350e2522a7")
1503 (revision "0"))
1504 (tree-sitter-grammar
1505 "pony" "Pony"
1506 "0fm47by0z6vzihnk4py7lx1qbiwqbbgpxpi8ibl740bnx9nx7mpz"
1507 (git-version "1.0.0" revision commit)
1508 #:commit commit
1509 #:repository-url
1510 "https://github.com/tree-sitter-grammars/tree-sitter-pony")))
1511
1512(define-public tree-sitter-powershell
1513 (tree-sitter-grammar
1514 "powershell" "Powershell"
1515 "1wz34js891sx6j2s128sdcbxj1k2zi300fg5a4vf5acaz82jcs8q"
1516 "0.25.8"
1517 #:repository-url
1518 "https://github.com/airbus-cert/tree-sitter-powershell"))
1519
1520(define-public tree-sitter-printf
1521 (tree-sitter-grammar
1522 "printf" "printf"
1523 "15p5fr1dhmf54aic9mszrb7859q2adcq66mnivzpfvzvh4xnpmr5"
1524 "0.5.1"
1525 #:repository-url
1526 "https://github.com/tree-sitter-grammars/tree-sitter-printf"
1527 #:license license:isc))
1528
1529(define-public tree-sitter-prisma
1530 (tree-sitter-grammar
1531 "prisma" "Prisma"
1532 "144l2w7ky5imd7yvp1n6lgbyy5kq6kx4c2ja43yk15k3258pf52v"
1533 "1.5.1"
1534 #:repository-url "https://github.com/victorhqc/tree-sitter-prisma"
1535 #:license license:expat))
1536
1537(define-public tree-sitter-proto
1538 (let ((version "0.1.0")
1539 (commit "e9f6b43f6844bd2189b50a422d4e2094313f6aa3")
1540 (revision "0"))
1541 (tree-sitter-grammar
1542 "proto" "Protocol Buffers"
1543 "1r8g28rp852f1qj4bhnkf4fzfir1r5blq2p0nz4x9y5jfplb1vji"
1544 (git-version version revision commit)
1545 #:commit commit
1546 #:repository-url "https://github.com/treywood/tree-sitter-proto")))
1547
1548(define-public tree-sitter-puppet
1549 (tree-sitter-grammar
1550 "puppet" "Puppet"
1551 "19032dhb60vxij6b6xvgnigwhhbm4y89dr11vxsr1kk10zj61vkc"
1552 "1.3.0"
1553 #:repository-url
1554 "https://github.com/tree-sitter-grammars/tree-sitter-puppet"))
1555
1556(define-public tree-sitter-purescript
1557 (tree-sitter-grammar
1558 "purescript" "PureScript"
1559 "11c57k50kppc560a6qr3wpxppl9p4w7a7yn9g51ybzd28vc55qxl"
1560 "0.3.0"
1561 #:repository-url
1562 "https://github.com/postsolar/tree-sitter-purescript"))
1563
1564(define-public tree-sitter-python
1565 (tree-sitter-grammar
1566 "python" "Python"
1567 "05kk1wlm5fgpgwqxw3m68sipkinw0gf2jq19cgq9cgp3agdwg58p"
1568 "0.25.0"))
1569
1570(define-public tree-sitter-python-manifest
1571 (tree-sitter-grammar
1572 "python-manifest" "PyPA manifest"
1573 "16k9izgwg2f8yyz1vlzyw9qw4np5fjy3nxr3ksq499a0bz8a59cd"
1574 "0.6.0"
1575 #:repository-url
1576 "https://github.com/tree-sitter-grammars/tree-sitter-pymanifest"))
1577
1578(define-public tree-sitter-python-requirements
1579 (tree-sitter-grammar
1580 "python-requirements" "Python requirements.txt"
1581 "1gwp1cwsyr67qclfm9f8ilakaq747qzqmj3bgy0jacjjjs0xgk32"
1582 "0.5.0"
1583 #:repository-url
1584 "https://github.com/tree-sitter-grammars/tree-sitter-requirements"))
1585
1586(define-public tree-sitter-qml
1587 (let ((version "0.2.0") ; Tagged, but we use a more recent commit
1588 (commit "0889da4632bba3ec6f39ef4102625654890c15c1")
1589 (revision "0"))
1590 (tree-sitter-grammar
1591 "qml" "Qml"
1592 "1qdfwbqjnw7vcvq2dcx19c159b12kv2hvwrvbp7m9i5vl6szc22g"
1593 (git-version version revision commit)
1594 #:repository-url "https://github.com/yuja/tree-sitter-qmljs"
1595 #:commit commit
1596 #:inputs (delay (list tree-sitter-javascript tree-sitter-typescript))
1597 #:license license:expat)))
1598
1599(define-public tree-sitter-qmldir
1600 (let ((version "0.2.2")
1601 (commit "fbf29ddf1ebb01e0c389dde2a51e874f688a2327")
1602 (revision "0"))
1603 (tree-sitter-grammar
1604 "qmldir" "Qmldir"
1605 "07wmr7vsqqv77m69inrhdk3qmlwivwkdpppcjwc326b2r8a88y7j"
1606 (git-version version revision commit)
1607 #:commit commit
1608 #:repository-url
1609 "https://github.com/tree-sitter-grammars/tree-sitter-qmldir")))
1610
1611(define-public tree-sitter-qmljs
1612 (tree-sitter-grammar
1613 "qmljs" "QML"
1614 "1a1fxm73ag51qsi0wfg36jzcm6am9n1mwvhjv3f57fyjwcwigqp0"
1615 "0.2.0"
1616 #:commit "0.2.0"
1617 #:repository-url "https://github.com/yuja/tree-sitter-qmljs"
1618 #:inputs (delay (list tree-sitter-javascript
1619 tree-sitter-typescript))))
1620
1621(define-public tree-sitter-query
1622 (package
1623 (inherit (tree-sitter-grammar "query"
1624 "Query"
1625 "1m7w05228ky26ph4k9vfwjwkhghppnpvci2i45iwncjanrni6byk"
1626 "0.8.0"
1627 #:repository-url
1628 "https://github.com/tree-sitter-grammars/tree-sitter-query"))
1629 (synopsis "Tree-sitter grammar for Tree-sitter's query language")
1630 (description "This package provides Tree-sitter's query grammar.")))
1631
1632(define-public tree-sitter-r
1633 (tree-sitter-grammar
1634 "r" "R"
1635 "1jf14nvrfcznsnmxmlkbnn59bdykpsawxm5grph65p8vghi4fik7"
1636 "1.1.0"
1637 #:repository-url "https://github.com/r-lib/tree-sitter-r"
1638 #:get-cleanup-snippet
1639 (lambda (grammar-directories)
1640 #~(begin
1641 (use-modules (guix build utils))
1642 ;; FIXME: Language not found.
1643 (for-each delete-file-recursively '("test/highlight" "test/tags"))
1644 #$(tree-sitter-delete-generated-files grammar-directories)))))
1645
1646(define-public tree-sitter-racket
1647 (tree-sitter-grammar
1648 "racket" "Racket"
1649 "1x9x6pn7l578xlm1cmg5w0cy2zk34qywsn0jzf1j8phwf7k66bxg"
1650 "0.23.0-1"
1651 #:repository-url "https://github.com/6cdh/tree-sitter-racket"))
1652
1653(define-public tree-sitter-readline
1654 (let ((version "1.1.1")
1655 (commit "74addc90fc539d31d413c0c7cf7581997a7fa46e")
1656 (revision "0"))
1657 (tree-sitter-grammar
1658 "readline" "GNU Readline init"
1659 "0qmnmzab9qn6chsdh2sfa9v2yrpik3ng9j14shw70ck0zc02gd3i"
1660 (git-version version revision commit)
1661 #:commit commit
1662 #:repository-url
1663 "https://github.com/tree-sitter-grammars/tree-sitter-readline")))
1664
1665(define-public tree-sitter-re2c
1666 (let ((commit "c18a3c2f4b6665e35b7e50d6048ea3cff770c572")
1667 (revision "0"))
1668 (tree-sitter-grammar
1669 "re2c" "Regular Expressions to Code (re2c)"
1670 "0h6vvbns5xdi47pfgl2xf4hlwzawrsqbm16jv07d0z7lppimf6ys"
1671 (git-version "0.1.0" revision commit)
1672 #:commit commit
1673 #:repository-url
1674 "https://github.com/tree-sitter-grammars/tree-sitter-re2c"
1675 #:get-cleanup-snippet
1676 (lambda (grammar-directories)
1677 #~(begin
1678 (use-modules (guix build utils))
1679 ;; FIXME: Invalid node type labelprefix.
1680 (substitute* "grammar.js"
1681 (("( *)\\$\\.set_condenumprefix,\n" all tabs)
1682 (string-append all tabs "$.set_labelprefix,\n")))
1683 #$(tree-sitter-delete-generated-files grammar-directories))))))
1684
1685(define-public tree-sitter-rego
1686 (let ((version "1.0.0")
1687 (commit "20b5a5958c837bc9f74b231022a68a594a313f6d")
1688 (revision "0"))
1689 (tree-sitter-grammar
1690 "rego" "Rego"
1691 "0cmja3gd5nbmi251qc14hh1cbfd7i0mydx74qxs30qvix6q5a2az"
1692 (git-version version revision commit)
1693 #:commit commit
1694 #:repository-url
1695 "https://github.com/FallenAngel97/tree-sitter-rego")))
1696
1697(define-public tree-sitter-ron
1698 (let ((commit "78938553b93075e638035f624973083451b29055")
1699 (revision "0"))
1700 (tree-sitter-grammar
1701 "ron" "RON"
1702 "13f8a5sfvyrizkl0szh2yaslmvjk91s97yb2abrdh74a0pl217aa"
1703 (git-version "0.2.0" revision commit)
1704 #:repository-url "https://github.com/tree-sitter-grammars/tree-sitter-ron"
1705 #:commit commit
1706 #:license (list license:asl2.0 license:expat))))
1707
1708(define-public tree-sitter-rst
1709 (tree-sitter-grammar
1710 "rst" "ReStructuredText"
1711 "1lrdyhgda2f66biq7dk4s0llk4fcxn23rf5zrhi17nnl8zmjg18i"
1712 "0.2.0"
1713 #:repository-url "https://github.com/stsewd/tree-sitter-rst"))
1714
1715(define-public tree-sitter-ruby
1716 (tree-sitter-grammar
1717 "ruby" "Ruby"
1718 "0c1vs63ydcb3q2wnif18l5irbj6chkcvd3p6dg0vyhklk5acrvca"
1719 "0.23.1"))
1720
1721(define-public tree-sitter-rust
1722 (tree-sitter-grammar
1723 "rust" "Rust"
1724 "0x7xqxspdfnbgn9nvrsl2rsnrjbs01i5hy8k8p5wwk2j358hjyyb"
1725 "0.24.0"))
1726
1727(define-public tree-sitter-scala
1728 (tree-sitter-grammar
1729 "scala" "Scala"
1730 "02awiraj5mmgyi31yzxyxarkkl41qksm3lm41pq9c6bmyqpir2y6"
1731 "0.23.4"))
1732
1733(define-public tree-sitter-scheme
1734 (tree-sitter-grammar
1735 "scheme" "Scheme (R5RS, R6RS, R7RS)"
1736 "108ln1j2fcsrphy6jp9bq3qravp42w4hqb4cvpzx6a3dslkpv116"
1737 "0.24.7-1"
1738 #:repository-url "https://github.com/6cdh/tree-sitter-scheme"))
1739
1740(define-public tree-sitter-scss
1741 (let ((commit "bca847c1410f7dd97e13fbe7838b3c2c203fb473")
1742 (revision "0"))
1743 (tree-sitter-grammar
1744 "scss" "SCSS"
1745 "0v5vrgwp2fln1pypff5pr329mghm5naahpn3sr7mkrja2n8gyy6a"
1746 (git-version "1.0.0" revision commit)
1747 #:commit commit
1748 #:repository-url
1749 "https://github.com/tree-sitter-grammars/tree-sitter-scss"
1750 #:inputs (list tree-sitter-css)
1751 #:get-cleanup-snippet
1752 (lambda (grammar-directories)
1753 #~(begin
1754 (use-modules (guix build utils))
1755 ;; FIXME: 10/56 fail
1756 (with-directory-excursion "test/corpus"
1757 (for-each
1758 delete-file
1759 '("declarations.txt" "examples.txt" "statements.txt")))
1760 #$(tree-sitter-delete-generated-files grammar-directories))))))
1761
1762(define-public tree-sitter-sfapex
1763 ;; Use a later commit because some tests fail with the v2.3 tag.
1764 (let ((commit "3597575a429766dd7ecce9f5bb97f6fec4419d5d")
1765 (revision "0"))
1766 (tree-sitter-grammar
1767 "sfapex" "Sfapex"
1768 "1kcv8g7smh76nb46np5yqmjma1c4zna74nkhc11xa1g3gwysvv2c"
1769 (git-version "2.3" revision commit)
1770 #:commit commit
1771 #:repository-url "https://github.com/aheber/tree-sitter-sfapex"
1772 #:grammar-directories '("apex" "sflog" "soql" "sosl"))))
1773
1774(define-public tree-sitter-smali
1775 (let ((commit "fdfa6a1febc43c7467aa7e937b87b607956f2346")
1776 (revision "0"))
1777 (tree-sitter-grammar
1778 "smali" "Smali"
1779 "0b7b6vziwj2c3ngrpz439gnsxh5v22illc4nms1mxkzdx5g3liab"
1780 (git-version "1.0.0" revision commit)
1781 #:commit commit
1782 #:repository-url
1783 "https://github.com/tree-sitter-grammars/tree-sitter-smali")))
1784
1785(define-public tree-sitter-smithy
1786 (let ((commit "ec4fe14586f2b0a1bc65d6db17f8d8acd8a90433")
1787 (revision "0"))
1788 (tree-sitter-grammar
1789 "smithy" "Smithy"
1790 "12gs5baabvm6v7js0g0siy98v1w69cmfxc72sikylr6y4wfvhjf0"
1791 (git-version "0.2.0" revision commit)
1792 #:commit commit
1793 #:repository-url
1794 "https://github.com/indoorvivants/tree-sitter-smithy")))
1795
1796(define-public tree-sitter-solidity
1797 (tree-sitter-grammar
1798 "solidity" "Solidity"
1799 "0vbxghnihnmfdgg4a5j2g5s7fcff8axqmqa2y8yci434n35wgq3g"
1800 "1.2.13"
1801 #:repository-url
1802 "https://github.com/JoranHonig/tree-sitter-solidity"))
1803
1804(define-public tree-sitter-sparql
1805 (let* ((commit "1ef52d35a73a2a5f2e433ecfd1c751c1360a923b")
1806 (revision "0"))
1807 (tree-sitter-grammar
1808 "sparql" "SPARQL"
1809 "19s63n9kbijmbaprffvkxqmdr8a1jc3f371mzrxh2wv4czbradpl"
1810 (git-version "0.1.0" revision commit)
1811 #:commit commit
1812 #:repository-url
1813 "https://github.com/GordianDziwis/tree-sitter-sparql")))
1814
1815(define-public tree-sitter-sql
1816 (let ((commit "7b51ecda191d36b92f5a90a8d1bc3faef1c7b8b8")
1817 (revision "0"))
1818 (tree-sitter-grammar
1819 "sql" "SQL"
1820 "1lvm4x24ac9r4fy4ghpypyz1q771bafwkjvn0ma5zh82900q7xvr"
1821 (git-version "0.3.11" revision commit)
1822 #:commit commit
1823 #:repository-url "https://github.com/DerekStride/tree-sitter-sql")))
1824
1825(define-public tree-sitter-squirrel
1826 (let ((commit "072c969749e66f000dba35a33c387650e203e96e")
1827 (revision "0"))
1828 (tree-sitter-grammar
1829 "squirrel" "Squirrel"
1830 "01gwmjgbyq7byxs0hsy4kkinijdszq2vh13kqmrjz1pq632nd45l"
1831 (git-version "1.0.0" revision commit)
1832 #:commit commit
1833 #:repository-url
1834 "https://github.com/tree-sitter-grammars/tree-sitter-squirrel")))
1835
1836(define-public tree-sitter-starlark
1837 (tree-sitter-grammar
1838 "starlark" "Starlark"
1839 "1qlvk67fqd49138nxl81l4gx833271mns36g3lm884sdmw3225w8"
1840 "1.3.0"
1841 #:repository-url "https://github.com/tree-sitter-grammars/tree-sitter-starlark"
1842 #:inputs (list tree-sitter-python)
1843 #:get-cleanup-snippet
1844 (lambda (grammar-directories)
1845 #~(begin
1846 (use-modules (guix build utils))
1847 ;; FIXME: This grammar was built with [email protected].
1848 ;; https://github.com/tree-sitter-grammars/tree-sitter-starlark/issues/9
1849 (substitute* "grammar.js"
1850 (("rules: \\{" rules)
1851 "\
1852 reserved: {global: _ => [],},
1853 supertypes: $ => [
1854 $._simple_statement,
1855 $._compound_statement,
1856 $.expression,
1857 $.primary_expression,
1858 $.pattern,
1859 $.parameter,
1860 ],
1861 rules: {
1862"))
1863 #$(tree-sitter-delete-generated-files grammar-directories)))))
1864
1865(define-public tree-sitter-svelte
1866 (let ((commit "ae5199db47757f785e43a14b332118a5474de1a2")
1867 (revision "0"))
1868 (tree-sitter-grammar
1869 "svelte" "Svelte"
1870 "0pm5hillspaj4xvqz3j5sxvn78sljw75abjp58xnq8lc5vp62zvh"
1871 (git-version "1.0.2" revision commit)
1872 #:commit commit
1873 #:repository-url
1874 "https://github.com/tree-sitter-grammars/tree-sitter-svelte"
1875 #:inputs (list tree-sitter-html))))
1876
1877(define-public tree-sitter-sway
1878 (let ((commit "f9e53e922496dd47208a141fa7ac315625a1874f")
1879 (revision "0"))
1880 (tree-sitter-grammar
1881 "sway" "Sway"
1882 "1bgr3153wwzgkrnk5w9mv7kskw3ygdxaihrpiljcw0bhciqsnkk8"
1883 (git-version "1.0.0" revision commit)
1884 #:repository-url "https://github.com/FuelLabs/tree-sitter-sway"
1885 #:commit commit)))
1886
1887(define-public tree-sitter-swift
1888 (let ((commit "7c2f26b5dce12e82ef2bd932a883ef514ae566b8")
1889 (revision "0"))
1890 (tree-sitter-grammar
1891 "swift" "Swift"
1892 "15rcld2k5h7m4c66msxx7zcmn9bmpqsz907pdr3ikhvcvx3w085g"
1893 (git-version "0.7.1" revision commit)
1894 #:commit commit
1895 #:repository-url
1896 "https://github.com/alex-pinkus/tree-sitter-swift"
1897 #:get-cleanup-snippet
1898 (lambda (grammar-directories)
1899 #~(begin
1900 (use-modules (guix build utils))
1901 (delete-file-recursively "test-npm-package")
1902 (delete-file-recursively "test/outline")
1903 #$(tree-sitter-delete-generated-files grammar-directories))))))
1904
1905(define-public tree-sitter-systemverilog
1906 (tree-sitter-grammar
1907 "systemverilog" "SystemVerilog"
1908 "1qmdhd0ln6zhrwj1zpc96ws0x2gdb9fkfk7fwp1zjvkz6fkjc3la"
1909 "0.4.0"
1910 #:repository-url "https://github.com/gmlarumbe/tree-sitter-systemverilog"))
1911
1912(define-public tree-sitter-tablegen
1913 (let ((version "1.0.0")
1914 (commit "3e9c4822ab5cdcccf4f8aa9dcd42117f736d51d9")
1915 (revision "0"))
1916 (tree-sitter-grammar
1917 "tablegen" "LLVM TableGen"
1918 "02anzjxk30323jmbvn2l7fwarq59zix84g7rdcgx8s7z7c5zyagk"
1919 (git-version version revision commit)
1920 #:commit commit
1921 #:repository-url
1922 "https://github.com/Flakebi/tree-sitter-tablegen")))
1923
1924(define-public tree-sitter-tcl
1925 (let ((version "1.1.0")
1926 (commit "8f11ac7206a54ed11210491cee1e0657e2962c47")
1927 (revision "0"))
1928 (tree-sitter-grammar
1929 "tcl" "TCL"
1930 "0dkxh6bn0kqn1gbyd5qwkg21fm634mxvas3w4ahv6zr5d8f95c96"
1931 (git-version version revision commit)
1932 #:commit commit
1933 #:repository-url
1934 "https://github.com/tree-sitter-grammars/tree-sitter-tcl")))
1935
1936(define-public tree-sitter-test
1937 (package
1938 ;; Similar to the tree-sitter-query.
1939 (inherit (tree-sitter-grammar
1940 "test" "corpus test"
1941 "0n61mhi2244x3xv1zvwypcih9x65qqgrlz0sz4766h5v68mc58zg"
1942 "0.3.0"
1943 #:repository-url
1944 "https://github.com/tree-sitter-grammars/tree-sitter-test"))
1945 (synopsis "Tree-sitter grammar for Tree-sitter's corpus test files")
1946 (description "This package provides Tree-sitter's grammar for corpus test
1947files.")))
1948
1949(define-public tree-sitter-thrift
1950 (let ((commit "68fd0d80943a828d9e6f49c58a74be1e9ca142cf")
1951 (revision "0"))
1952 (tree-sitter-grammar
1953 "thrift" "Thrift"
1954 "1ijp9x1vylc8bgplnj9d898qhv04cvrl67qg9kmam33drfrmn1m3"
1955 (git-version "0.5.0" revision commit)
1956 #:commit commit
1957 #:repository-url
1958 "https://github.com/tree-sitter-grammars/tree-sitter-thrift")))
1959
1960(define-public tree-sitter-tlaplus
1961 (tree-sitter-grammar
1962 "tlaplus" "TLA+"
1963 "11073rjg9n9hnr88193mmb8ff5xlcv6isgqc0g2fbfbl0y820zlk"
1964 "1.5.0"
1965 #:repository-url "https://github.com/tlaplus-community/tree-sitter-tlaplus"
1966 #:commit "1.5.0"))
1967
1968(define-public tree-sitter-toml
1969 (tree-sitter-grammar
1970 "toml" "TOML"
1971 "1j9fgy1hlsq6xqqnpjl65a2mmydlx91p8ss36k7vyf7284d6bm4v"
1972 "0.7.0"
1973 #:repository-url "https://github.com/tree-sitter-grammars/tree-sitter-toml"))
1974
1975(define-public tree-sitter-twig
1976 (let ((version "0.7.0")
1977 (commit "40d17f0eb990215e12531abe29ee7691d7ca99a5")
1978 (revision "0"))
1979 (tree-sitter-grammar
1980 "twig" "Twig"
1981 "06a6rfgh9mmzqvs7bp8y92axa4fni4c72s82bdin7j3a0x5mxwi6"
1982 (git-version version revision commit)
1983 #:commit commit
1984 #:repository-url "https://github.com/kaermorchen/tree-sitter-twig"
1985 #:license license:mpl2.0)))
1986
1987(define-public tree-sitter-typescript
1988 (tree-sitter-grammar
1989 "typescript" "TypeScript and TSX"
1990 "0rlhhqp9dv6y0iljb4bf90d89f07zkfnsrxjb6rvw985ibwpjkh9"
1991 "0.23.2"
1992 #:inputs (list tree-sitter-javascript)
1993 #:grammar-directories '("typescript" "tsx")))
1994
1995(define-public tree-sitter-typst
1996 (tree-sitter-grammar
1997 "typst" "Typst"
1998 "198rn8wdcqq51nz6hj1zxk7mplplr2z8vc36z6h1zpjjq925794z"
1999 "0.11.0"
2000 #:repository-url "https://github.com/uben0/tree-sitter-typst"
2001 #:get-cleanup-snippet
2002 (lambda (grammar-directories)
2003 #~(begin
2004 ;; These tests are supposed to fail, but they don't fail the way the
2005 ;; suite expects anymore.
2006 (delete-file "test/corpus/negative.scm")
2007 #$(tree-sitter-delete-generated-files grammar-directories)))))
2008
2009(define-public tree-sitter-udev
2010 (let ((version "0.2.1")
2011 (commit "2fcb563a4d56a6b8e8c129252325fc6335e4acbf")
2012 (revision "0"))
2013 (tree-sitter-grammar
2014 "udev" "udev rules"
2015 "0azs4q43bdg0an4f5s8ac7jqxikwi1rnqhl4g0l58ghf2g51i70i"
2016 (git-version version revision commit)
2017 #:commit commit
2018 #:repository-url
2019 "https://github.com/tree-sitter-grammars/tree-sitter-udev")))
2020
2021(define-public tree-sitter-ungrammar
2022 ;; No releases yet.
2023 (let ((commit "debd26fed283d80456ebafa33a06957b0c52e451")
2024 (revision "0"))
2025 (tree-sitter-grammar
2026 "ungrammar" "Ungrammar"
2027 "09bbml1v1m6a9s9y9q1p2264ghf3fhb6kca1vj3qm19yq87xrnvy"
2028 (git-version "0.0.2" revision commit)
2029 #:commit commit
2030 #:repository-url "https://github.com/tree-sitter-grammars/tree-sitter-ungrammar"
2031 #:article "an")))
2032
2033(define-public tree-sitter-uxntal
2034 (let ((version "1.0.0")
2035 (commit "bd6cc0cf5c97bb25ee65b39132768d1a1f70ffa9")
2036 (revision "0"))
2037 (tree-sitter-grammar
2038 "uxntal" "Uxntal"
2039 "0sbwwr6d6yiq0ddhjkcafi0k61rcp6l1fa6vpmkykr3kh7znq9pn"
2040 (git-version version revision commit)
2041 #:commit commit
2042 #:repository-url
2043 "https://github.com/tree-sitter-grammars/tree-sitter-uxntal")))
2044
2045(define-public tree-sitter-v
2046 (let ((commit "532bebd50742ef15949bdd67c36d46697c847628")
2047 (revision "0"))
2048 (tree-sitter-grammar
2049 "v" "V"
2050 "1chkirgmbfrjy9p81qm5gi5qdqf9az98zfv9zgmd0q91gvkdf6ll"
2051 (git-version "0.0.6" revision commit)
2052 #:commit commit
2053 #:repository-url "https://github.com/vlang/v-analyzer"
2054 #:grammar-directories '("tree_sitter_v")
2055 #:get-cleanup-snippet
2056 (lambda (grammar-directories)
2057 #~(begin
2058 (use-modules (guix build utils))
2059 (delete-file-recursively "src")
2060 (delete-file-recursively "editors")
2061 (rename-file "tree_sitter_v/package.json" "package.json")
2062 #$(tree-sitter-delete-generated-files grammar-directories))))))
2063
2064(define-public tree-sitter-verilog
2065 (tree-sitter-grammar
2066 "verilog" "Verilog"
2067 "1mk8waij5lbj1wbayvqs0cxk003dssdic13h14gd5fi1ckfvflja"
2068 "1.0.3"))
2069
2070(define-public tree-sitter-vhdl
2071 (tree-sitter-grammar
2072 "vhdl" "VHDL"
2073 "11q2sxac26mn00a7k4vy1wgd6bhh0v0p8arj9r8zb9phn3sqwwjm"
2074 "2.0.0"
2075 #:repository-url "https://github.com/jpt13653903/tree-sitter-vhdl"))
2076
2077;;; TODO: Remove this package when emacs-vhdl-ts-mode switches to jpt13653903.
2078;;; We keep old one as alemuller is still required by emacs-vhdl-ts-mode.
2079;;; See:
2080;;; https://github.com/gmlarumbe/vhdl-ts-mode/issues/17
2081(define-public tree-sitter-vhdl-0
2082 (let ((version "0.1.1") ; In package.json, but untagged
2083 (commit "a3b2d84990527c7f8f4ae219c332c00c33d2d8e5")
2084 (revision "0"))
2085 (tree-sitter-grammar
2086 "vhdl" "VHDL"
2087 "0gz2b0qg1jzi2q6wgj6k6g35kmni3pqglq4f5kblkxx909463n8a"
2088 (git-version version revision commit)
2089 #:repository-url "https://github.com/alemuller/tree-sitter-vhdl"
2090 #:commit commit
2091 #:get-cleanup-snippet
2092 (lambda (grammar-directories)
2093 #~(begin
2094 (use-modules (guix build utils))
2095 ;; FIXME: Language not found.
2096 (delete-file-recursively "test/highlight")
2097 ;; Fix a query error in the highlight.scm query test. This would be
2098 ;; easier with a patch, but this works too, and we still get to use
2099 ;; tree-sitter-grammar. The fix is taken from here:
2100 ;; https://github.com/n8tlarsen/tree-sitter-vhdl/commit/dabf157c6bb7220d72d3ceba0ce1abd90bf62187
2101 ;; This is a documented issue that has not been resolved for nearly 2
2102 ;; years.
2103 ;; https://github.com/alemuller/tree-sitter-vhdl/issues/2
2104 (substitute* "queries/highlights.scm"
2105 (("\\(integer_decimal\n") "(integer_decimal)\n")
2106 (("\\(integer\\)") "")
2107 (("\"0\")") "\"0\""))
2108 #$(tree-sitter-delete-generated-files grammar-directories))))))
2109
2110(define-public tree-sitter-vim
2111 (tree-sitter-grammar "vim"
2112 "Vimscript"
2113 "1myz19yimx179gzd6w64zyshfb4hbxp7qfrdf6nvf9a2w8bc2wij"
2114 "0.8.1"
2115 #:repository-url "https://github.com/tree-sitter-grammars/tree-sitter-vim"))
2116
2117(define-public tree-sitter-vimdoc
2118 (tree-sitter-grammar "vimdoc"
2119 "Vimdoc"
2120 "18f1dr3j79axg6yqrvm0fc2w4cil403al9xifc4h4vkkp6hg6y9b"
2121 "4.1.0"
2122 #:repository-url
2123 "https://github.com/neovim/tree-sitter-vimdoc"
2124 #:license license:expat))
2125
2126(define-public tree-sitter-vue
2127 (let ((commit "22bdfa6c9fc0f5ffa44c6e938ec46869ac8a99ff")
2128 (revision "0"))
2129 (tree-sitter-grammar
2130 "vue" "Vue.js"
2131 "1mi18x54g8rxz98jrpzh2gi7ii93sq743aws9i7qc139jas98y9f"
2132 (git-version "0.1.0" revision commit)
2133 #:commit commit
2134 #:repository-url
2135 "https://github.com/tree-sitter-grammars/tree-sitter-vue"
2136 #:inputs (list tree-sitter-html))))
2137
2138(define-public tree-sitter-wast
2139 (let ((commit "2ca28a9f9d709847bf7a3de0942a84e912f59088")
2140 (revision "0"))
2141 (tree-sitter-grammar
2142 "wast" "WebAssembly"
2143 "02v08hs9wirdzfx9a7c3kpn0cpc9i867pw28qka0fid9q537hnbb"
2144 (git-version "0.0.0" revision commit)
2145 #:commit commit
2146 #:repository-url "https://github.com/wasm-lsp/tree-sitter-wasm"
2147 #:grammar-directories '("wast" "wat")
2148 #:get-cleanup-snippet
2149 (lambda (grammar-directories)
2150 #~(begin
2151 (use-modules (guix build utils))
2152 ;; FIXME
2153 (substitute* '("wat/grammar.js" "wast/grammar.js")
2154 (("u\\{\\[0-9a-fA-F\\]\\+\\}")
2155 "u\\{[0-9a-fA-F]+\\}"))
2156 (for-each (lambda (lang)
2157 (with-directory-excursion lang
2158 ;; incompatible type of tests
2159 (delete-file-recursively "corpus")
2160 (delete-file "index.js")
2161 (delete-file "src/binding.cc")))
2162 '("wat" "wast"))
2163 (for-each delete-file '("wat/tree-sitter-wat.wasm"
2164 "wast/tree-sitter-wast.wasm"))
2165 #$(tree-sitter-delete-generated-files grammar-directories)))
2166 ;; Apache-2.0 with LLVM-exception
2167 #:license license:asl2.0)))
2168
2169(define-public tree-sitter-wgsl
2170 (let ((commit "809fe422b879021afb65a1899093fa87bc6e02df")
2171 (revision "0"))
2172 (tree-sitter-grammar
2173 "wgsl" "WebGPU Shading Language (WGSL)"
2174 "05a7yas33y4jfj1ac1n49xll0kmpsic4y5hffqavhm2zffpwmqbc"
2175 (git-version "0.0.9" revision commit)
2176 #:commit commit
2177 #:repository-url "https://github.com/gpuweb/tree-sitter-wgsl"
2178 #:get-cleanup-snippet
2179 (lambda (grammar-directories)
2180 #~(begin
2181 (use-modules (guix build utils))
2182 ;; FIXME: Invalid node type const_assert_statement.
2183 (delete-file "queries/highlights.scm")
2184 #$(tree-sitter-delete-generated-files grammar-directories)))
2185 #:license license:w3c)))
2186
2187(define-public tree-sitter-xcompose
2188 (tree-sitter-grammar
2189 "xcompose" "XCompose"
2190 "03c0ycwrxafxvbhzi6pzcq8md40frh7ybwkhcsd4s1hmg6arwpyx"
2191 "0.4.0"
2192 #:repository-url
2193 "https://github.com/tree-sitter-grammars/tree-sitter-xcompose"
2194 #:article "an"))
2195
2196(define-public tree-sitter-xml
2197 (tree-sitter-grammar
2198 "xml" "XML and DTD"
2199 "0ghfjjhw1rvd98xd1c3mq3bffrl3wg5dmp22ksb0659g76qi0hpz"
2200 "0.7.0"
2201 #:repository-url
2202 "https://github.com/tree-sitter-grammars/tree-sitter-xml"
2203 #:grammar-directories '("xml" "dtd")
2204 #:article "an"))
2205
2206(define-public tree-sitter-yaml
2207 (tree-sitter-grammar
2208 "yaml" "YAML"
2209 "0z5fz9hiafzapi0ijhyz8np6rksq6c1pb16xv1vhnlfh75rg6zyv"
2210 "0.7.0"
2211 #:repository-url "https://github.com/tree-sitter-grammars/tree-sitter-yaml"))
2212
2213(define-public tree-sitter-yuck
2214 (let ((commit "e877f6ade4b77d5ef8787075141053631ba12318")
2215 (revision "0"))
2216 (tree-sitter-grammar
2217 "yuck" "Yuck"
2218 "00l009xmjpr2fgrbibhgkymk1kw2al2m8zi93civyjxwpbzkbiwp"
2219 (git-version "0.0.2" revision commit)
2220 #:commit commit
2221 #:repository-url
2222 "https://github.com/tree-sitter-grammars/tree-sitter-yuck")))
2223
2224(define-public tree-sitter-zig
2225 (tree-sitter-grammar
2226 "zig" "Zig"
2227 "1r9p7hhnc1zagwxzdxhs4p6rnqs9naddkgbfymi6pbw6cyg2ccwl"
2228 "1.1.2"
2229 #:repository-url "https://github.com/tree-sitter-grammars/tree-sitter-zig"))
2230
2231;;; Python Bindings
2232
2233(define-public python-tree-sitter
2234 (package
2235 (name "python-tree-sitter")
2236 (version "0.25.2")
2237 (source
2238 (origin
2239 (method git-fetch)
2240 (uri (git-reference
2241 (url "https://github.com/tree-sitter/py-tree-sitter")
2242 (commit (string-append "v" version))))
2243 (file-name (git-file-name name version))
2244 (sha256
2245 (base32 "15j6gxc6ps6zdrmqfmmz22p7p5gz37cyihzzwbjggy7mc4vwm5fj"))))
2246 (build-system pyproject-build-system)
2247 (arguments
2248 (list
2249 #:test-backend #~'unittest
2250 #:phases
2251 #~(modify-phases %standard-phases
2252 (add-after 'unpack 'set-tree-sitter-lib-path
2253 (lambda _
2254 (let ((tree-sitter #$(this-package-input "tree-sitter")))
2255 (substitute* "setup.py"
2256 ((".*\"tree_sitter/core.*") "")
2257 (("( *)sources=" all tabs)
2258 (string-append
2259 tabs "library_dirs=[\"" tree-sitter "/lib\"],\n"
2260 tabs "libraries=[\"tree-sitter\"],\n"
2261 all))
2262 (("include_dirs=\\[" all)
2263 (string-append all "\"" tree-sitter "/include\","))))))
2264 ;; XXX: See https://codeberg.org/guix/guix/issues/2108
2265 (add-before 'check 'remove-uninstalled-package
2266 (lambda _
2267 (delete-file-recursively "tree_sitter"))))))
2268 (inputs (list tree-sitter))
2269 (native-inputs
2270 (list python-setuptools
2271 (python-tree-sitter-grammar tree-sitter-html #:tests? #f)
2272 (python-tree-sitter-grammar tree-sitter-javascript #:tests? #f)
2273 (python-tree-sitter-grammar tree-sitter-json #:tests? #f)
2274 (python-tree-sitter-grammar tree-sitter-python #:tests? #f)
2275 (python-tree-sitter-grammar tree-sitter-rust #:tests? #f)))
2276 (home-page "https://github.com/tree-sitter/py-tree-sitter")
2277 (synopsis "Python bindings to the Tree-sitter parsing library")
2278 (description "This package provides Python bindings to the
2279Tree-sitter parsing library.")
2280 (license license:expat)))
2281
2282(define* (python-tree-sitter-grammar pkg #:key (tests? #t))
2283 "Returns a package for Python bindings of a Tree-sitter grammar. PKG is a
2284package for a Tree-sitter grammar; its name will be used with python- prefix
2285to generate the package name. When TESTS? is true, tests are enabled."
2286 (package
2287 (inherit pkg)
2288 (name (string-append "python-" (package-name pkg)))
2289 (source (origin (inherit (package-source pkg))
2290 (snippet #f) (patches '())))
2291 (build-system pyproject-build-system)
2292 (arguments (list #:tests? tests?))
2293 (build-system pyproject-build-system)
2294 (native-inputs (append (if tests?
2295 (list python-pytest
2296 python-tree-sitter)
2297 '())
2298 (list python-setuptools)))
2299 (description
2300 (string-append (package-description pkg)
2301 (P_ "\n\nThis variant provides Python bindings.")))))
2302
2303(define-public python-tree-sitter-html
2304 (python-tree-sitter-grammar
2305 tree-sitter-html))
2306
2307(define-public python-tree-sitter-javascript
2308 (python-tree-sitter-grammar
2309 tree-sitter-javascript))
2310
2311(define-public python-tree-sitter-json
2312 (python-tree-sitter-grammar
2313 tree-sitter-json))
2314
2315(define-public python-tree-sitter-python
2316 (python-tree-sitter-grammar
2317 tree-sitter-python))
2318
2319(define-public python-tree-sitter-rust
2320 (python-tree-sitter-grammar
2321 tree-sitter-rust))