I want to write OpenCL syntax checker for vim-opencl plugin. OpenCL compiler do some strange formatting of output errors. There are two types of errors.
Normal (with small error explanation):
"/tmp/OCLUKvOsF.cl", line 143: error: expression must have integral type
rec_table[PRIME_P - ri] = PRIME_P - i;
^
And not-normal with line-break in error explanation:
"/tmp/OCLUKvOsF.cl", line 148: error: a value of type "uint16" cannot be used
to initialize an entity of type "uint"
uint a = value, b = PRIME_P, u = 0, v = 0;
^
So trouble is in concatenation of two parts of broken error explanation in second case and normal error handling in first case.
I'm using syntastic as generel syntax checker. Now I have such code for it:
let errorformat = '%E"%f"\, line %l: error: %m,%+C%.%#,%-Z%p^,'.
\'%W"%f"\, line %l: warning: %m,%-C%.%#,'.
\'%-G%.%#'
So first and second errors look following:
program.cl|143 error| expression must have integral type rec_table[PRIME_P - ri] = PRIME_P - i; ^
program.cl|148 col 14 error| a value of type "uint16" cannot be used to initialize an entity of type "uint" uint a = value, b = PRIME_P, u = 0, v = 0;
It almost ok (especially in second case), but I don't know how to make it like this:
program.cl|143 col 19 error| expression must have integral type
program.cl|148 col 14 error| a value of type "uint16" cannot be used to initialize an entity of type "uint"
Or at least like this:
program.cl|143 col 19 error| expression must have integral type rec_table[PRIME_P - ri] = PRIME_P - i;
program.cl|148 col 14 error| a value of type "uint16" cannot be used to initialize an entity of type "uint" uint a = value, b = PRIME_P, u = 0, v = 0;
Do you have some idea?
UPD. Updated errorformat and expectations