Release: 0.4.6
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEABECAAYFAl8L0BwACgkQ5+GdyTDsrJsFVQCdGz0i4KXwrnqcQC7Ov5/b+YSH lUEAoIJBRRJ462lJbe4nzkOkrB3VMIGF =JOpa -----END PGP SIGNATURE----- Merge: 0.4.6
This commit is contained in:
commit
6633dbb276
3 changed files with 94 additions and 58 deletions
17
org-ql.el
17
org-ql.el
|
|
@ -1671,6 +1671,21 @@ element should be a regexp string."
|
|||
(defvar peg-errors nil)
|
||||
(defvar peg-stack nil)
|
||||
|
||||
(defmacro org-ql--peg-parse-string (rules string &optional noerror)
|
||||
"Parse STRING according to RULES.
|
||||
If NOERROR is non-nil, push nil resp. t if the parse failed
|
||||
resp. succeded instead of signaling an error."
|
||||
;; Unfortunately, this macro was moved to peg-tests.el, so we copy it here.
|
||||
`(with-temp-buffer
|
||||
(insert ,string)
|
||||
(goto-char (point-min))
|
||||
,(if noerror
|
||||
(let ((entry (make-symbol "entry"))
|
||||
(start (caar rules)))
|
||||
`(peg-parse (entry (or (and ,start `(-- t)) ""))
|
||||
. ,rules))
|
||||
`(peg-parse . ,rules))))
|
||||
|
||||
(cl-eval-when (compile load eval)
|
||||
;; This `eval-when' is necessary, otherwise the macro does not define
|
||||
;; the function correctly, apparently because `org-ql-predicates'
|
||||
|
|
@ -1697,7 +1712,7 @@ Builds the PEG expression using predicates defined in
|
|||
"Return query parsed from plain query string INPUT.
|
||||
Multiple predicates are combined with BOOLEAN."
|
||||
(unless (s-blank-str? input)
|
||||
(let* ((query (peg-parse-string
|
||||
(let* ((query (org-ql--peg-parse-string
|
||||
((query (+ term
|
||||
(opt (+ (syntax-class whitespace) (any)))))
|
||||
(term (or (and negation (list positive-term)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue