Parsing output of external tool

Post Reply
mkstevo
Posts: 4
Joined: 06.05.2018 12:43

Parsing output of external tool

Post by mkstevo »

Hello. I'm sure this is a silly question, but I can't figure it out. Sorry.

I've installed CudaText on my Mac, installed the GreatCowBasic lexer(s) and set up the GreatCowBasic compiler to run using the cuda_exttools plugin. I can't figure out how to parse the error messages returned by the compiler so that when clicked in the output panel they navigate to the correct line in the editor. I have tried many combinations of regex searches that should return the line numbers, but have not been able to get the 'Line', 'Column' or 'Filename' fields to show any information at all (which is probably why clicking on the line in the output window is not working). Would anyone be kind enough to suggest the format of regex I would need to enter into the 'Pattern' entry box to give me the required 'Line', 'Column', 'Filename' entries to make this work? The sample patterns are all blank which doesn't help.

This is a sample line from an error message that the compiler returns, and is displayed in the output panel:
/Users/mkstevo/Desktop/uSD_MusicBox_4.03.gcb (1234): Error: Variable SWITCHVALUE was not explicitly declared

Clearly, 1234 is the line number, and /Users/mkstevo/Desktop/uSD_MusicBox_4.03.gcb is the filename.

Could I also mention that on making changes to the external tools, closing the dialog causes an error on my Mac? It seems not to cause problems other than the Tools > Config menu option doesn't work until CudaText is closed and restarted.
User avatar
kvichans
Posts: 203
Joined: 07.10.2012 05:45

Post by kvichans »

Regexp

Code: Select all

(?P<file>[^(]+) \((?P<line>\d+)
outputs on your line good Filename and Line.

Some comments:

Code: Select all

(?P<file>[^(]+)
takes to file-var all chars befor first " ("

Code: Select all

\((?P<line>\d+)
takes to line-var all digits after first "("
CudaText 1.163, TC9.51x32, Win10x64(1920x1080)
User avatar
kvichans
Posts: 203
Joined: 07.10.2012 05:45

Post by kvichans »

> closing the dialog causes an error
Show screen before dlg close.
Show text from console after error.
CudaText 1.163, TC9.51x32, Win10x64(1920x1080)
mkstevo
Posts: 4
Joined: 06.05.2018 12:43

Post by mkstevo »

Oh wow! Many thanks, the Regexp works wonderfully well. Thanks again.
mkstevo
Posts: 4
Joined: 06.05.2018 12:43

Post by mkstevo »

Here are the dialog boxes, before I click Close, and the message given:
Before:
Before:
Error message:
Error message:
The error only occurs if a change has been made to one or more of the settings. If no changes are made, there is no error message given.
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

This is one of __strange runtime errors on macOS. I have see such in other place... Lazarus bugs
mkstevo
Posts: 4
Joined: 06.05.2018 12:43

Post by mkstevo »

Thanks again.
Post Reply