Sublime Forum

Regex for building system

#1

Hi
I’m trying to figure how to handle a compiler output in which the order of the error information is not in the order that ST is expecting, i.e. file name, line number, column number and error message).
I fount a perl expression that parse correctly the compiler output, but it feeds the line number before the file name.
Is there a directive that specify the actual order ?

*** ERROR C202 IN LINE 109 OF test.c: ‘xxyy’: undefined identifier

0 Likes

#2

It seems impossible that anyone has had this problem so far.
Perhaps I have not explained it well.

If a compiler outputs errors in this form:
**** ERROR C202 IN LINE 109 OF test.c: ‘xxyy’: undefined identifier*
the perl expression
*** (?:WARNING|ERROR).IN LINE (\d+) OF (\w.]+): (.)$
returns 3 fields: “109”, “test.c” and “‘xxyy’: undefined identifier
Using this expression in the “line_regex” directive in the sublime-build file, the editor gets confused because it receives the first two parameters swapped over (line number instead of file name and vice versa).

Is there a way to change the order of the parameters (either in the perl expression or in the configuration of ST ?

Thank you.

0 Likes

Can you programmatically handle build system regex parsing?