vim-opencl plugin のOpenCL 構文チェッカーを作成したいと考えています。OpenCL コンパイラは、出力エラーの奇妙な書式設定を行います。エラーには 2 種類あります。
正常 (小さなエラーの説明あり):
"/tmp/OCLUKvOsF.cl", line 143: error: expression must have integral type
rec_table[PRIME_P - ri] = PRIME_P - i;
^
エラーの説明に改行があり、正常ではありません。
"/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;
^
したがって、問題は、2 番目のケースの壊れたエラーの説明と、最初のケースの通常のエラー処理の 2 つの部分の連結にあります。
一般的な構文チェッカーとして syntasticを使用しています。今、私はそれのためのそのようなコードを持っています:
let errorformat = '%E"%f"\, line %l: error: %m,%+C%.%#,%-Z%p^,'.
\'%W"%f"\, line %l: warning: %m,%-C%.%#,'.
\'%-G%.%#'
したがって、最初と 2 番目のエラーは次のようになります。
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;
ほとんど問題ありませんが(特に2番目のケースでは)、次のようにする方法がわかりません:
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"
または、少なくとも次のようにします。
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;
アイデアはありますか?
アップデート。更新されたエラー形式と期待