[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/relint e11b871 12/23: More robust scanning of format st
From: |
Mattias Engdegård |
Subject: |
[elpa] externals/relint e11b871 12/23: More robust scanning of format strings for mixup check |
Date: |
Sun, 29 Sep 2019 15:34:52 -0400 (EDT) |
branch: externals/relint
commit e11b8715488f80758a7de838e7955e628d8218fc
Author: Mattias Engdegård <address@hidden>
Commit: Mattias Engdegård <address@hidden>
More robust scanning of format strings for mixup check
---
relint.el | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/relint.el b/relint.el
index 546c311..1c33c8d 100644
--- a/relint.el
+++ b/relint.el
@@ -974,22 +974,26 @@ parameter is regexp-generating."
(start 0))
(while (and (< index nargs)
(string-match (rx
- ;; An unescaped [, and some leading chars
- (opt (or bos (not (any "\\")))
- (0+ "\\\\")
- (group "[")
- (0+ (not (any "]"))))
- ;; Any %-sequence
"%"
(opt (1+ digit) "$")
(0+ digit)
(opt "." (0+ digit))
(group (any "%sdioxXefgcS")))
template start))
- (let ((bracket (match-beginning 1))
- (type (string-to-char (match-string 2 template)))
+ (let ((percent (match-beginning 0))
+ (type (string-to-char (match-string 1 template)))
(next (match-end 0)))
- (when (and bracket (eq type ?s))
+ (when (and (eq type ?s)
+ ;; Find preceding `[' before %s
+ (string-match-p
+ (rx
+ bos
+ (* (or (not (any "\\" "["))
+ (seq "\\" anything)))
+ "["
+ (* (not (any "]")))
+ eos)
+ (substring template start percent)))
(let ((reg-gen (relint--regexp-generators (nth index args) nil)))
(when reg-gen
(relint--report
- [elpa] externals/relint updated (0bf6883 -> b0f0bee), Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 099b59f 01/23: Reorder strings in regexp for more efficient matching, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 1ec2d8b 02/23: More elaborate parsing of doc strings of global variables, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 95b3c07 08/23: Add `xor' and bitwise operations to the list of safe functions, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 3f3408d 07/23: Check both car and cdr of items in -regexp-alist variables, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 5142c86 09/23: Fix function evaluation bug, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 43c4644 06/23: Correct naming, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint e11b871 12/23: More robust scanning of format strings for mixup check,
Mattias Engdegård <=
- [elpa] externals/relint 956a15b 17/23: Fix defun parsing, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 3a27cff 18/23: Handle mutation of local variables in evaluation, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint d2b7194 19/23: Evaluate `dolist' and `while', Mattias Engdegård, 2019/09/29
- [elpa] externals/relint b2a86b8 04/23: Fix typo in message description and clarify, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 1cb021a 03/23: Remove relint--eval-error, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 5137ec6 11/23: Evaluate keywords correctly, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 6a07508 10/23: Handle rx `eval' form correctly, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 3a7e82a 05/23: Track some mutation of local variables in phase 2, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint bc1b5a8 16/23: Add word-search-regexp to the list of regexp generating functions, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint b890b5a 15/23: Track mutation in push and lambda in phase 2, Mattias Engdegård, 2019/09/29