Sublime Forum

Complete regex Newb - custom build system - low level coding

#1

And also pretty wet behind the ears with sublime text.

my focus is coding for PICs. I write in C and I love ST2.
I have a build system that will successfully call my compiler and compile my code.
I cannot, however, get it to display error messages.

I use the CCS C compiler for these 8 bit workhorses.

{ "cmd": "ccsc", "+FM +Y=9 +STDOUT", "$file"], "file_regex" : "." }

The “cmd” line works for me. The Arguments tell it what family of micro to compile for,
the optimization level, and then to write output to the standard output stream.
I know that the file_regex line is not at all correct but it’s the only thing I’ve done that shows promise.
After the compiler is run I will at least see in the status bar “1 error” etc. It just doesn’t tell me
what the error is.

I get the feeling that most of these build systems are for higher level languages, but anything to improve my
workflow is helpful.

Cheers, and hello from the new guy

0 Likes

#2

What text prints to STDOUT?

0 Likes

#3

Honestly I’m not entirely sure.

The compiler generates it’s own error file with a .err extension. I could be incorrectly
assuming that the output in STDOUT is the same

The text with in it could be as follows:

Error[58] source.c 400 : Expecting a close paren 1 Errors, 0 Warnings. Build Failed.

Obviously different error messages would result from different errors.

0 Likes

#4

So maybe your file regex could be something like:
\w+\d+]\s+(\S+) (\d+)
That way you’d capture the filename and then the line number (unless your filename has spaces)

0 Likes