Home Download Buy Blog Forum Support

Complete regex Newb - custom build system - low level coding

Complete regex Newb - custom build system - low level coding

Postby stinky on Wed Jan 02, 2013 10:06 pm

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.

Code: Select all
{
   "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
stinky
 
Posts: 2
Joined: Wed Jan 02, 2013 9:53 pm

Re: Complete regex Newb - custom build system - low level coding

Postby adzenith on Wed Jan 02, 2013 11:44 pm

What text prints to STDOUT?
adzenith
 
Posts: 1204
Joined: Mon Oct 19, 2009 9:12 pm

Re: Complete regex Newb - custom build system - low level coding

Postby stinky on Thu Jan 03, 2013 4:48 am

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:

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


Obviously different error messages would result from different errors.
stinky
 
Posts: 2
Joined: Wed Jan 02, 2013 9:53 pm

Re: Complete regex Newb - custom build system - low level coding

Postby adzenith on Thu Jan 03, 2013 8:38 pm

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)
adzenith
 
Posts: 1204
Joined: Mon Oct 19, 2009 9:12 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 33 guests

cron