emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 6e25d61: Add support for parsing column numbers in Visual Studio


From: Stefan Monnier
Subject: master 6e25d61: Add support for parsing column numbers in Visual Studio messages
Date: Fri, 28 Aug 2020 14:46:07 -0400 (EDT)

branch: master
commit 6e25d615449733d12ef82940903f3fda6f8744dc
Author: Daniel Martín <mardani29@yahoo.es>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    Add support for parsing column numbers in Visual Studio messages
    
    * lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
    Extend regular expression to match optional column numbers.
    *
    test/lisp/progmodes/compile-tests.el (compile-tests--test-regexps-data):
    Add a test.
    * test/lisp/progmodes/compile-tests.el (compile-test-error-regexps):
    Update the total number of compilation errors in a test.
    * etc/compilation.txt: Update compilation.txt with the newly supported
    message format.
    * etc/NEWS: Advertise the feature.
---
 etc/NEWS                             | 3 +++
 etc/compilation.txt                  | 1 +
 lisp/progmodes/compile.el            | 4 ++--
 test/lisp/progmodes/compile-tests.el | 4 +++-
 4 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 658e2a3..ad63955 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -557,6 +557,9 @@ case-insensitive matching of messages when the old behavior 
is
 required, but the recommended solution is to use a correctly matching
 regexp instead.
 
+---
+*** Messages from Visual Studio that mention column numbers are now recognized.
+
 ** Hi Lock mode
 
 ---
diff --git a/etc/compilation.txt b/etc/compilation.txt
index 8f7e290..11aefc6 100644
--- a/etc/compilation.txt
+++ b/etc/compilation.txt
@@ -381,6 +381,7 @@ made it more strict about the error message that follows.
 keyboard handler.c(537) : warning C4005: 'min' : macro redefinition
 d:\tmp\test.c(23) : error C2143: syntax error : missing ';' before 'if'
 d:\tmp\test.c(1145) : see declaration of 'nsRefPtr'
+c:\tmp\test.cpp(101,11): error C4101: 'bias0123': unreferenced local variable 
[c:\tmp\project.vcxproj]
 1>test_main.cpp(29): error C2144: syntax error : 'int' should be preceded by 
';'
 1>test_main.cpp(29): error C4430: missing type specifier - int assumed. Note: 
C++ does not support default-int
 1>
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index a043bbc..731db0f 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -221,9 +221,9 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
      ;; considered before EDG.
      ;; The message may be a "warning", "error", or "fatal error" with
      ;; an error code, or "see declaration of" without an error code.
-     "^ *\\([0-9]+>\\)?\\(\\(?:[a-zA-Z]:\\)?[^ 
:(\t\n][^:(\t\n]*\\)(\\([0-9]+\\)) ?\
+     "^ *\\([0-9]+>\\)?\\(\\(?:[a-zA-Z]:\\)?[^ 
:(\t\n][^:(\t\n]*\\)(\\([0-9]+\\)\\(?:,\\([0-9]+\\)\\)?) ?\
 : \\(?:see declaration\\|\\(?:warnin\\(g\\)\\|[a-z ]+\\) C[0-9]+:\\)"
-     2 3 nil (4))
+     2 3 4 (5))
 
     (edg-1
      "^\\([^ \n]+\\)(\\([0-9]+\\)): 
\\(?:error\\|warnin\\(g\\)\\|remar\\(k\\)\\)"
diff --git a/test/lisp/progmodes/compile-tests.el 
b/test/lisp/progmodes/compile-tests.el
index d566e7d..819f2e7 100644
--- a/test/lisp/progmodes/compile-tests.el
+++ b/test/lisp/progmodes/compile-tests.el
@@ -267,6 +267,8 @@
      3 nil 29 "test_main.cpp")
     ("1>test_main.cpp(29): error C4430: missing type specifier - int assumed. 
Note: C++ does not support default-int"
      3 nil 29 "test_main.cpp")
+    ("C:\\tmp\\test.cpp(101,11): error C4101: 'bias0123': unreferenced local 
variable [C:\\tmp\\project.vcxproj]"
+     1 11 101 "C:\\tmp\\test.cpp")
     ;; watcom
     ("..\\src\\ctrl\\lister.c(109): Error! E1009: Expecting ';' but found '{'"
      1 nil 109 "..\\src\\ctrl\\lister.c")
@@ -434,7 +436,7 @@ The test data is in `compile-tests--test-regexps-data'."
           (compilation-num-warnings-found 0)
           (compilation-num-infos-found 0))
       (mapc #'compile--test-error-line compile-tests--test-regexps-data)
-      (should (eq compilation-num-errors-found 94))
+      (should (eq compilation-num-errors-found 95))
       (should (eq compilation-num-warnings-found 35))
       (should (eq compilation-num-infos-found 28)))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]