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

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

[nongnu] elpa/parseclj 70804992ee 122/185: Merge pull request #14 from l


From: ELPA Syncer
Subject: [nongnu] elpa/parseclj 70804992ee 122/185: Merge pull request #14 from lambdaisland/parseclj-lex-symbol-fix
Date: Tue, 28 Dec 2021 14:05:27 -0500 (EST)

branch: elpa/parseclj
commit 70804992ee73264d45db3d209a2f899ae925d3bb
Merge: bad1fb8745 19ca5f5bd0
Author: Arne Brasseur <arne.brasseur@gmail.com>
Commit: GitHub <noreply@github.com>

    Merge pull request #14 from lambdaisland/parseclj-lex-symbol-fix
    
    Add support for having single quotes in symbols/keywords
---
 .travis.yml               |  1 +
 parseclj-lex.el           |  4 ++--
 test/parseclj-lex-test.el | 10 ++++++++++
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 5cfcd11bb1..7f4e57f3fd 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,6 @@
 language: generic
 dist: trusty
+group: deprecated-2017Q4
 env:
   - EMACS=emacs25
   - EMACS=emacs-snapshot
diff --git a/parseclj-lex.el b/parseclj-lex.el
index 1d4f28a5b5..ea8b65783c 100644
--- a/parseclj-lex.el
+++ b/parseclj-lex.el
@@ -218,7 +218,7 @@ A token is an association list with :token-type as its 
first key."
   "Return t if CHAR is a valid start for a symbol.
 
 Symbols begin with a non-numeric character and can contain alphanumeric
-characters and . * + ! - _ ? $ % & = < >.  If - + or . are the first
+characters and . * + ! - _ ? $ % & = < > '.  If - + or . are the first
 character, the second character (if any) must be non-numeric.
 
 In some cases, like in tagged elements, symbols are required to start with
@@ -226,7 +226,7 @@ alphabetic characters only.  ALPHA-ONLY ensures this 
behavior."
   (not (not (and char
                  (or (and (<= ?a char) (<= char ?z))
                      (and (<= ?A char) (<= char ?Z))
-                     (and (not alpha-only) (member char '(?. ?* ?+ ?! ?- ?_ ?? 
?$ ?% ?& ?= ?< ?> ?/))))))))
+                     (and (not alpha-only) (member char '(?. ?* ?+ ?! ?- ?_ ?? 
?$ ?% ?& ?= ?< ?> ?/ ?'))))))))
 
 (defun parseclj-lex-symbol-rest-p (char)
   "Return t if CHAR is a valid character in a symbol.
diff --git a/test/parseclj-lex-test.el b/test/parseclj-lex-test.el
index eae02a07af..c1ebc09ce1 100644
--- a/test/parseclj-lex-test.el
+++ b/test/parseclj-lex-test.el
@@ -92,6 +92,11 @@
     (goto-char 1)
     (should (equal (parseclj-lex-next) '((:token-type . :symbol) (:form . 
"foo#") (:pos . 1)))))
 
+  (with-temp-buffer
+    (insert "foo'")
+    (goto-char 1)
+    (should (equal (parseclj-lex-next) '((:token-type . :symbol) (:form . 
"foo'") (:pos . 1)))))
+
   (with-temp-buffer
     (insert "#inst")
     (goto-char 1)
@@ -138,6 +143,11 @@
     (goto-char 1)
     (should (equal (parseclj-lex-next) (parseclj-lex-token :keyword 
":hello-world" 1))))
 
+  (with-temp-buffer
+    (insert ":hello-world'")
+    (goto-char 1)
+    (should (equal (parseclj-lex-next) (parseclj-lex-token :keyword 
":hello-world'" 1))))
+
   (with-temp-buffer
     (insert ":hello/world")
     (goto-char 1)



reply via email to

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