I want to write an OpenCL parser for a vim-opencl plugin . The OpenCL compiler does weird formatting of output errors. There are two types of errors.
Normal (with a little explanation):
"/tmp/OCLUKvOsF.cl", line 143: error: expression must have integral type rec_table[PRIME_P - ri] = PRIME_P - i; ^
And not normal with an explanation of the line in error:
"/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; ^
Thus, the problem lies in combining the two parts of the broken error description in the second case and the normal error handling in the first case.
I use syntastic as a syntax generator. Now I have code like this for this:
let errorformat = '%E"%f"\, line %l: error: %m,%+C%.%#,%-Z%p^,'. \'%W"%f"\, line %l: warning: %m,%-C%.%#,'. \'%-G%.%#'
So, the first and second errors are as follows:
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;
This is almost normal (especially in the second case), but I don't know how to do it:
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 an idea?
UPD Updated error and expect format