emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/treesit-fold c36f3ad85c 279/417: feat: Add Perl support (#


From: ELPA Syncer
Subject: [nongnu] elpa/treesit-fold c36f3ad85c 279/417: feat: Add Perl support (#66)
Date: Mon, 1 Jul 2024 10:02:35 -0400 (EDT)

branch: elpa/treesit-fold
commit c36f3ad85c7345d6ecd72c5d7bff160462ac22e5
Author: Jen-Chieh Shen <jcs090218@gmail.com>
Commit: GitHub <noreply@github.com>

    feat: Add Perl support (#66)
---
 CHANGELOG.md       | 1 +
 README.md          | 2 +-
 ts-fold-parsers.el | 8 ++++++++
 ts-fold-summary.el | 1 +
 ts-fold.el         | 1 +
 5 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index b6f08fd5fa..70162a3bd1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -24,6 +24,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for 
recommendations on how
 * Add Elisp support (#63)
 * Add Clojure support (#64)
 * Add Haskell support (#65)
+* Add Perl support (#66)
 
 ## 0.1.0
 > Released Oct 18, 2021
diff --git a/README.md b/README.md
index ee3782d975..49a6630c1b 100644
--- a/README.md
+++ b/README.md
@@ -121,7 +121,7 @@ These languages are fairly complete:
 - Java / JavaScript / JSX / JSON / Julia
 - Lua
 - Nix
-- PHP / Python
+- Perl / PHP / Python
 - R / Ruby / Rust
 - Scala / Swift
 - TypeScript / TSX
diff --git a/ts-fold-parsers.el b/ts-fold-parsers.el
index 17916a4708..afb6ce6004 100644
--- a/ts-fold-parsers.el
+++ b/ts-fold-parsers.el
@@ -245,6 +245,14 @@
     (type_definition     . ts-fold-range-ocaml-type-definition)
     (value_definition    . ts-fold-range-ocaml-value-definition)))
 
+(defun ts-fold-parsers-perl ()
+  "Rule set for Perl."
+  '((block           . ts-fold-range-seq)
+    (list_expression . ts-fold-range-seq)
+    (comment
+     . (lambda (node offset)
+         (ts-fold-range-line-comment node offset "#")))))
+
 (defun ts-fold-parsers-php ()
   "Rule set for PHP."
   '((namespace_use_group . ts-fold-range-seq)
diff --git a/ts-fold-summary.el b/ts-fold-summary.el
index b6eff07665..e92b8acc0b 100644
--- a/ts-fold-summary.el
+++ b/ts-fold-summary.el
@@ -226,6 +226,7 @@ type of content by checking the word boundary's existence."
     (markdown-mode     . ts-fold-summary-markdown)
     (objc-mode         . ts-fold-summary-c)
     (org-mode          . ts-fold-summary-org)
+    (perl-mode         . ts-fold-summary-ruby-doc)
     (php-mode          . ts-fold-summary-javadoc)
     (python-mode       . ts-fold-summary-python-doc)
     (rjsx-mode         . ts-fold-summary-javadoc)
diff --git a/ts-fold.el b/ts-fold.el
index 87f2b20ec2..0eb0ba7d5a 100644
--- a/ts-fold.el
+++ b/ts-fold.el
@@ -84,6 +84,7 @@
     (lua-mode        . ,(ts-fold-parsers-lua))
     (nix-mode        . ,(ts-fold-parsers-nix))
     (ocaml-mode      . ,(ts-fold-parsers-ocaml))
+    (perl-mode       . ,(ts-fold-parsers-perl))
     (php-mode        . ,(ts-fold-parsers-php))
     (python-mode     . ,(ts-fold-parsers-python))
     (rjsx-mode       . ,(ts-fold-parsers-javascript))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]