errorformat help for compiler output

4 views
Skip to first unread message

David Fishburn

unread,
Nov 20, 2008, 9:04:01 PM11/20/08
to vim_use
I have the following output from a compiler:

Loading configuration file
C:\Programs\Adobe\FlexBuilder3\sdks\3.1.0\frameworks\flex-config.xml
C:\projects\flex\src\MMO.mxml(488): Error: Access of undefined
property debugFlexBuilderRun.

if( debugFlexBuilderRun ) {

C:\projects\flex\src\MMO.mxml(495): Error: Access of undefined
property lastFaultMessage.

if( now.time - lastFaultMessage.time > 60000 ) {

C:\projects\flex\src\MMO.mxml(498): Error: Access of undefined
property lastFaultMessage.

lastFaultMessage = now;

C:\projects\flex\src\MMO.mxml(501): Error: Access of undefined
property ServerMonitor.

ServerMonitor.webServerDown();


I came up with the following (which is invalid and doesn't work):
setlocal errorformat=
\%-GLoading\ configuration\ file,
\%f(%l):\ Error:\ %E%m%C%m%C%Z


\%-GLoading\ configuration\ file, (to get this line)
Loading configuration file
C:\Programs\Adobe\FlexBuilder3\sdks\3.1.0\frameworks\flex-config.xml

\%f(%l):\ Error:\ %E%m%C%m%C%Z (this to get the multiline error message):
---
C:\projects\flex\src\MMO.mxml(488): Error: Access of undefined
property debugFlexBuilderRun.

if( debugFlexBuilderRun ) {

---

Any suggestions.

Thanks,
Dave

Marc Weber

unread,
Nov 21, 2008, 6:35:53 PM11/21/08
to vim...@googlegroups.com
> Any suggestions.
Take it easy and just try to parse the lines actually containing the
file and line:

set efm=%f\(%l\):%m

and you're done

Marc

Ben Schmidt

unread,
Nov 21, 2008, 8:35:29 PM11/21/08
to vim...@googlegroups.com
> I have the following output from a compiler:
>
> Loading configuration file
> C:\Programs\Adobe\FlexBuilder3\sdks\3.1.0\frameworks\flex-config.xml
> C:\projects\flex\src\MMO.mxml(488): Error: Access of undefined
> property debugFlexBuilderRun.
>
> if( debugFlexBuilderRun ) {
>

I'm assuming there are five lines there:

- Loading configuration file
- Error: Access of undefined property ....
- Blank line
- Quoted source code
- Blank line

and that there are just a lot more because of mail software wrapping
stuff.

> I came up with the following (which is invalid and doesn't work):
> setlocal errorformat=
> \%-GLoading\ configuration\ file,
> \%f(%l):\ Error:\ %E%m%C%m%C%Z
>

> Any suggestions.

Perhaps:

setlocal errorformat=
\%-GLoading\ configuration\ file,

\%E%f(%l):\ \ Error:\ %m,
\%+C%.%#

To match the first line, you were spot on:
%-GLoading\ configuration\ file,

To match multiple line messages, you need a set of patterns, each
beginning with one of the uppercase multi-line converter things; you
don't combine them into a single pattern. So firstly you need something
to match the first line, like this (note that there are two spaces
before Error, which you didn't have in your pattern but which is in the
compiler output):
%E%f(%l):\ \ Error:\ %m,

Then you need to match the continuations of those lines, including for
empty lines, so the easiest way to do this is just to use the .* regexp
to match anything, plus mark it as a continuation to be included in the
message:
%+C%.%#

Ben.

David Fishburn

unread,
Nov 22, 2008, 3:46:20 PM11/22/08
to vim...@googlegroups.com
On Fri, Nov 21, 2008 at 6:35 PM, Marc Weber <marco-...@gmx.de> wrote:
>
>> Any suggestions.
> Take it easy and just try to parse the lines actually containing the
> file and line:
>
> set efm=%f\(%l\):%m

Yes, I had that originally but I didn't like how it did not encompass
the entire message.
Sorry, I should have mentioned that.

Thank you for the response.
Dave

David Fishburn

unread,
Nov 22, 2008, 3:55:29 PM11/22/08
to vim...@googlegroups.com
On Fri, Nov 21, 2008 at 8:35 PM, Ben Schmidt
<mail_ben...@yahoo.com.au> wrote:
>
>> I have the following output from a compiler:
>>
>> Loading configuration file
>> C:\Programs\Adobe\FlexBuilder3\sdks\3.1.0\frameworks\flex-config.xml
>> C:\projects\flex\src\MMO.mxml(488): Error: Access of undefined
>> property debugFlexBuilderRun.
>>
>> if( debugFlexBuilderRun ) {
>>
>
> I'm assuming there are five lines there:

Yes, you are correct.


> - Loading configuration file
> - Error: Access of undefined property ....
> - Blank line
> - Quoted source code
> - Blank line
>
> and that there are just a lot more because of mail software wrapping
> stuff.
>

> setlocal errorformat=
> \%-GLoading\ configuration\ file,
> \%E%f(%l):\ \ Error:\ %m,
> \%+C%.%#

Yes, that worked.

> Then you need to match the continuations of those lines, including for
> empty lines, so the easiest way to do this is just to use the .* regexp
> to match anything, plus mark it as a continuation to be included in the
> message:
> %+C%.%#

You said above is to use .*, yet you didn't use it in this line:
%+C%.%#

Are the * replaced by % when using errorformat?

Thanks very much.
Dave

Ben Schmidt

unread,
Nov 23, 2008, 6:18:38 AM11/23/08
to vim...@googlegroups.com
> You said above is to use .*, yet you didn't use it in this line:
> %+C%.%#
>
> Are the * replaced by % when using errorformat?

Close. The * is replaced by #, and all special regular expression stuff
has to be preceded by % in errorformat. So '%.' is '.' and '%#' is '*'.

:help errorformat | /Pattern

Cheers,

Ben.

Reply all
Reply to author
Forward
0 new messages