Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is how one of the `selector` subrules looks like in the old parser: (DOT super_key)=>DOT { helper.emit($DOT, DroolsEditorType.SYMBOL); } super_key superSuffix The whole rule is guarded by a syntactic predicate that is used to make the decision whether this alternative is viable. Syntactic predicates were removed in ANTLR 4 so this subrule became: DOT { helper.emit($DOT, DroolsEditorType.SYMBOL); } super_key superSuffix The failing predicate is "hidden" inside the `super_key` rule but it actually cannot be used to make the decision because it is now "invisible". See https://github.com/antlr/antlr4/blob/master/doc/predicates.md#finding-visible-predicates that explains how predicates can become invisible. The thing that makes the predicate invisible here is the action after `DOT`. And since the alternative is now unguarded it seems viable and so it is taken and the `super_key` rule is evaluated. At this point, inside `super_key` there is only a single alternative. It is guarded by a predicate that evaluates to `false`, which is an error condition. The fix is to restore the guard in front of this `selector` alternative that prevents taking should the super key predicate later turn out to be false. Fixes #5703.
- Loading branch information