I have modified compiler to output file and line, and Geany was able to highlight the line with default regex. Thanks!
Sent from my Nokia Lumia 920
-----Original Message----- From: "Lex Trotman" elextr@gmail.com Sent: 7.8.2013 13:54 To: "Geany general discussion list" users@lists.geany.org Subject: Re: [Geany-Users] 'Error regular expression' feature?
On 7 August 2013 20:23, Vitali Samurov vitali.s@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@gmail.com] kirjoitti:
On 7 August 2013 18:38, Vitali Samurov vitali.s@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@lists.geany.org https://lists.geany.org/cgi-**bin/mailman/listinfo/usershttps://lists.geany.org/cgi-bin/mailman/listinfo/users
_______________________________________________ Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users