[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master a45d8f4 03/60: Error propagation to pl-until
From: |
Junpeng Qiu |
Subject: |
[elpa] master a45d8f4 03/60: Error propagation to pl-until |
Date: |
Tue, 25 Oct 2016 17:45:12 +0000 (UTC) |
branch: master
commit a45d8f4b01c3d7bcca6d536943ed987fc79018fa
Author: Junpeng Qiu <address@hidden>
Commit: Junpeng Qiu <address@hidden>
Error propagation to pl-until
---
parsec.el | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/parsec.el b/parsec.el
index 01f2309..1b52e22 100644
--- a/parsec.el
+++ b/parsec.el
@@ -100,13 +100,17 @@
(defalias 'pl-parse 'pl-try)
(defmacro pl-until (parser &optional &key skip)
- `(catch 'done
- (while (not (eobp))
- (catch 'failed
- (throw 'done ,parser))
- ,(if skip
- `(,skip 1)
- `(forward-char 1)))))
+ (let ((error-sym (make-symbol "error-message")))
+ `(let (,error-sym)
+ (catch 'done
+ (while (not (eobp))
+ (when (setq ,error-sym
+ (catch 'failed
+ (throw 'done ,parser)))
+ (error ,error-sym))
+ ,(if skip
+ `(,skip 1)
+ `(forward-char 1)))))))
(defmacro pl-many (parser)
(let ((res (make-symbol "results"))
- [elpa] master a268b9f 08/60: Add more APIs, (continued)
- [elpa] master a268b9f 08/60: Add more APIs, Junpeng Qiu, 2016/10/25
- [elpa] master 13637e1 15/60: Rename parsec-do-parse to parsec-with-input, Junpeng Qiu, 2016/10/25
- [elpa] master ba23b01 19/60: Add more APIs, Junpeng Qiu, 2016/10/25
- [elpa] master f3ce070 09/60: Add simple scheme parser, Junpeng Qiu, 2016/10/25
- [elpa] master 9bc1d77 28/60: Move examples to under sub-directory, Junpeng Qiu, 2016/10/25
- [elpa] master 52f1886 33/60: Update pjson, Junpeng Qiu, 2016/10/25
- [elpa] master 7e65db0 51/60: Merge pull request #1 from tarsius/master, Junpeng Qiu, 2016/10/25
- [elpa] master 311a5ca 49/60: Fix typo, Junpeng Qiu, 2016/10/25
- [elpa] master e6d5f38 46/60: Update the comment in source file, Junpeng Qiu, 2016/10/25
- [elpa] master 8c22dcb 39/60: Add :group example, Junpeng Qiu, 2016/10/25
- [elpa] master a45d8f4 03/60: Error propagation to pl-until,
Junpeng Qiu <=