[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/tuareg 64fada7 01/10: Rewrite `tuareg--error-regexp` in rx
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/tuareg 64fada7 01/10: Rewrite `tuareg--error-regexp` in rx |
Date: |
Fri, 30 Jul 2021 16:57:26 -0400 (EDT) |
branch: elpa/tuareg
commit 64fada7f1abbcc78359155a0ab4640e6b0fef0f6
Author: Mattias EngdegÄrd <mattiase@acm.org>
Commit: Mattias EngdegÄrd <mattiase@acm.org>
Rewrite `tuareg--error-regexp` in rx
Much more readable and maintainable. The regexp remains unchanged;
mechanised conversion to rx guarantees equivalence.
---
tuareg.el | 32 +++++++++++++++++++++++++++-----
1 file changed, 27 insertions(+), 5 deletions(-)
diff --git a/tuareg.el b/tuareg.el
index f8ecab0..8cf560c 100644
--- a/tuareg.el
+++ b/tuareg.el
@@ -3149,11 +3149,33 @@ Short cuts for interactions with the REPL:
;; the language is not English. Hence we add a regexp.
(defconst tuareg--error-regexp
- "^ *\\(File \\(\"?\\)\\([^,\" \n\t<>]+\\)\\2, \
-lines? \\([0-9]+\\)-?\\([0-9]+\\)?\
-\\(?:, characters? \\([0-9]+\\)-?\\([0-9]+\\)?\\)?:\\)\
-\\(?:\n[ \t]*\\(?:\\(?:[0-9]+ | .*\\|\\^+\\)\n[ \t]*\\)*\
-\\(Warning\\(?: [0-9]+\\)?\\):\\)?"
+ (rx bol
+ (* " ")
+ (group ; 1: HIGHLIGHT
+ "File "
+ (group (? "\"")) ; 2
+ (group (+ (not (in "\t\n \",<>")))) ; 3: FILE
+ (backref 2)
+ ", line" (? "s") " "
+ (group (+ (in "0-9"))) ; 4: LINE-START
+ (? "-")
+ (? (group (+ (in "0-9")))) ; 5; LINE-END
+ (? ", character" (? "s") " "
+ (group (+ (in "0-9"))) ; 6: COL-START
+ (? "-")
+ (? (group (+ (in "0-9"))))) ; 7: COL-END
+ ":")
+ (? "\n"
+ (* (in "\t "))
+ (* (or (seq (+ (in "0-9"))
+ " | "
+ (* nonl))
+ (+ "^"))
+ "\n"
+ (* (in "\t ")))
+ (group "Warning" ; 8: WARNING
+ (? " " (+ (in "0-9"))))
+ ":"))
"Regular expression matching the error messages produced by
ocamlc/ocamlopt.")
(when (boundp 'compilation-error-regexp-alist-alist)
- [nongnu] elpa/tuareg updated (b59c422 -> 465b61f), ELPA Syncer, 2021/07/30
- [nongnu] elpa/tuareg 64fada7 01/10: Rewrite `tuareg--error-regexp` in rx,
ELPA Syncer <=
- [nongnu] elpa/tuareg b4d09cd 03/10: Remove duplicates from compilation-error-regexp-alist{-alist}, ELPA Syncer, 2021/07/30
- [nongnu] elpa/tuareg 8c8d217 05/10: Simpler matching of ending line and character in compiler message, ELPA Syncer, 2021/07/30
- [nongnu] elpa/tuareg c6c49d4 08/10: Compensate for end-columns in OCaml messages being off by one, ELPA Syncer, 2021/07/30
- [nongnu] elpa/tuareg a06468c 09/10: Repair handling of ocamldoc section headers like {2:text}, ELPA Syncer, 2021/07/30
- [nongnu] elpa/tuareg 465b61f 10/10: Merge commit 'refs/pull/258/head' of github.com:/ocaml/tuareg into elpa/tuareg, ELPA Syncer, 2021/07/30
- [nongnu] elpa/tuareg 00c4cf8 06/10: Match source locations in exception backtraces, ELPA Syncer, 2021/07/30
- [nongnu] elpa/tuareg 0f49e65 02/10: Only fontify known @-tags in doc-markup face, ELPA Syncer, 2021/07/30
- [nongnu] elpa/tuareg aa57258 04/10: Recognise new warning format in compilation output, ELPA Syncer, 2021/07/30
- [nongnu] elpa/tuareg 916c551 07/10: Add ERT test of compilation and backtrace messages, ELPA Syncer, 2021/07/30