[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/annotate 9ea6c4fc71 247/372: - signalled errors when query
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/annotate 9ea6c4fc71 247/372: - signalled errors when query parsing errors occurs. |
Date: |
Fri, 4 Feb 2022 16:59:04 -0500 (EST) |
branch: elpa/annotate
commit 9ea6c4fc718099ec4ae00c873326c212d574b246
Author: cage <cage-invalid@invalid>
Commit: cage <cage-invalid@invalid>
- signalled errors when query parsing errors occurs.
---
annotate.el | 30 ++++++++++++++++++------------
1 file changed, 18 insertions(+), 12 deletions(-)
diff --git a/annotate.el b/annotate.el
index 57452afd6d..720eadeae7 100644
--- a/annotate.el
+++ b/annotate.el
@@ -263,6 +263,10 @@ annotation as defined in the database."
"Error: the region overlaps with at least an already existing annotation"
'annotate-error)
+(define-error 'annotate-query-parsing-error
+ "Parsing failed:"
+ 'annotate-error)
+
(defun annotate-annotations-exist-p ()
"Does this buffer contains at least one or more annotations?"
(cl-find-if 'annotationp
@@ -2251,10 +2255,11 @@ Arguments:
(annotate-summary-query-lexer-string look-ahead)))
(cond
((not (cl-find look-ahead-symbol
'(and or close-par)))
- (error (format (concat "Expecting
for operator "
- "('and' or
'or') or \")\". "
- "found %S
instead")
- look-ahead-string)))
+ (signal
'annotate-query-parsing-error
+ (format (concat "Expecting
for operator "
+ "('and' or
'or') or \")\". "
+ "found %S
instead")
+
look-ahead-string)))
(t
;; found operator, recurse to
search for rhs of rule
;; NOTE OPERATOR NOTE
@@ -2281,7 +2286,7 @@ Arguments:
(when (or (annotate-summary-query-parse-end-input-p
maybe-close-parens)
(not (eq (annotate-summary-query-lexer-symbol
maybe-close-parens)
'close-par)))
- (error "Unmatched parens"))
+ (signal 'annotate-query-parsing-error "Unmatched parens"))
;; continue parsing
(annotate-summary-query-parse-note filter-fn annotation
matchp))) ; recurse
((token-symbol-match-p 'not look-ahead)
@@ -2295,7 +2300,7 @@ Arguments:
;; because, according to the grammar, after a NOT a
;; NOTE is non optional
(if (eq :error res)
- (error "No more input after 'not'")
+ (signal 'annotate-query-parsing-error "No more input after
'not'")
;; if the last rule (saved in res) is not nil (and
;; is not :error) return nil, return the last
;; annotation otherwise remember that the user asked
@@ -2310,7 +2315,7 @@ Arguments:
(let ((lhs res) ; the left side of this rule lhs AND rhs
(rhs (annotate-summary-query-parse-note filter-fn
annotation :error))) ; recurse
(if (eq :error rhs) ; see the 'not' operator above
- (error "No more input after 'and'")
+ (signal 'annotate-query-parsing-error "No more input after
'and'")
(and lhs rhs)))) ; both rules must match as this is a logic
and
;; trying to match the rule:
;; NOTE := NOTE OR NOTE
@@ -2319,7 +2324,7 @@ Arguments:
(let ((lhs res) ; the left side of this rule (lhs OR
rhs)
(rhs (annotate-summary-query-parse-note filter-fn
annotation :error))) ; recurse
(if (eq :error rhs)
- (error "No more input after 'or'")
+ (signal 'annotate-query-parsing-error "No more input after
'or'")
(or lhs rhs)))) ; either lhs or rhs match as this is a logic
or
((token-symbol-match-p 'escaped-re look-ahead)
;; here we match the rule:
@@ -2421,7 +2426,7 @@ Note: this function return the annotation part of the
record, see
;; according to the rule we are trying to match:
;; EXPRESSION := FILE-MASK OR NOTE
(if (annotate-summary-query-parse-end-input-p look-ahead)
- (error "No more input after 'or'")
+ (signal 'annotate-query-parsing-error "No more input
after 'or'")
(progn
;; copy the string for note parsing note
;; that annotate-summary-query only contains
@@ -2443,7 +2448,7 @@ Note: this function return the annotation part of the
record, see
;; according to the rule we are trying to match:
;; EXPRESSION := FILE-MASK AND NOTE
(if (annotate-summary-query-parse-end-input-p look-ahead)
- (error "No more input after 'and'")
+ (signal 'annotate-query-parsing-error "No more input
after 'and'")
(progn
;; copy the string for note parsing note
;; that annotate-summary-query only contains
@@ -2460,8 +2465,9 @@ Note: this function return the annotation part of the
record, see
(t
;; there is something after the file-mask in the
;; input but it is not an operator
- (error (format "Unknown operator: %s is not in '(and, or)"
- (annotate-summary-query-lexer-string
operator-token)))))))))))))
+ (signal 'annotate-query-parsing-error
+ (format "Unknown operator: %s is not in '(and, or)"
+ (annotate-summary-query-lexer-string
operator-token)))))))))))))
(defun annotate-summary-filter-db (annotations-dump query)
"Filter an annotation database with a query.
- [nongnu] elpa/annotate ec0ed147a2 170/372: - fixed error for regexp search in 'annotate--font-lock-matcher', (continued)
- [nongnu] elpa/annotate ec0ed147a2 170/372: - fixed error for regexp search in 'annotate--font-lock-matcher', ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 1525550f85 182/372: - changed test for annotation rejection and removed (maybe) useless check., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 2e858729cb 200/372: - saving annotations with newlines seems to works;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 31e3c24726 195/372: - updated version and documentation, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate e933d84692 214/372: - fixed removing of annotation in 'annotate-before-change-fn', ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate e03edfb2c2 218/372: - increased version number;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate e2c365a376 222/372: - added reference to the issue., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 44b378b16a 219/372: Merge pull request #62 from cage2/master, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate f0a71bb148 223/372: Merge pull request #64 from cage2/fix-face-detection, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 8ac52808e8 226/372: - added a couple of functions to allow an user to change the file that, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 9ea6c4fc71 247/372: - signalled errors when query parsing errors occurs.,
ELPA Syncer <=
- [nongnu] elpa/annotate cc0b5da6c1 229/372: Merge pull request #69 from cage2/switch-database, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 914c9ee5b9 264/372: Fixed a regression and some bugs related to incorrect calculation of, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 0b71184865 269/372: - updated changelog., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 3b4ee73c8d 275/372: - stored abbreviated filenames for the path component of each record, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate c4a56cc33d 306/372: - added missing argument to 'annotate-create-annotation'., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 9fc6d7a839 311/372: - allowed deleting of annotations for info files., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 54ac759fac 315/372: Merge pull request #99 from cage2/remove-some-compilation-warnings, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 4ae1d4f2a6 346/372: Merge pull request #112 from cage2/clean-style, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 8471cdaa7c 328/372: - updated Changelog., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 0e5ccfdb4e 326/372: - replaced 'if' with 'when' when no 'else' branch exists., ELPA Syncer, 2022/02/04