libocca / occa-transpiler

Working directory for new transpiler project
MIT License
7 stars 1 forks source link

non-OKL attribute related error in modified by normalizer line #199

Open pavlo-hilei opened 6 months ago

pavlo-hilei commented 6 months ago

This code doesn't show correct caret in error message:

@kernel void test_kern() {
    @outer for (int i = 0; j < 10; ++i) {
        @inner for (int j = 0; j < 10; ++j) {
        }
    }
}

Error:

./temp/test18.cpp:2:5: error: use of undeclared identifier 'j'
    2 |     @outer for (int i = 0; j < 10; ++i) {
      |     ^

Expected:

./temp/test18.cpp:2:5: error: use of undeclared identifier 'j'
    2 |     @outer for (int i = 0; j < 10; ++i) {
      |                            ^

This is a problem only when normalization is done.

pavlo-hilei commented 6 months ago

This error will be generated during AST parsing on gnu to std stage. I propose to save delta tree produced by previous stages to recover correct column