f18 icon indicating copy to clipboard operation
f18 copied to clipboard

TODO: Improve parsing error messages

Open psteinfeld opened this issue 5 years ago • 3 comments

Some erroneous sources produce messages that could do a better job of indicating what needs to be done to fix the problem.

I've attached one such case. parsequirk01.f90.txt

psteinfeld avatar May 09 '19 20:05 psteinfeld

Test case(s) are needed.

klausler avatar May 09 '19 20:05 klausler

Test case(s) are needed.

You caught me between the chicken and the egg. I wanted to file an issue so that I could reference the issue number in the source code to put into the pull request. Now that I have done so, I can update the issue description.

psteinfeld avatar May 09 '19 20:05 psteinfeld

I attached a test case. Here's the output currently produced by the compiler:

test.f90:7:6: error: expected '=>' DO CONCURRENT (table(n) = 1:n) ^ test.f90:7:3: in the context: pointer assignment statement DO CONCURRENT (table(n) = 1:n) ^ test.f90:7:3: in the context: execution part construct test.f90:5:3: in the context: execution part n = 1 ^ test.f90:1:1: in the context: main program PROGRAM parsequirk01 ^ test.f90:7:6: error: expected '(' DO CONCURRENT (table(n) = 1:n) ^ test.f90:7:3: in the context: pointer assignment statement DO CONCURRENT (table(n) = 1:n) ^ test.f90:7:3: in the context: execution part construct test.f90:5:3: in the context: execution part n = 1 ^ test.f90:1:1: in the context: main program PROGRAM parsequirk01 ^ test.f90:7:6: error: expected '=' DO CONCURRENT (table(n) = 1:n) ^ test.f90:7:3: in the context: assignment statement DO CONCURRENT (table(n) = 1:n) ^ test.f90:7:3: in the context: execution part construct test.f90:5:3: in the context: execution part n = 1 ^ test.f90:1:1: in the context: main program PROGRAM parsequirk01 ^ test.f90:9:7: error: expected end of statement END DO ^ test.f90:9:3: in the context: END PROGRAM statement END DO ^ test.f90:1:1: in the context: main program PROGRAM parsequirk01 ^ ./bin/f18: could not parse test.f90

psteinfeld avatar Dec 11 '19 21:12 psteinfeld