Subject: Re: [bug#49946] [PATCH v7 07/32] gnu: Add tree-sitter-c.

From: "(" <[email-masked]>
Date: Fri, 25 Nov 2022 06:56:32 +0000

On Fri Nov 25, 2022 at 1:21 AM GMT, Pierre Langlois wrote:
> * gnu/packages/tree-sitter.scm (tree-sitter-c): New variable.

> --- a/gnu/packages/tree-sitter.scm
> +++ b/gnu/packages/tree-sitter.scm

> @@ -156,3 +157,35 @@ (define-public tree-sitter-cli

>  This package includes the @command{tree-sitter} command-line tool.")
>      (license license:expat)))
> +
> +(define tree-sitter-delete-generated-files
> +  '(begin
> +     (delete-file "binding.gyp")
> +     (delete-file-recursively "bindings")
> +     (delete-file "src/grammar.json")
> +     (delete-file "src/node-types.json")
> +     (delete-file "src/parser.c")
> +     (delete-file-recursively "src/tree_sitter")
> +     #t))

No need to outline this; just do

  (snippet
   #~(begin
       (for-each delete-file
                 (list "binding.gyp"
                       "src/grammar.json"
                       "src/node-types.json"
                       "src/parser.c"))
       (for-each delete-file-recursively
                 (list "bindings"
                       "src/tree_sitter"))))

Shouldn't some of this deletion (namely, that of pregenerated files)
be handled by tree-sitter, though?

> +    (build-system tree-sitter-build-system)

...I think you may have forgotten to send the patches for the
tree-sitter-build-system?

    -- (