[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/relint 501f87b 20/23: Evaluate `prog1' and `prog2'
From: |
Mattias Engdegård |
Subject: |
[elpa] externals/relint 501f87b 20/23: Evaluate `prog1' and `prog2' |
Date: |
Sun, 29 Sep 2019 15:34:54 -0400 (EDT) |
branch: externals/relint
commit 501f87b2ae4616629df3a569e8ee762f71a7f2b1
Author: Mattias Engdegård <address@hidden>
Commit: Mattias Engdegård <address@hidden>
Evaluate `prog1' and `prog2'
---
relint.el | 11 +++++++++++
test/5.elisp | 6 ++++++
test/5.expected | 6 ++++++
3 files changed, 23 insertions(+)
diff --git a/relint.el b/relint.el
index 90fc73b..53acede 100644
--- a/relint.el
+++ b/relint.el
@@ -619,6 +619,17 @@ not be evaluated safely."
((memq head '(progn ignore-errors eval-when-compile eval-and-compile))
(relint--eval-body body))
+ ((eq head 'prog1)
+ (let ((val (relint--eval (car body))))
+ (relint--eval-body (cdr body))
+ val))
+
+ ((eq head 'prog2)
+ (relint--eval (car body))
+ (let ((val (relint--eval (cadr body))))
+ (relint--eval-body (cddr body))
+ val))
+
;; delete-dups: Work on a copy of the argument.
((eq head 'delete-dups)
(let ((arg (relint--eval (car body))))
diff --git a/test/5.elisp b/test/5.elisp
index 325a068..eb0e78c 100644
--- a/test/5.elisp
+++ b/test/5.elisp
@@ -67,3 +67,9 @@
(looking-at (let* ((x (list "u" "+" "v"))
(y (pop x)))
(string-join (append x (list y))))))
+
+(defun test-prog1 ()
+ (looking-at (prog1 "[UU]" "a" "b" "c")))
+
+(defun test-prog2 ()
+ (looking-at (prog2 "a" "[VV]" "b" "c")))
diff --git a/test/5.expected b/test/5.expected
index ed53589..d73b1be 100644
--- a/test/5.expected
+++ b/test/5.expected
@@ -31,3 +31,9 @@
5.elisp:67:15: In call to looking-at: Unescaped literal `+' (pos 0)
"+vu"
^
+5.elisp:72:15: In call to looking-at: Duplicated `U' inside character
alternative (pos 2)
+ "[UU]"
+ ..^
+5.elisp:75:15: In call to looking-at: Duplicated `V' inside character
alternative (pos 2)
+ "[VV]"
+ ..^
- [elpa] externals/relint b2a86b8 04/23: Fix typo in message description and clarify, (continued)
- [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
- [elpa] externals/relint 02c5dd2 13/23: Prepare for easier testability, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 60d5627 21/23: Lazy evaluation of global variables, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint b0f0bee 23/23: Increment version to 1.11, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 501f87b 20/23: Evaluate `prog1' and `prog2',
Mattias Engdegård <=
- [elpa] externals/relint 6212b6f 22/23: Evaluate more functions and macros, Mattias Engdegård, 2019/09/29
- [elpa] externals/relint 7e6b8bf 14/23: Add tests, Mattias Engdegård, 2019/09/29