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

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

[elpa] externals/relint 32dbad1 07/12: Scan arguments to syntax-properti


From: Mattias Engdegård
Subject: [elpa] externals/relint 32dbad1 07/12: Scan arguments to syntax-propertize-{precompile-}rules
Date: Thu, 30 Jan 2020 10:53:40 -0500 (EST)

branch: externals/relint
commit 32dbad1f47628f9ce6c401c554cf8d6d552d929e
Author: Mattias Engdegård <address@hidden>
Commit: Mattias Engdegård <address@hidden>

    Scan arguments to syntax-propertize-{precompile-}rules
---
 relint.el       |  9 +++++++++
 test/1.elisp    | 12 ++++++++++++
 test/1.expected | 12 ++++++++++++
 3 files changed, 33 insertions(+)

diff --git a/relint.el b/relint.el
index 02ea60d..b59c559 100644
--- a/relint.el
+++ b/relint.el
@@ -1586,6 +1586,15 @@ directly."
           (relint--check-font-lock-keywords font-lock-list origin
                                             file pos (cons 4 path))
           (relint--check-list auto-mode-list origin file pos (cons 5 path))))
+       (`(,(or 'syntax-propertize-rules 'syntax-propertize-precompile-rules)
+          . ,rules)
+        (let ((index 1))
+          (dolist (item rules)
+            (when (consp item)
+              (relint--check-re (car item)
+                                (format "call to %s" (car form))
+                                file pos (cons 0 (cons index path))))
+            (setq index (1+ index)))))
        (`(,name . ,args)
         (let ((alias (assq name relint--alias-defs)))
           (when alias
diff --git a/test/1.elisp b/test/1.elisp
index 982803d..9e934ae 100644
--- a/test/1.elisp
+++ b/test/1.elisp
@@ -85,3 +85,15 @@
     ("2^" argl))
   '("a" "b++" "c")
   nil)
+
+(defun my-syn-1 ()
+  (syntax-propertize-rules
+   ("thing" stuff)
+   ("$1$" bad)
+   ("^2^" alsobad)))
+
+(defun my-syn-2 ()
+  (syntax-propertize-precompile-rules
+   ("thing" stuff)
+   ("$3$" bad)
+   ("^4^" alsobad)))
diff --git a/test/1.expected b/test/1.expected
index 6e84f44..e31af97 100644
--- a/test/1.expected
+++ b/test/1.expected
@@ -140,3 +140,15 @@
 1.elisp:86:3: In define-generic-mode my-mode: Repetition of repetition (pos 2)
   "b++"
    ..^
+1.elisp:92:5: In call to syntax-propertize-rules: Unescaped literal `$' (pos 0)
+  "$1$"
+   ^
+1.elisp:93:5: In call to syntax-propertize-rules: Unescaped literal `^' (pos 2)
+  "^2^"
+   ..^
+1.elisp:98:5: In call to syntax-propertize-precompile-rules: Unescaped literal 
`$' (pos 0)
+  "$3$"
+   ^
+1.elisp:99:5: In call to syntax-propertize-precompile-rules: Unescaped literal 
`^' (pos 2)
+  "^4^"
+   ..^



reply via email to

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