[Geany-Users] 'Error regular expression' feature?

Lex Trotman elextr at xxxxx
Wed Aug 7 10:53:34 UTC 2013


On 7 August 2013 20:23, Vitali Samurov <vitali.s at elisanet.fi> wrote:

> Hello,
>
> oh. So, the compiler output should look like e.g. GCC outputs, which Geany
> does parse well?
>

Well, certainly gcc outputs have been used most :)

It would be the best course to use that if your compiler can be configured
to produce it.  If it is a very good copy of gcc it may work with the
built-in decoding and no regex will be needed.

But for example the regex can be used with Python output like

SyntaxError: ('invalid syntax', ('untitled.py', 28, 5, '\tfor:\n'))

can also be parsed because it has the filename untitled.py and line number
28 in the output.

The requirement for each line to have both is because compilers like C or
C++ can interleave error messages from included headers with errors from
the .c file so each line must be fully identified to allow marking in the
source file.

Cheers
Lex



>
> mkl2mkp_en-0.25.c:3211:11: error: 'comp_adres' undeclared (first use in
> this function)
>
> Br,
> Vitali
>
> Lex Trotman [elextr at gmail.com] kirjoitti:
>
>> On 7 August 2013 18:38, Vitali Samurov <vitali.s at elisanet.fi> wrote:
>>
>> > Hello,
>> >
>> > I'm trying to add a new compiler toolchain in Geany and would like to
>> > highlight an error (waring) line in the code by using 'Error regular
>> > expression' feature.
>> >
>> > I have added this:
>> > (.+)\line\s+([0-9]+)
>> >
>> > And was able to get line 'E011 The value of symbolic....' colored in
>> RED:
>> >
>> > /mkl2mkp_en -i "DIYGeigerCounter_ver_1-3.mkl" (in directory: /../Temp)
>> > MKP file  DIYGeigerCounter_ver_1-3.mkl
>> > E011 The value of symbolic reference is not defined  in line  77 -
>> RECEIVE1
>> > First page:  0
>> > Length (pages):  6
>> > Compilation failed.
>> >
>> >
>> > But editor does not show /highlight the line in edit window. Is it
>> > possible to do that?
>> >
>>
>> Yes, but the regular expression has to have two captures, one that
>> extracts
>> the line number and one that extracts the filename so it knows which file
>> and which line. And the filename and line no must be in the same line in
>> your compiler output.  That does not appear to be the case in the output
>> above (but it may simply be wrapped by the mailer).
>>
>>
>> Cheers
>> Lex
>>
>>
>> >
>> > Br,
>> > Vitali
>> >
>> >
>> >
>> >
>> > --
>> >
>> > --- Sent from the web-mail ---
>> >
>> >
>> >
>> > ______________________________****_________________
>> > Users mailing list
>> > Users at lists.geany.org
>> > https://lists.geany.org/cgi-****bin/mailman/listinfo/users<https://lists.geany.org/cgi-**bin/mailman/listinfo/users>
>> <htt**ps://lists.geany.org/cgi-bin/**mailman/listinfo/users<https://lists.geany.org/cgi-bin/mailman/listinfo/users>
>> >
>>
>> >
>>
>> ______________________________**_________________
>> Users mailing list
>> Users at lists.geany.org
>> https://lists.geany.org/cgi-**bin/mailman/listinfo/users<https://lists.geany.org/cgi-bin/mailman/listinfo/users>
>>
>>
> --
>
> --- Sent from the web-mail ---
>
>
>
> ______________________________**_________________
> Users mailing list
> Users at lists.geany.org
> https://lists.geany.org/cgi-**bin/mailman/listinfo/users<https://lists.geany.org/cgi-bin/mailman/listinfo/users>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geany.org/pipermail/users/attachments/20130807/f5058507/attachment.html>


More information about the Users mailing list