Add another format to parse compiler output.

This should take care of issue #5070.
master
mookid 2016-03-02 17:05:31 +01:00 committed by Nathan Moreau
parent c973f75799
commit 8cc438f9ea
1 changed files with 12 additions and 1 deletions

View File

@ -803,12 +803,18 @@ variable caml-mode-indentation."
;; Newer emacs versions support line/char ranges
;; We will adapt OCaml to output error messages in a compatible format.
;; In the meantime we add the new format here in addition to the old one.
;; In the meantime we add new formats here in addition to the old one.
(defconst caml-error-regexp-newstyle
(concat "^[ A-\377]+ \"\\([^\"\n]+\\)\", line \\([0-9]+\\),"
"char \\([0-9]+\\) to line \\([0-9]+\\), char \\([0-9]+\\):")
"Regular expression matching the error messages produced by ocamlc/ocamlopt.")
(defconst caml-error-regexp-new-newstyle
(concat "^[ A-\377]+ \"\\([^\"\n]+\\)\", line \\([0-9]+\\), "
"characters \\([0-9]+\\)-\\([0-9]+\\):")
"Regular expression matching the error messages produced by ocamlc/ocamlopt.")
(if (boundp 'compilation-error-regexp-alist)
(progn
(or (assoc caml-error-regexp
@ -820,6 +826,11 @@ variable caml-mode-indentation."
compilation-error-regexp-alist)
(setq compilation-error-regexp-alist
(cons (list caml-error-regexp-newstyle 1 '(2 . 4) '(3 . 5))
compilation-error-regexp-alist)))
(or (assoc caml-error-regexp-new-newstyle
compilation-error-regexp-alist)
(setq compilation-error-regexp-alist
(cons (list caml-error-regexp-new-newstyle 1 2 '(3 . 4))
compilation-error-regexp-alist)))))
;; A regexp to extract the range info