[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/tuareg 00c4cf8 06/10: Match source locations in exception
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/tuareg 00c4cf8 06/10: Match source locations in exception backtraces |
Date: |
Fri, 30 Jul 2021 16:57:27 -0400 (EDT) |
branch: elpa/tuareg
commit 00c4cf8a233a8d1cd27563edf9a2625a8b1c9e12
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>
Match source locations in exception backtraces
We overload the compilation error regexp for this purpose since the
formats are almost the same.
---
compilation.txt | 28 ++++++++++++++++++++++++++++
tuareg.el | 15 ++++++++++++---
2 files changed, 40 insertions(+), 3 deletions(-)
diff --git a/compilation.txt b/compilation.txt
index 7350995..736066d 100644
--- a/compilation.txt
+++ b/compilation.txt
@@ -120,3 +120,31 @@ File "moo.ml", line 6, characters 6-10:
6 | let fish = 13 in
^^^^
Warning 26 [unused-var]: unused variable fish.
+
+
+* Backtrace messages
+
+Before 4.11:
+
+OCAMLRUNPARAM=b ./bad
+Fatal error: exception Bad.Disaster("oh no!")
+Raised at file "bad.ml", line 5, characters 4-22
+Called from file "bad.ml" (inlined), line 9, characters 2-5
+Called from file "bad.ml", line 12, characters 8-18
+
+4.11 and later:
+
+OCAMLRUNPARAM=b ./bad
+Fatal error: exception Bad.Disaster("oh no!")
+Raised at Bad.f in file "bad.ml", line 5, characters 4-22
+Called from Bad.g in file "bad.ml" (inlined), line 9, characters 2-5
+Called from Bad in file "bad.ml", line 12, characters 8-18
+
+OCAMLRUNPARAM=b ./bad
+Fatal error: exception Sys_error("non.existing.file: No such file or
directory")
+Raised by primitive operation at Stdlib.open_in_gen in file "stdlib.ml", line
399, characters 28-54
+Called from Bad.h in file "bad.ml", line 7, characters 13-40
+Called from Bad.f in file "bad.ml", line 13, characters 4-7
+Re-raised at Bad.f in file "bad.ml", line 14, characters 12-19
+Called from Bad.g in file "bad.ml", line 17, characters 2-5
+Called from Bad in file "bad.ml", line 20, characters 8-18
diff --git a/tuareg.el b/tuareg.el
index 18a5044..9e3b243 100644
--- a/tuareg.el
+++ b/tuareg.el
@@ -3152,17 +3152,25 @@ Short cuts for interactions with the REPL:
(rx bol
(* " ")
(group ; 1: HIGHLIGHT
- "File "
+ (or "File "
+ ;; Exception backtrace.
+ (seq
+ (or "Raised at" "Re-raised at" "Raised by primitive operation at"
+ "Called from")
+ (* nonl) ; OCaml ≥4.11: " FUNCTION in"
+ " file "))
(group (? "\"")) ; 2
(group (+ (not (in "\t\n \",<>")))) ; 3: FILE
(backref 2)
+ (? " (inlined)")
", 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
- ":")
+ ;; Colon not present in backtraces.
+ (? ":"))
(? "\n"
(* (in "\t "))
(* (or (seq (+ (in "0-9"))
@@ -3175,7 +3183,8 @@ Short cuts for interactions with the REPL:
(? " " (+ (in "0-9")))
(? " [" (+ (in "a-z0-9-")) "]")
":")))
- "Regular expression matching the error messages produced by
ocamlc/ocamlopt.")
+ "Regular expression matching the error messages produced by ocamlc/ocamlopt.
+Also matches source references in exception backtraces.")
(when (boundp 'compilation-error-regexp-alist-alist)
(setq 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, 2021/07/30
- [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 <=
- [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