branch: elpa/d-mode
commit fbd1f8bcf9918c9395f3ac430e9638231e5a61c9
Merge: 322250a 5c06e99
Author: Russel Winder <[email protected]>
Commit: Russel Winder <[email protected]>
Merge pull request #44 from snosov1/master
add d-exceptions compilation error regexp
We've taken a view, we can always revert if need be.
---
d-mode.el | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/d-mode.el b/d-mode.el
index 2c6c2ff..22cbc34 100644
--- a/d-mode.el
+++ b/d-mode.el
@@ -173,20 +173,27 @@ operators."
;;; Patterns to recognize the compiler generated messages
-;; The following recognizes messages generated by the LDC compiler.
-;; Subexpression 1 is the filename, 2 is the line number, nil is the
+;; The following regexp recognizes messages generated by the LDC and DMD
+;; compilers. Subexpression 1 is the filename, 2 is the line number, nil is
the
;; column, because it's not present in the LDC error messages, and the
-;; subexpressions 3 and 4 are the message type -- error, warning, or
-;; info. To enable, add ldc symbol to compilation-error-regexp-alist
+;; subexpressions 3 and 4 are the message type -- error, warning, or info.
-;; GDC messages are probably recognized by gnu symbol already listed
-;; in compilation-error-regexp-alist. The patterns for messages
-;; generated by DMD can be added in another similar call
-;; (add-to-list 'compilation-error-regexp-alist-alist '(dmd ...
+;; GDC messages are recognized by gnu symbol already listed in
+;; compilation-error-regexp-alist.
(add-to-list 'compilation-error-regexp-alist-alist
'(ldc
"^\\([^: \n]+\\)(\\([0-9]+\\)): \\(?:
*\\(?3:\\(?:W\\(?::\\|arning\\)\\|warning\\)\\)\\|
*\\(?4:[Ii]nfo\\(?:\\>\\|rmationa?l?\\)\\|I:\\|\\[ skipping \\.+
]\\|instantiated from\\|required from\\|[Nn]ote\\)\\| *\\(?:[Ee]rror\\)\\)"
1 2 nil (3 . 4)))
+(add-to-list 'compilation-error-regexp-alist 'ldc)
+
+;; The following regexp recognizes messages generated by the D runtime for
+;; unhandled exceptions (e.g. assert failures).
+
+(add-to-list 'compilation-error-regexp-alist-alist
+ '(d-exceptions
+ "^[^@]*?@\\(.*?\\)(\\([0-9]+\\)):"
+ 1 2 nil 2))
+(add-to-list 'compilation-error-regexp-alist 'd-exceptions)
;;----------------------------------------------------------------------------