gnu: tree-sitter-starlark: Adjust to new tree-sitter-python.

* gnu/packages/tree-sitter.scm (tree-sitter-starlark): Adjust grammar to
  changes made in dependency (tree-sitter-python).

tree-sitter-starlark inherits tree-sitter-python, so a change made there broke
generation of Starlark's grammar.  This patch applies the minimal change
necessary until the issue is fixed upstream [1].

[1] https://github.com/tree-sitter-grammars/tree-sitter-starlark/issues/9

Change-Id: Ie999f1506947f17a3b26209ae12046597fc5dc44
Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
This commit is contained in:
Evgenii Klimov 2025-10-30 20:14:32 +00:00 committed by Liliana Marie Prikler
parent 9fd02d856c
commit 15293e03db
No known key found for this signature in database
GPG key ID: 442A84B8C70E2F87

View file

@ -1313,7 +1313,28 @@ which will be used as a snippet in origin."
"1qlvk67fqd49138nxl81l4gx833271mns36g3lm884sdmw3225w8"
"1.3.0"
#:repository-url "https://github.com/tree-sitter-grammars/tree-sitter-starlark"
#:inputs (list tree-sitter-python)))
#:inputs (list tree-sitter-python)
#:get-cleanup-snippet
(lambda (grammar-directories)
#~(begin
(use-modules (guix build utils))
;; FIXME: This grammar was built with tree-sitter-python@0.23.5.
;; https://github.com/tree-sitter-grammars/tree-sitter-starlark/issues/9
(substitute* "grammar.js"
(("rules: \\{" rules)
"\
reserved: {global: _ => [],},
supertypes: $ => [
$._simple_statement,
$._compound_statement,
$.expression,
$.primary_expression,
$.pattern,
$.parameter,
],
rules: {
"))
#$(tree-sitter-delete-generated-files grammar-directories)))))
(define-public tree-sitter-sway
(let ((commit "f9e53e922496dd47208a141fa7ac315625a1874f")