[PATCH 0/3] Add tree-sitter-verilog/-vhdl/-erlang

  • Done
  • quality assurance status badge
Details
3 participants
  • Karl Hallsby
  • Liliana Marie Prikler
  • Zheng Junjie
Owner
unassigned
Submitted by
Karl Hallsby
Severity
normal
K
K
Karl Hallsby wrote on 2 May 17:36 +0200
(address . guix-patches@gnu.org)(name . Karl Hallsby)(address . karl@hallsby.com)
cover.1714663253.git.karl@hallsby.com
Verilog & VHDL have Emacs major modes for them. I have tested that both
verilog-ts-mode and vhdl-ts-mode produce syntax highlighting.

Erlang does not have a tree-sitter-powered major-mode for Emacs yet.

Karl Hallsby (3):
gnu: Add tree-sitter-verilog.
gnu: Add tree-sitter-vhdl.
gnu: Add tree-sitter-erlang.

gnu/packages/tree-sitter.scm | 58 ++++++++++++++++++++++++++++++++++++
1 file changed, 58 insertions(+)


base-commit: 5010a51fc91aeac5a3b87a3eea04f18f3fe8a3a3
--
2.41.0
K
K
Karl Hallsby wrote on 2 May 17:39 +0200
[PATCH 2/3] gnu: Add tree-sitter-vhdl.
(address . 70720@debbugs.gnu.org)(name . Karl Hallsby)(address . karl@hallsby.com)
1cc45cfd22fb89cc16ef6d9bdb26f5b0d53afbf7.1714663253.git.karl@hallsby.com
* gnu/packages/tree-sitter.scm (tree-sitter-vhdl): New variable.

This is the tree-sitter-vhdl implementation the tree-sitter website points to,
but it seems that tree-sitter-vhdl seems to be abandoned (though it may be
complete). The cleanup snippet does more work than it should probably do, but
it is the only way for


Change-Id: Ia26e33f9898573e70c9afdd4025e3770d042dbd6
---
gnu/packages/tree-sitter.scm | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)

Toggle diff (39 lines)
diff --git a/gnu/packages/tree-sitter.scm b/gnu/packages/tree-sitter.scm
index 105581bfc4..42f311223e 100644
--- a/gnu/packages/tree-sitter.scm
+++ b/gnu/packages/tree-sitter.scm
@@ -716,3 +716,34 @@ (define-public tree-sitter-verilog
(use-modules (guix build utils))
(delete-file "binding.gyp")
(delete-file-recursively "bindings"))))))
+
+(define-public tree-sitter-vhdl
+ (let ((commit "a3b2d84990527c7f8f4ae219c332c00c33d2d8e5")
+ (revision "0"))
+ (tree-sitter-grammar
+ "vhdl" "VHDL"
+ "0gz2b0qg1jzi2q6wgj6k6g35kmni3pqglq4f5kblkxx909463n8a"
+ (git-version "0.0.0" revision commit)
+ #:repository-url "https://github.com/alemuller/tree-sitter-vhdl"
+ #:commit commit
+ #:get-cleanup-snippet
+ (lambda _
+ #~(begin
+ (use-modules (guix build utils))
+ (delete-file "binding.gyp")
+ ;; tree-sitter-vhdl does not have bindings/ directory.
+ (delete-file "src/grammar.json")
+ (delete-file "src/node-types.json")
+ (delete-file "src/parser.c")
+ (delete-file-recursively "src/tree_sitter")
+ ;; Fix a query error in the highlight.scm query test. This would be
+ ;; easier with a patch, but this works too, and we still get to use
+ ;; tree-sitter-grammar. The fix is taken from here:
+ ;; https://github.com/n8tlarsen/tree-sitter-vhdl/commit/dabf157c6bb7220d72d3ceba0ce1abd90bf62187
+ ;; This is a documented issue that has not been resolved for nearly 2
+ ;; years.
+ ;; https://github.com/alemuller/tree-sitter-vhdl/issues/2
+ (substitute* "queries/highlights.scm"
+ (("\\(integer_decimal\n") "(integer_decimal)\n")
+ (("\\(integer\\)") "")
+ (("\"0\")") "\"0\"")))))))
--
2.41.0
K
K
Karl Hallsby wrote on 2 May 17:39 +0200
[PATCH 1/3] gnu: Add tree-sitter-verilog.
(address . 70720@debbugs.gnu.org)(name . Karl Hallsby)(address . karl@hallsby.com)
6b59b090953857ab8cc9cbb48c9b89f43da5d047.1714663253.git.karl@hallsby.com
* gnu/packages/tree-sitter.scm (tree-sitter-verilog): New variable.

Change-Id: I2066aff3cf39cebda956125cdac71236502a7ac5
---
gnu/packages/tree-sitter.scm | 15 +++++++++++++++
1 file changed, 15 insertions(+)

Toggle diff (25 lines)
diff --git a/gnu/packages/tree-sitter.scm b/gnu/packages/tree-sitter.scm
index ee0acb82de..105581bfc4 100644
--- a/gnu/packages/tree-sitter.scm
+++ b/gnu/packages/tree-sitter.scm
@@ -701,3 +701,18 @@ (define-public tree-sitter-tlaplus
"1.0.8"
;; Version 1.2.1 is most recent, but requires tree-sitter >0.21.0
#:repository-url "https://github.com/tlaplus-community/tree-sitter-tlaplus"))
+
+(define-public tree-sitter-verilog
+ (let ((commit "902031343056bc0b11f3e47b33f036a9cf59f58d")
+ (revision "0"))
+ (tree-sitter-grammar
+ "verilog" "Verilog"
+ "1mrgdi0aj2bm4f2jdz93r1c3m1hiymjfhd2pc14xlz6waxpd48zg"
+ (git-version "0.0" revision commit)
+ #:commit commit
+ #:get-cleanup-snippet
+ (lambda _
+ #~(begin
+ (use-modules (guix build utils))
+ (delete-file "binding.gyp")
+ (delete-file-recursively "bindings"))))))
--
2.41.0
K
K
Karl Hallsby wrote on 2 May 17:39 +0200
[PATCH 3/3] gnu: Add tree-sitter-erlang.
(address . 70720@debbugs.gnu.org)(name . Karl Hallsby)(address . karl@hallsby.com)
0bb4610d60628a4cd7d4537fb3073be2c2222982.1714663253.git.karl@hallsby.com
* gnu/packages/tree-sitter.scm (tree-sitter-erlang): New variable.

Change-Id: Ib1449549249816736bf30a1d419a23fd7a45570e
---
gnu/packages/tree-sitter.scm | 12 ++++++++++++
1 file changed, 12 insertions(+)

Toggle diff (25 lines)
diff --git a/gnu/packages/tree-sitter.scm b/gnu/packages/tree-sitter.scm
index 42f311223e..dfe79496f9 100644
--- a/gnu/packages/tree-sitter.scm
+++ b/gnu/packages/tree-sitter.scm
@@ -426,6 +426,18 @@ (define-public tree-sitter-dockerfile
"0.1.2"
#:repository-url "https://github.com/camdencheek/tree-sitter-dockerfile"))
+(define-public tree-sitter-erlang
+ ;; This is an untagged release, for 0.4.0
+ ;; Newer versions use tree-sitter 0.22.1
+ (let ((commit "57e69513efd831f9cc8207d65d96bad917ca4aa4")
+ (revision "0"))
+ (tree-sitter-grammar
+ "erlang" "Erlang"
+ "1h0c9qc6i0kz5a0yq68xp623f84g4mc8hcp00khdbf7y7z7b9izc"
+ (git-version "0.0.0" revision commit)
+ #:repository-url "https://github.com/WhatsApp/tree-sitter-erlang"
+ #:commit commit)))
+
(define-public tree-sitter-elm
(tree-sitter-grammar
"elm" "Elm"
--
2.41.0
Z
Z
Zheng Junjie wrote on 10 May 14:14 +0200
Re: [bug#70720] [PATCH 2/3] gnu: Add tree-sitter-vhdl.
(name . Karl Hallsby via Guix-patches via)(address . guix-patches@gnu.org)
87seypc19b.fsf@iscas.ac.cn
Karl Hallsby via Guix-patches via <guix-patches@gnu.org> writes:

Toggle quote (30 lines)
> * gnu/packages/tree-sitter.scm (tree-sitter-vhdl): New variable.
>
> This is the tree-sitter-vhdl implementation the tree-sitter website points to,
> but it seems that tree-sitter-vhdl seems to be abandoned (though it may be
> complete). The cleanup snippet does more work than it should probably do, but
> it is the only way for
>
>
> Change-Id: Ia26e33f9898573e70c9afdd4025e3770d042dbd6
> ---
> gnu/packages/tree-sitter.scm | 31 +++++++++++++++++++++++++++++++
> 1 file changed, 31 insertions(+)
>
> diff --git a/gnu/packages/tree-sitter.scm b/gnu/packages/tree-sitter.scm
> index 105581bfc4..42f311223e 100644
> --- a/gnu/packages/tree-sitter.scm
> +++ b/gnu/packages/tree-sitter.scm
> @@ -716,3 +716,34 @@ (define-public tree-sitter-verilog
> (use-modules (guix build utils))
> (delete-file "binding.gyp")
> (delete-file-recursively "bindings"))))))
> +
> +(define-public tree-sitter-vhdl
> + (let ((commit "a3b2d84990527c7f8f4ae219c332c00c33d2d8e5")
> + (revision "0"))
> + (tree-sitter-grammar
> + "vhdl" "VHDL"
> + "0gz2b0qg1jzi2q6wgj6k6g35kmni3pqglq4f5kblkxx909463n8a"
> + (git-version "0.0.0" revision commit)

Toggle quote (23 lines)
> + #:commit commit
> + #:get-cleanup-snippet
> + (lambda _
> + #~(begin
> + (use-modules (guix build utils))
> + (delete-file "binding.gyp")
> + ;; tree-sitter-vhdl does not have bindings/ directory.
> + (delete-file "src/grammar.json")
> + (delete-file "src/node-types.json")
> + (delete-file "src/parser.c")
> + (delete-file-recursively "src/tree_sitter")
> + ;; Fix a query error in the highlight.scm query test. This would be
> + ;; easier with a patch, but this works too, and we still get to use
> + ;; tree-sitter-grammar. The fix is taken from here:
> + ;; https://github.com/n8tlarsen/tree-sitter-vhdl/commit/dabf157c6bb7220d72d3ceba0ce1abd90bf62187
> + ;; This is a documented issue that has not been resolved for nearly 2
> + ;; years.
> + ;; https://github.com/alemuller/tree-sitter-vhdl/issues/2
> + (substitute* "queries/highlights.scm"
> + (("\\(integer_decimal\n") "(integer_decimal)\n")
> + (("\\(integer\\)") "")
> + (("\"0\")") "\"0\"")))))))
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEfr6klGDOXiwIdX/bO1qpk+Gi3/AFAmY+D6AACgkQO1qpk+Gi
3/C1rQ/9GszXZhYqW1axisEJ577t5SAECsWN7x5VBjQws5WBlpsTfBDKcXNGPQ9F
VlCZ0siZSvJhac0r7Xf0Bop3z1Spvrx6A9tXPykmWtVURsxiSdLkZVNnk7D85ETx
ZNeIZ/oyhxCcf2XfxmbnEbGPllsGUZW3iZHJg9w9bV3UHa6FrChwm8OfjlA7xXC0
glq7gW6WO6MpzoPzTwTYTPECscDPf7TJ1Vr1QX4/At2VlH8VtlJkaEgSB0Bh9fw1
CtmvSL8+PtDa8TCkzwnX1R+5vI4iRi/qwoI9i+SJMs69JJgIpLTQdk2vGjXj2UDn
S1BY4nlBBHQtwUm/I84ATmg4rjd5PpY4BJkthrUJ1tutCYItoXhd2uHGFIJZxeOf
2uqQEZRaX9K9xQ3/3pBgsy6vdsAHgfIqAgqM+bXTAYueKnCYI8PZ9jYvAhz3wcMM
7Tps3dKMKLUbE0J+GesCoI1iIMDMzm7LcwBlEiZ7jg4Yk4djD7P4KcsXiGzHQzbZ
D7s84owcN5lmrh+ZAhuxn8xamPh9qjKGe/g3rqHp2wzCEYJ5vaZykTVdQ3g8jYN5
XT7Xo8bG6sj1455pJ+ex3wj/jgEwid6YCJlHdjM0fMt4od03ugfNLqSGCLmwNUiY
52Sqt/UrFEr53SbLWE0zH3gvNptdRPDym/Y5A5NNNzEAzCD6etY=
=z0FI
-----END PGP SIGNATURE-----

Z
Z
Zheng Junjie wrote on 10 May 14:16 +0200
Re: [bug#70720] [PATCH 1/3] gnu: Add tree-sitter-verilog.
(name . Karl Hallsby via Guix-patches via)(address . guix-patches@gnu.org)
87o79dc153.fsf@iscas.ac.cn
Karl Hallsby via Guix-patches via <guix-patches@gnu.org> writes:

Toggle quote (24 lines)
> * gnu/packages/tree-sitter.scm (tree-sitter-verilog): New variable.
>
> Change-Id: I2066aff3cf39cebda956125cdac71236502a7ac5
> ---
> gnu/packages/tree-sitter.scm | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/gnu/packages/tree-sitter.scm b/gnu/packages/tree-sitter.scm
> index ee0acb82de..105581bfc4 100644
> --- a/gnu/packages/tree-sitter.scm
> +++ b/gnu/packages/tree-sitter.scm
> @@ -701,3 +701,18 @@ (define-public tree-sitter-tlaplus
> "1.0.8"
> ;; Version 1.2.1 is most recent, but requires tree-sitter >0.21.0
> #:repository-url "https://github.com/tlaplus-community/tree-sitter-tlaplus"))
> +
> +(define-public tree-sitter-verilog
> + (let ((commit "902031343056bc0b11f3e47b33f036a9cf59f58d")
> + (revision "0"))
> + (tree-sitter-grammar
> + "verilog" "Verilog"
> + "1mrgdi0aj2bm4f2jdz93r1c3m1hiymjfhd2pc14xlz6waxpd48zg"
> + (git-version "0.0" revision commit)

Toggle quote (7 lines)
> + #:commit commit
> + #:get-cleanup-snippet
> + (lambda _
> + #~(begin
> + (use-modules (guix build utils))
> + (delete-file "binding.gyp")
> + (delete-file-recursively "bindings"))))))
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEfr6klGDOXiwIdX/bO1qpk+Gi3/AFAmY+EDgACgkQO1qpk+Gi
3/C+rA/6ArjVQHVq2R46dqgsxulZCcbqBvk4+O0IDEUm5uah/w0sL2BfNtcc5wp6
cOsUyVsX3V406ty1/ipS1VtBPCSzVsAvWfI+xqCV4wejfEOCdNMY20mhIyuAW7qJ
ztISjekkPiVqIheK2CTmP8ZNbzPdryhSX6nj2yfFvaV8QA6UBBQllzMbiAJY7L4c
mg4DW4mp231Wj+5VJRq1pw+wOOFuHIHyg9chkF3zqgBFg73i3u/wmKGmfOnWk+N9
VSDBwZYt4ud6QQERsQpKbq/2ExSTOK4n+wNXENts1ZM3KgHffDbFaJxrbk3KfpJ8
ZyHxSfKdH8EwwDwBE6wBjcqTnuo6MBNLPhbf06eZosvmuHw/qB8Pnq5+jMnkSyU0
bw4TshJsGAQq+F7JOLxd9k3eOiOze7hiuPVMlvdtGMxF3I3nKJ4B0STpe6IshQv4
N2XapH5IT3OTnH2W2V0p8cck4V6j1gVUa17s4AZ0Mkce8A4R8CXeHMMWl7Y1wfzH
lwuBNfeYeYFffBzpNF7RHdqJG+rGg3LrAd8/ICjJC+tHSq3Q3pnM3F3lLaggLOEx
BBWfr5iSLUciKprboRSmYytxZrihUHy7ZMrfy9x+/imk3kDhMNN4aFPvqM5af8K5
DJ9zV8RU4rbgZvWn5fKe91Eud+U50rfqyJxN1ttMAQ4Uh8qPq5k=
=xPPb
-----END PGP SIGNATURE-----

Z
Z
Zheng Junjie wrote on 10 May 14:18 +0200
Re: [bug#70720] [PATCH 3/3] gnu: Add tree-sitter-erlang.
(name . Karl Hallsby via Guix-patches via)(address . guix-patches@gnu.org)
87jzk1c12f.fsf@iscas.ac.cn
Karl Hallsby via Guix-patches via <guix-patches@gnu.org> writes:

Toggle quote (25 lines)
> * gnu/packages/tree-sitter.scm (tree-sitter-erlang): New variable.
>
> Change-Id: Ib1449549249816736bf30a1d419a23fd7a45570e
> ---
> gnu/packages/tree-sitter.scm | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/gnu/packages/tree-sitter.scm b/gnu/packages/tree-sitter.scm
> index 42f311223e..dfe79496f9 100644
> --- a/gnu/packages/tree-sitter.scm
> +++ b/gnu/packages/tree-sitter.scm
> @@ -426,6 +426,18 @@ (define-public tree-sitter-dockerfile
> "0.1.2"
> #:repository-url "https://github.com/camdencheek/tree-sitter-dockerfile"))
>
> +(define-public tree-sitter-erlang
> + ;; This is an untagged release, for 0.4.0
> + ;; Newer versions use tree-sitter 0.22.1
> + (let ((commit "57e69513efd831f9cc8207d65d96bad917ca4aa4")
> + (revision "0"))
> + (tree-sitter-grammar
> + "erlang" "Erlang"
> + "1h0c9qc6i0kz5a0yq68xp623f84g4mc8hcp00khdbf7y7z7b9izc"
> + (git-version "0.0.0" revision commit)

should "0.4.0"

Toggle quote (6 lines)
> + #:commit commit)))
> +
> (define-public tree-sitter-elm
> (tree-sitter-grammar
> "elm" "Elm"
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEfr6klGDOXiwIdX/bO1qpk+Gi3/AFAmY+EJgACgkQO1qpk+Gi
3/CP8Q/+On/R8Rc+gx5YEXW5S+nSw2790cc83OIr3h1uKm7ZX3qFYUtL/3btEkFh
CVNPhr0GikCGLF2qNhwWvd6v33UMXtnbvCTPpl177Wt9ubUBT1BiKZLIo2zupUaj
uMU/Gt4+1VC3hzlSmHFWX2Up2FqomFlveJYxcXMxx0g23kM8WeezNq2NHUvUNvJP
6z1ZqJakF0eHTVyUDUZlbjQuNXs2Pvi4DmCWqMaHiKX9IAVZL8/r6ymrcp94eUqZ
/od/yGofWdeb6/oRyyKhDV4es4j+j4yS5WAvNN4PG732DPqSpaQT4BEKYoycn+Qm
Azz4py2H7B3ow32nZaiTaEhhG5MJiWTsV45SAv/BkNYUNE7LBnSqPNR7E5nPRyRS
TLJ0qo56sfhvw/YBnxDdb70Qu/cz9OuddaIwoJz7UAzZ2Au/gpebVPTICMpJ4TRy
emQnv2oMnPeQZu34i1HrHs96o1sRDC4AYaBBayZWrAqhi/unBjotUjhJBVLEXQda
Ygcl9KnBn/mIO6zNDvTCjiCOayvM061hct1ZTvrEfsE1YlGVxR+vhazvgg+wVEwC
qUyrlL3ZJnnPg+1nGStiToWRBxId7oKxTt90CylUxZi/3s7Zck/hwLJIpGksjacA
qCuSjtPIu8WVGcCoIlH0Zm9jzpxVv5rAi3VaUu4Of3uGLScM+Iw=
=+fmB
-----END PGP SIGNATURE-----

K
K
Karl Hallsby wrote on 10 May 18:26 +0200
[PATCH 1/3] gnu: Add tree-sitter-verilog.
(address . 70720@debbugs.gnu.org)(name . Karl Hallsby)(address . karl@hallsby.com)
2abdc3ee62e1fcef646a25ecde7a3a9b86230b32.1715358353.git.karl@hallsby.com
* gnu/packages/tree-sitter.scm (tree-sitter-verilog): New variable.

Change-Id: I2066aff3cf39cebda956125cdac71236502a7ac5

Change-Id: If4acb8c10cd3942f46dcb05b8009760a6452b67a
---
gnu/packages/tree-sitter.scm | 16 ++++++++++++++++
1 file changed, 16 insertions(+)

Toggle diff (28 lines)
diff --git a/gnu/packages/tree-sitter.scm b/gnu/packages/tree-sitter.scm
index ee0acb82de..206fd7268e 100644
--- a/gnu/packages/tree-sitter.scm
+++ b/gnu/packages/tree-sitter.scm
@@ -701,3 +701,19 @@ (define-public tree-sitter-tlaplus
"1.0.8"
;; Version 1.2.1 is most recent, but requires tree-sitter >0.21.0
#:repository-url "https://github.com/tlaplus-community/tree-sitter-tlaplus"))
+
+(define-public tree-sitter-verilog
+ (let ((version "1.0.0") ; In package.json, but untagged
+ (commit "075ebfc84543675f12e79a955f79d717772dcef3")
+ (revision "0"))
+ (tree-sitter-grammar
+ "verilog" "Verilog"
+ "0j5iycqm5dmvzy7dssm8km1djhr7hnfgk26zyzcxanhrwwq3wi4k"
+ (git-version version revision commit)
+ #:commit commit
+ #:get-cleanup-snippet
+ (lambda _
+ #~(begin
+ (use-modules (guix build utils))
+ (delete-file "binding.gyp")
+ (delete-file-recursively "bindings"))))))

base-commit: 5010a51fc91aeac5a3b87a3eea04f18f3fe8a3a3
--
2.41.0
K
K
Karl Hallsby wrote on 10 May 18:26 +0200
[PATCH 2/3] gnu: Add tree-sitter-vhdl.
(address . 70720@debbugs.gnu.org)(name . Karl Hallsby)(address . karl@hallsby.com)
465b905153d08c5c831327955829ad4a68cf94e8.1715358353.git.karl@hallsby.com
* gnu/packages/tree-sitter.scm (tree-sitter-vhdl): New variable.

Change-Id: Ia26e33f9898573e70c9afdd4025e3770d042dbd6

Change-Id: I07b2b89f878957af1544344122cdfe8970efc9f7
---
gnu/packages/tree-sitter.scm | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)

Toggle diff (42 lines)
diff --git a/gnu/packages/tree-sitter.scm b/gnu/packages/tree-sitter.scm
index 206fd7268e..3863558883 100644
--- a/gnu/packages/tree-sitter.scm
+++ b/gnu/packages/tree-sitter.scm
@@ -717,3 +717,35 @@ (define-public tree-sitter-verilog
(use-modules (guix build utils))
(delete-file "binding.gyp")
(delete-file-recursively "bindings"))))))
+
+(define-public tree-sitter-vhdl
+ (let ((version "0.1.1") ; In package.json, but untagged
+ (commit "a3b2d84990527c7f8f4ae219c332c00c33d2d8e5")
+ (revision "0"))
+ (tree-sitter-grammar
+ "vhdl" "VHDL"
+ "0gz2b0qg1jzi2q6wgj6k6g35kmni3pqglq4f5kblkxx909463n8a"
+ (git-version version revision commit)
+ #:repository-url "https://github.com/alemuller/tree-sitter-vhdl"
+ #:commit commit
+ #:get-cleanup-snippet
+ (lambda _
+ #~(begin
+ (use-modules (guix build utils))
+ (delete-file "binding.gyp")
+ ;; tree-sitter-vhdl does not have bindings/ directory.
+ (delete-file "src/grammar.json")
+ (delete-file "src/node-types.json")
+ (delete-file "src/parser.c")
+ (delete-file-recursively "src/tree_sitter")
+ ;; Fix a query error in the highlight.scm query test. This would be
+ ;; easier with a patch, but this works too, and we still get to use
+ ;; tree-sitter-grammar. The fix is taken from here:
+ ;; https://github.com/n8tlarsen/tree-sitter-vhdl/commit/dabf157c6bb7220d72d3ceba0ce1abd90bf62187
+ ;; This is a documented issue that has not been resolved for nearly 2
+ ;; years.
+ ;; https://github.com/alemuller/tree-sitter-vhdl/issues/2
+ (substitute* "queries/highlights.scm"
+ (("\\(integer_decimal\n") "(integer_decimal)\n")
+ (("\\(integer\\)") "")
+ (("\"0\")") "\"0\"")))))))
--
2.41.0
K
K
Karl Hallsby wrote on 10 May 18:26 +0200
[PATCH 3/3] gnu: Add tree-sitter-erlang.
(address . 70720@debbugs.gnu.org)(name . Karl Hallsby)(address . karl@hallsby.com)
d59f63b78b3dd5e3e9a275a8a404f0cf76a574fb.1715358353.git.karl@hallsby.com
* gnu/packages/tree-sitter.scm (tree-sitter-erlang): New variable.

Change-Id: Ib1449549249816736bf30a1d419a23fd7a45570e

Change-Id: I99cdde6418e04d4898f0f6509d2e7d849e2a4f22
---
gnu/packages/tree-sitter.scm | 12 ++++++++++++
1 file changed, 12 insertions(+)

Toggle diff (25 lines)
diff --git a/gnu/packages/tree-sitter.scm b/gnu/packages/tree-sitter.scm
index 3863558883..c6e84bc85b 100644
--- a/gnu/packages/tree-sitter.scm
+++ b/gnu/packages/tree-sitter.scm
@@ -426,6 +426,18 @@ (define-public tree-sitter-dockerfile
"0.1.2"
#:repository-url "https://github.com/camdencheek/tree-sitter-dockerfile"))
+(define-public tree-sitter-erlang
+ ;; Versions newer than 0.4.0 use tree-sitter 0.22.1
+ (let ((version "0.4.0") ; In Cargo.toml, but untagged
+ (commit "57e69513efd831f9cc8207d65d96bad917ca4aa4")
+ (revision "0"))
+ (tree-sitter-grammar
+ "erlang" "Erlang"
+ "1h0c9qc6i0kz5a0yq68xp623f84g4mc8hcp00khdbf7y7z7b9izc"
+ (git-version version revision commit)
+ #:repository-url "https://github.com/WhatsApp/tree-sitter-erlang"
+ #:commit commit)))
+
(define-public tree-sitter-elm
(tree-sitter-grammar
"elm" "Elm"
--
2.41.0
L
L
Liliana Marie Prikler wrote on 10 May 18:49 +0200
Re: [bug#70720] [PATCH 1/3] gnu: Add tree-sitter-verilog.
584435173232aca1c04afd1c84bdd11479feb4e5.camel@gmail.com
Am Freitag, dem 10.05.2024 um 11:26 -0500 schrieb Karl Hallsby:
Toggle quote (6 lines)
> * gnu/packages/tree-sitter.scm (tree-sitter-verilog): New variable.
>
> Change-Id: I2066aff3cf39cebda956125cdac71236502a7ac5
>
> Change-Id: If4acb8c10cd3942f46dcb05b8009760a6452b67a
> ---
Don't do multiple Change-Ids.

Cheers
K
K
Karl Hallsby wrote on 10 May 20:28 +0200
[PATCH 1/3] gnu: Add tree-sitter-verilog.
(address . 70720@debbugs.gnu.org)(name . Karl Hallsby)(address . karl@hallsby.com)
14707a5b3202ef9d30cbba4a20c85c12a1547ed0.1715365716.git.karl@hallsby.com
* gnu/packages/tree-sitter.scm (tree-sitter-verilog): New variable.

Change-Id: If4acb8c10cd3942f46dcb05b8009760a6452b67a
---
gnu/packages/tree-sitter.scm | 16 ++++++++++++++++
1 file changed, 16 insertions(+)

Toggle diff (28 lines)
diff --git a/gnu/packages/tree-sitter.scm b/gnu/packages/tree-sitter.scm
index ee0acb82de..206fd7268e 100644
--- a/gnu/packages/tree-sitter.scm
+++ b/gnu/packages/tree-sitter.scm
@@ -701,3 +701,19 @@ (define-public tree-sitter-tlaplus
"1.0.8"
;; Version 1.2.1 is most recent, but requires tree-sitter >0.21.0
#:repository-url "https://github.com/tlaplus-community/tree-sitter-tlaplus"))
+
+(define-public tree-sitter-verilog
+ (let ((version "1.0.0") ; In package.json, but untagged
+ (commit "075ebfc84543675f12e79a955f79d717772dcef3")
+ (revision "0"))
+ (tree-sitter-grammar
+ "verilog" "Verilog"
+ "0j5iycqm5dmvzy7dssm8km1djhr7hnfgk26zyzcxanhrwwq3wi4k"
+ (git-version version revision commit)
+ #:commit commit
+ #:get-cleanup-snippet
+ (lambda _
+ #~(begin
+ (use-modules (guix build utils))
+ (delete-file "binding.gyp")
+ (delete-file-recursively "bindings"))))))

base-commit: 5010a51fc91aeac5a3b87a3eea04f18f3fe8a3a3
--
2.41.0
K
K
Karl Hallsby wrote on 10 May 20:28 +0200
[PATCH 2/3] gnu: Add tree-sitter-vhdl.
(address . 70720@debbugs.gnu.org)(name . Karl Hallsby)(address . karl@hallsby.com)
4eaac81a00ac27ac39e4ff1a2c8124f7b10918b3.1715365716.git.karl@hallsby.com
* gnu/packages/tree-sitter.scm (tree-sitter-vhdl): New variable.

Change-Id: I07b2b89f878957af1544344122cdfe8970efc9f7
---
gnu/packages/tree-sitter.scm | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)

Toggle diff (42 lines)
diff --git a/gnu/packages/tree-sitter.scm b/gnu/packages/tree-sitter.scm
index 206fd7268e..3863558883 100644
--- a/gnu/packages/tree-sitter.scm
+++ b/gnu/packages/tree-sitter.scm
@@ -717,3 +717,35 @@ (define-public tree-sitter-verilog
(use-modules (guix build utils))
(delete-file "binding.gyp")
(delete-file-recursively "bindings"))))))
+
+(define-public tree-sitter-vhdl
+ (let ((version "0.1.1") ; In package.json, but untagged
+ (commit "a3b2d84990527c7f8f4ae219c332c00c33d2d8e5")
+ (revision "0"))
+ (tree-sitter-grammar
+ "vhdl" "VHDL"
+ "0gz2b0qg1jzi2q6wgj6k6g35kmni3pqglq4f5kblkxx909463n8a"
+ (git-version version revision commit)
+ #:repository-url "https://github.com/alemuller/tree-sitter-vhdl"
+ #:commit commit
+ #:get-cleanup-snippet
+ (lambda _
+ #~(begin
+ (use-modules (guix build utils))
+ (delete-file "binding.gyp")
+ ;; tree-sitter-vhdl does not have bindings/ directory.
+ (delete-file "src/grammar.json")
+ (delete-file "src/node-types.json")
+ (delete-file "src/parser.c")
+ (delete-file-recursively "src/tree_sitter")
+ ;; Fix a query error in the highlight.scm query test. This would be
+ ;; easier with a patch, but this works too, and we still get to use
+ ;; tree-sitter-grammar. The fix is taken from here:
+ ;; https://github.com/n8tlarsen/tree-sitter-vhdl/commit/dabf157c6bb7220d72d3ceba0ce1abd90bf62187
+ ;; This is a documented issue that has not been resolved for nearly 2
+ ;; years.
+ ;; https://github.com/alemuller/tree-sitter-vhdl/issues/2
+ (substitute* "queries/highlights.scm"
+ (("\\(integer_decimal\n") "(integer_decimal)\n")
+ (("\\(integer\\)") "")
+ (("\"0\")") "\"0\"")))))))
--
2.41.0
K
K
Karl Hallsby wrote on 10 May 20:28 +0200
[PATCH 3/3] gnu: Add tree-sitter-erlang.
(address . 70720@debbugs.gnu.org)(name . Karl Hallsby)(address . karl@hallsby.com)
cd0b485ce28e45c191bac5ac8e611a64c3b0dd68.1715365716.git.karl@hallsby.com
* gnu/packages/tree-sitter.scm (tree-sitter-erlang): New variable.

Change-Id: I99cdde6418e04d4898f0f6509d2e7d849e2a4f22
---
gnu/packages/tree-sitter.scm | 12 ++++++++++++
1 file changed, 12 insertions(+)

Toggle diff (25 lines)
diff --git a/gnu/packages/tree-sitter.scm b/gnu/packages/tree-sitter.scm
index 3863558883..c6e84bc85b 100644
--- a/gnu/packages/tree-sitter.scm
+++ b/gnu/packages/tree-sitter.scm
@@ -426,6 +426,18 @@ (define-public tree-sitter-dockerfile
"0.1.2"
#:repository-url "https://github.com/camdencheek/tree-sitter-dockerfile"))
+(define-public tree-sitter-erlang
+ ;; Versions newer than 0.4.0 use tree-sitter 0.22.1
+ (let ((version "0.4.0") ; In Cargo.toml, but untagged
+ (commit "57e69513efd831f9cc8207d65d96bad917ca4aa4")
+ (revision "0"))
+ (tree-sitter-grammar
+ "erlang" "Erlang"
+ "1h0c9qc6i0kz5a0yq68xp623f84g4mc8hcp00khdbf7y7z7b9izc"
+ (git-version version revision commit)
+ #:repository-url "https://github.com/WhatsApp/tree-sitter-erlang"
+ #:commit commit)))
+
(define-public tree-sitter-elm
(tree-sitter-grammar
"elm" "Elm"
--
2.41.0
Z
Z
Zheng Junjie wrote on 13 May 18:40 +0200
Re: [bug#70720] [PATCH 0/3] Add tree-sitter-verilog/-vhdl/-erlang
(name . Karl Hallsby via Guix-patches via)(address . guix-patches@gnu.org)
87y18dy8a0.fsf@iscas.ac.cn
Karl Hallsby via Guix-patches via <guix-patches@gnu.org> writes:

Toggle quote (16 lines)
> Verilog & VHDL have Emacs major modes for them. I have tested that both
> verilog-ts-mode and vhdl-ts-mode produce syntax highlighting.
>
> Erlang does not have a tree-sitter-powered major-mode for Emacs yet.
>
> Karl Hallsby (3):
> gnu: Add tree-sitter-verilog.
> gnu: Add tree-sitter-vhdl.
> gnu: Add tree-sitter-erlang.
>
> gnu/packages/tree-sitter.scm | 58 ++++++++++++++++++++++++++++++++++++
> 1 file changed, 58 insertions(+)
>
>
> base-commit: 5010a51fc91aeac5a3b87a3eea04f18f3fe8a3a3

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEfr6klGDOXiwIdX/bO1qpk+Gi3/AFAmZCQpcACgkQO1qpk+Gi
3/Dm7Q//Tn2YiTMbCymB0XvHaXjMLE1VBYdiepIU5MY6PlUj1oqV9Gr+QJCrXq0L
YhZo/y4+8VocsiGcu9L+vCOGubFEIDpjn6Vdp2WnkHPDsolz7dITh17ePvwq2F/O
vCA5XV8bEa9rEy4oc2lH+dlVJvRSU8HRh7/tkMxCkYgbnWJjuBl/uznuIPlr8IfX
SPyMMASQAWiQ9fg7dzVFj6CfS26M2dfZ+c8zEDMujUj3l/ySTdzBzhdXlqJzdqJ1
8CBkXSZP/4jcW49y27HFCYC2dliZN31+iI5x8fbDPM+fv0khdJd6EzyL9rzmfdBC
rH8zE1BDHYZXQGcJVH+qP0FVAIi11VY9mVyab2lXwSykc8alSTfny9eURTHl20Q2
0HqIMHw8SeExLr4IKxFDkP8RTmCcejq+QW3FAfZdoAuFgTrhHcAJJfBMK9wnetfe
IDH4RThV0vckIWiToTNS/SRcrle8NqRoz1rv0j5X2w9kAR7tM87Gyx1Bg/FRnNvy
UrB4E8FbXGhuZCOyVPvwHSvBWhmfoeM2bFsBM4DlAZTRh4s3H/VkFr3Sk5Zh/+wr
CfvQxllQdMRGRJD0/rwG3p//bXodBQd10LuPhyAareUZj7tQbEujfLqcFQf7JU3u
Mvc8MIAxLfi/X2LtfuR6oiI1aAn3o22RDO65ZcCDC9s5gOjYxWM=
=kJe/
-----END PGP SIGNATURE-----

?
Your comment

This issue is archived.

To comment on this conversation send an email to 70720@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 70720
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch