]> git.eshelyaron.com Git - emacs.git/commitdiff
Make the 'cucumber' compilation pattern work without 'omake'
authorMattias Engdegård <mattiase@acm.org>
Tue, 24 Nov 2020 11:05:47 +0000 (12:05 +0100)
committerMattias Engdegård <mattiase@acm.org>
Fri, 27 Nov 2020 15:17:19 +0000 (16:17 +0100)
When 'omake' is included in compilation-error-regexp-alist, which it
still is by default, then all other rules are modified to match with
an extra leading 6 spaces as well. The 'cucumber' pattern relied on
this in order to work as intended.

* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
Extend the 'cucumber' pattern so that it works even when 'omake'
is not included.  Move it below the 'gnu' rule so that it doesn't
match anything else.

lisp/progmodes/compile.el
test/lisp/progmodes/compile-tests.el

index de9c9a209d1bee30de4f68356a5ea25fdd2b6cae..787f5d5ef306f3c55ce94d38219cf20f85ce34dd 100644 (file)
@@ -214,10 +214,6 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
      "^\"\\([^,\" \n\t]+\\)\", line \\([0-9]+\\)\
 \\(?:[(. pos]+\\([0-9]+\\))?\\)?[:.,; (-]\\( warning:\\|[-0-9 ]*(W)\\)?" 1 2 3 (4))
 
-    (cucumber
-     "\\(?:^cucumber\\(?: -p [^[:space:]]+\\)?\\|#\\)\
-\\(?: \\)\\([^(].*\\):\\([1-9][0-9]*\\)" 1 2)
-
     (msft
      ;; Must be before edg-1, so that MSVC's longer messages are
      ;; considered before EDG.
@@ -399,6 +395,17 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
           (regexp "[0-9][0-9][0-9]")))
      1 (2 . 4) (3 . 5) (6 . 7))
 
+    (cucumber
+     ,(rx (| (: bol
+                (| (: "cucumber" (? " -p " (+ (not space))))
+                   "     "))
+             "#")
+          " "
+          (group (not "(") (* nonl))          ; file
+          ":"
+          (group (in "1-9") (* (in "0-9"))))  ; line
+     1 2)
+
     (lcc
      "^\\(?:E\\|\\(W\\)\\), \\([^(\n]+\\)(\\([0-9]+\\),[ \t]*\\([0-9]+\\)"
      2 3 4 (1))
index 0288cba789e54ab30ea209e73a9668e8f035ff57..74d7c7682e1ed23c2398c2a49084279cba354cdf 100644 (file)
     ;; cucumber
     (cucumber "Scenario: undefined step  # features/cucumber.feature:3"
      29 nil 3 "features/cucumber.feature")
+    ;; This rule is actually handled by the `cucumber' pattern but when
+    ;; `omake' is included, then `gnu' matches it first.
     (gnu "      /home/gusev/.rvm/foo/bar.rb:500:in `_wrap_assertion'"
      1 nil 500 "/home/gusev/.rvm/foo/bar.rb")
     ;; edg-1 edg-2