reason-mode
reason-mode copied to clipboard
Add support for -bs-super-errors compilation messages
This is more bucklescript related than reason related, but I don't know in which other package it could go. So proposing for inclusion here.
When compiling a bucklescript project, -bs-super-errors is enabled by default and can't be disabled. The messages that are printed in this mode are not parsed correctly by emacs in compilation mode.
To parse compilation messages, emacs is using the regexp that are stored in compilation-error-regexp-alist. I'd like to have the regexp to parse super errors messages included in reason-mode. I am not sure how to make sure that this regexp is added only once.
(add-to-list
'compilation-error-regexp-alist
'("^[ \t]*\\(?:We've found a bug for you!\\)?\\(?:Warning number \\([0-9]+\\)\\)?[\n ]*\\([^ ]+\\) +\\([0-9]+\\):\\([0-9]+\\)-?\\(?:\\([0-9]+\\):\\)?\\([0-9]+\\)?$"
2 (3 . 5) (4 . 6) 1))