Closed ltratt closed 6 years ago
This example is a bit unclear if we don't know what Java version we are targeting:
class C {
void x(T ... y) { }
}
In Java7 upwards the three dots are lexed as a single token ELLIPSIS
. So the repair sequences might look a bit different. On that note, the Java7 grammar is ready and there's a PR waiting for you. So you can test this example with Java7 if you like.
I was trying with the 1.5 grammar, so it didn't parse this at all. I'll look at the other PR first though.
So should I update the comment to make clear the example was for Java 1.5? I'll have to do a force push.
I don't mind. I just thought I bring it to your attention that the repair is probably different in Java7, i.e. it's gonna be something like 1 delete (...
) and then one insert (.
).
Clarified the commit message to make clear it's relative to the Java 1.5 grammar.
Good. And merged!
I forgot that when checking for compatible repairs we need to take into account this:
For example with the MF recoverer and this Java program:
before this patch we would find 4 repair sequences:
The solution is fairly simple: we add an additional clause that if one repair sequence ends with a Delete the other must too. That allows us to find a further 4 repair sequences:
While here, tidy up the compatibility check to make it easier to read.