You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will crash the latest code on the "patterns" branch:
switch (e) {
caseE.e1:break;
caseE.e2:
}
It has to do with the new compact switch formatting and the unusual behavior where there is a rule for the cases that goes across the hard splits between each case. To handle that correctly, the ChunkBuilder doesn't divide at a hard split if it sees that a rule is used both before and after it. But in this case (heh), since the last case is empty, the rule for splitting the case bodies doesn't actually appear after the hard split before the last case.
So it divides the two cases. But the body splitting rule does show up in a constraint of one of the other rules. Because of that, it ends up getting an index assigned when it splits the first case and then the LineSplitter gets very confused when it gets to the second case because the assumption is that every rule has a null index before line splitting begins.
The core problem is that we shouldn't divide the chunks between the two cases. I'll need to come up with a better way to determine that. I tried traverse the rule constraints and preventing a divide if any rule is used on both sides of a hard split as a chunk's rule or in a constraint, but it's much too slow.
The text was updated successfully, but these errors were encountered:
This will crash the latest code on the "patterns" branch:
It has to do with the new compact switch formatting and the unusual behavior where there is a rule for the cases that goes across the hard splits between each case. To handle that correctly, the ChunkBuilder doesn't divide at a hard split if it sees that a rule is used both before and after it. But in this case (heh), since the last case is empty, the rule for splitting the case bodies doesn't actually appear after the hard split before the last
case
.So it divides the two cases. But the body splitting rule does show up in a constraint of one of the other rules. Because of that, it ends up getting an index assigned when it splits the first case and then the LineSplitter gets very confused when it gets to the second case because the assumption is that every rule has a
null
index before line splitting begins.The core problem is that we shouldn't divide the chunks between the two cases. I'll need to come up with a better way to determine that. I tried traverse the rule constraints and preventing a divide if any rule is used on both sides of a hard split as a chunk's rule or in a constraint, but it's much too slow.
The text was updated successfully, but these errors were encountered: