[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/d-mode aba7187 117/346: Merge pull request #69 from CyberS
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/d-mode aba7187 117/346: Merge pull request #69 from CyberShadow/pull-20160611-224824 |
Date: |
Sun, 29 Aug 2021 11:00:14 -0400 (EDT) |
branch: elpa/d-mode
commit aba7187b1f8e51f3e97b7e30b55e09322e835941
Merge: a564656 e9278a9
Author: Vladimir Panteleev <github.private@thecybershadow.net>
Commit: GitHub <noreply@github.com>
Merge pull request #69 from CyberShadow/pull-20160611-224824
Reimplement compilation-mode error message detection for DMD
---
d-mode.el | 44 ++++++++++++++++++++++++++++++++------------
tests/I0069.txt | 7 +++++++
2 files changed, 39 insertions(+), 12 deletions(-)
diff --git a/d-mode.el b/d-mode.el
index 6958637..4af9cec 100644
--- a/d-mode.el
+++ b/d-mode.el
@@ -75,6 +75,9 @@
;; The set-difference function is used from the Common Lisp extensions.
(require 'cl)
+;; Used to specify regular expressions in a sane way.
+(require 'rx)
+
;; These are only required at compile time to get the sources for the
;; language constants. (The cc-fonts require and the font-lock
;; related constants could additionally be put inside an
@@ -184,18 +187,35 @@ operators."
;;; Patterns to recognize the compiler generated messages
-;; 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.
-
-;; 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\\)\\|
*Deprecation\\)"
- 1 2 nil (3 . 4)))
-(add-to-list 'compilation-error-regexp-alist 'ldc)
+(defun d-mode-add-dmd-message-pattern (expr level symbol)
+ "Register DMD `compile' pattern for an error level.
+
+EXPR is the `rx' message sub-expression indicating the error level LEVEL.
+The expression is added to `compilation-error-regexp-alist' and
+`compilation-error-regexp-alist-alist' as SYMBOL."
+ (add-to-list
+ 'compilation-error-regexp-alist-alist
+ `(,symbol
+ ,(rx-form
+ `(and
+ line-start
+ (group-n 1 (one-or-more any)) ; File name
+ "("
+ (group-n 2 (one-or-more digit)) ; Line number
+ (zero-or-one
+ ","
+ (group-n 3 (one-or-more digit))) ; Column number
+ "): "
+ ,expr
+ (group-n 4 (one-or-more nonl)) ; Message
+ line-end))
+ 1 2 3 ,level 4))
+ (add-to-list 'compilation-error-regexp-alist symbol))
+
+(d-mode-add-dmd-message-pattern "Error: " 2 'dmd-error )
+(d-mode-add-dmd-message-pattern "Warning: " 1 'dmd-warning )
+(d-mode-add-dmd-message-pattern "Deprecation: " 1 'dmd-deprecation )
+(d-mode-add-dmd-message-pattern '(one-or-more " ") 0 'dmd-continuation)
;; The following regexp recognizes messages generated by the D runtime for
;; unhandled exceptions (e.g. assert failures).
diff --git a/tests/I0069.txt b/tests/I0069.txt
new file mode 100644
index 0000000..39cee45
--- /dev/null
+++ b/tests/I0069.txt
@@ -0,0 +1,7 @@
+-*-compilation-*-
+
+foo.d(1): Error: Test error
+foo.d(1,1): Error: Column number test
+baz.d(3,4): instantiated from here: Continuation test
+bar.d(2,1): Warning: Test warning
+quux.d(3): Deprecation: Test deprecation
- [nongnu] elpa/d-mode 322250a 088/346: Merge pull request #46 from dmakarov/testing, (continued)
- [nongnu] elpa/d-mode 322250a 088/346: Merge pull request #46 from dmakarov/testing, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode ed4ae58 086/346: Add MELPA badge., ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 2682220 091/346: Merge branch 'dmakarov-master', ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 11cda40 093/346: Merge pull request #48 from dmakarov/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 9a89656 102/346: Merge pull request #61 from CyberShadow/pull-20160327-114822, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 7d4d637 101/346: Merge pull request #57 from MartinNowak/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 829e54f 104/346: Merge pull request #63 from CyberShadow/pull-20160328-152643, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 71ab5eb 111/346: Update comments, and rolling release date/time. Add a tag to get a stable release., ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 8d9be09 107/346: Correct README, as per Issue #66., ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode a967acd 113/346: Correct d-exceptions regexp, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode aba7187 117/346: Merge pull request #69 from CyberShadow/pull-20160611-224824,
ELPA Syncer <=
- [nongnu] elpa/d-mode 38127d8 125/346: README: Don't use testing branch in shield URLs, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 03cd06c 130/346: tests: Add imenu test for 72d2022b606c1ce72bc3e09ecd0679fa057d9496, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 3e5a5d5 131/346: tests: Add test case for pull request #35, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode be57907 132/346: tests: Make do-one-test never throw, always return nil/t, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 441b866 134/346: tests: Actually test indentation for issue #39, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode baf1669 138/346: tests: Add tests for issue #26., ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode e81e5f7 147/346: Register our syntax-propertize-function before calling c-common-init, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 739a31e 160/346: Fix imenu for functions with line comments before the body, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode e64d5fc 169/346: .travis.yml: Update with emacs-travis compatibility updates, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode b5d936d 178/346: Fix imenu hang with unterminated function declaration, ELPA Syncer, 2021/08/29