Improve error reporting for some parsing and typechecking errors#723
Improve error reporting for some parsing and typechecking errors#723JonasAlaif wants to merge 8 commits into
Conversation
|
Maybe you already knew this, but using |
|
Thanks! And I'm not sure we'll find all issues on time. |
|
True, I didn't have time to rerun the test yesterday and thought that all of them were passing |
|
@marcoeilers btw this is already an issue in current silver: since |
b5787a3 to
95e6bf0
Compare
e96d29f to
7217062
Compare
|
@marcoeilers this is ready to merge |
|
Two files here (https://github.com/viperproject/se_vcg_comparison/tree/main/bench_selection) that should parse don't:
|
|
@marcoeilers One issue is that looks like a function call at the end of the first assign... |
|
@marcoeilers do you think that it's reasonable to require a function call |
|
My immediate thoughts would be that 1) IMO newlines should be like any other whitespace, but 2) do we need to allow any whitespace before that parenthesis? |
|
@marcoeilers I'm not sure. The only reason I see for allowing it is for formatting reasons, but I've never seen anyone formatting calls with any whitespace before the due to a cut after |
|
Hm. Might be a topic for the Viper meeting? |
|
Yep we should discuss it then, for now does the thing I pushed look reasonable? It solves the two parse issues you had |
9b4a646 to
18fd658
Compare
|
Subsumed by #764 |
I've added cuts in various places in the parser (notably in
exp). This caused issues with parsing[exp]vs[exp..](using("[" ~ exp ~ ".." ~ Pass ~ "]") | ("[" ~ exp ~ "]") | ...caused the cut in the first case to prevent backtracking and getting to the other case, this should also be avoided in general see Avoid Backtracking) which had to be fixed.I also changed the duplicate identifier error to instead use the span of the found duplicate rather than the first declaration.
If there aren't any major issues, can we merge this before the release @marcoeilers?