[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/xr 6c1c713 2/6: Strengthen ad-hoc [...] check in skip-s
From: |
Mattias Engdegård |
Subject: |
[elpa] externals/xr 6c1c713 2/6: Strengthen ad-hoc [...] check in skip-set parser |
Date: |
Sat, 13 Apr 2019 12:51:16 -0400 (EDT) |
branch: externals/xr
commit 6c1c7138d70c59251185c65d900d55e8d6e36d29
Author: Mattias Engdegård <address@hidden>
Commit: Mattias Engdegård <address@hidden>
Strengthen ad-hoc [...] check in skip-set parser
Catch common mistakes like "[a-z]+".
---
xr-test.el | 2 ++
xr.el | 5 ++++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/xr-test.el b/xr-test.el
index 4dbd525..ee45bca 100644
--- a/xr-test.el
+++ b/xr-test.el
@@ -428,6 +428,8 @@
'((2 . "Unnecessarily escaped `$'"))))
(should (equal (xr-skip-set-lint "[^a-z]")
'((0 . "Suspect skip set framed in `[...]'"))))
+ (should (equal (xr-skip-set-lint "[0-9]+")
+ '((0 . "Suspect skip set framed in `[...]'"))))
(should (equal (xr-skip-set-lint "[[:space:]].")
'((0 . "Suspect character class framed in `[...]'"))))
(should (equal (xr-skip-set-lint "")
diff --git a/xr.el b/xr.el
index 9f3e214..aea8ffb 100644
--- a/xr.el
+++ b/xr.el
@@ -661,7 +661,10 @@
(defun xr--parse-skip-set-buffer (warnings)
;; An ad-hoc check, but one that catches lots of mistakes.
- (when (and (looking-at (rx "[" (one-or-more anything) "]" eos))
+ (when (and (looking-at (rx "[" (one-or-more anything) "]"
+ (opt (any "+" "*" "?")
+ (opt "?"))
+ eos))
(not (looking-at (rx "[:" (one-or-more anything) ":]" eos))))
(xr--report warnings (point) "Suspect skip set framed in `[...]'"))
- [elpa] externals/xr updated (2aec9fd -> 8ccace4), Mattias Engdegård, 2019/04/13
- [elpa] externals/xr 4b8d3bc 1/6: Detect `-' not first or last in [...], Mattias Engdegård, 2019/04/13
- [elpa] externals/xr 8ccace4 6/6: Increment version to 1.11, Mattias Engdegård, 2019/04/13
- [elpa] externals/xr a49b9b7 4/6: Check for repetition of empty-matching expression, Mattias Engdegård, 2019/04/13
- [elpa] externals/xr 33c5400 5/6: Suppress false positive in repetition of empty string, Mattias Engdegård, 2019/04/13
- [elpa] externals/xr 6c1c713 2/6: Strengthen ad-hoc [...] check in skip-set parser,
Mattias Engdegård <=
- [elpa] externals/xr 0b9979e 3/6: Use doc strings instead of comments preceding functions, Mattias Engdegård, 2019/04/13