aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Hallsby <karl@hallsby.com>2024-05-10 11:26:47 -0500
committerZheng Junjie <zhengjunjie@iscas.ac.cn>2024-05-14 00:24:12 +0800
commit6b6ad68559ef57764af6460aef6d5cd46fab06eb (patch)
tree2296efe85d089eb4c18cf1f59d48e4a80c30e0b3
parent65186deae436f419fbe56a88d097181453728a29 (diff)
downloadguix-6b6ad68559ef57764af6460aef6d5cd46fab06eb.tar.gz
guix-6b6ad68559ef57764af6460aef6d5cd46fab06eb.zip
gnu: Add tree-sitter-vhdl.
* gnu/packages/tree-sitter.scm (tree-sitter-vhdl): New variable. Change-Id: Ia26e33f9898573e70c9afdd4025e3770d042dbd6 Change-Id: I07b2b89f878957af1544344122cdfe8970efc9f7 Signed-off-by: Zheng Junjie <zhengjunjie@iscas.ac.cn>
-rw-r--r--gnu/packages/tree-sitter.scm32
1 files changed, 32 insertions, 0 deletions
diff --git a/gnu/packages/tree-sitter.scm b/gnu/packages/tree-sitter.scm
index 9d4f73b3c8..54cdd82565 100644
--- a/gnu/packages/tree-sitter.scm
+++ b/gnu/packages/tree-sitter.scm
@@ -741,3 +741,35 @@ which will be used as a snippet in origin."
(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\"")))))))