Sublime Forum

Problem with line_regex

#1

I’m using a compiler whose error message turns out to be
“*** ERROR C202 IN LINE 29 OF E:\WORKFILES\MCU\SOURCES\PWM\MAIN.C: ‘a’: undefined identifier”
it’s line number shows before the file path, so i have to use line_regex like this:

"file_regex": "OF (.+):.+",
"line_regex": "LINE ([0-9]+) OF",

the problem is that , it won’t jump to the correct line of the error.
how could i fix it?

0 Likes

#2

no one knows? Did i misunderstand the usage of line_regex?

0 Likes

#3

I’m not sure that what you need is possible. I think that “line_regex” is used when the filename and line number on the build output are on separate lines, so it will match the line_regex and then start going backwards to find the filename using file_regex.

If the filename and line number are on the same line then you’re only supposed to use file_regex and use the match groups to parse out the info. The problem is that Sublime seems to expect that the filename is always before the line number. Group 0 is the filename, 1 is the line number, 2 is the column, and 3 is the error message. There doesn’t seem to be a way of telling Sublime to use a different order though.

A Google search brought up some older posts with people having this very issue… no solution that I could find unfortunately.

0 Likes

#4

I see, i will seek further solution, anyway, thanks for your help

0 Likes