Saturday, January 27, 2018

errorformat for make.gcc multiline output

I'd like to match the following output from gcc via make:

ric.c:1703:18: error: line one
line two
^~~~~~~~~~~~~~~~~~~~~~ line three (ignore)
line four (ignore)

Beside the standard file name, error type, line, and column information, the message should comprise of the text

line 1 line2

I tried the following errorformat expression:

set errorformat=%E%f:%l:%c:\ error:\ %m,
\%+C%\\(\ %#%\\)%\\@<=%.%#,
\%-Z\ %#%\\%^%~%#%.%#

which - in my understanding - should translate to

Start an error line => <file>:<line>:<column>: error <line_one>,
Include the continuation line => \( *\)\@<=.* // line two, skip whitespace
Finish the error line => *\^~*.*

However, only the first line of the error message is matched, and I receive the GVim error message "E33: No previous substitute regular expression", which stems from the %C pattern.

I think, I don't see the wood because of the trees...

Help greatly appreciated.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: