File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
runtime/Java/src/org/antlr/v4/runtime/atn Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -180,7 +180,12 @@ public IntervalSet getExpectedTokens(int stateNumber, RuleContext context) {
180180 expected .remove (Token .EPSILON );
181181 while (ctx != null && ctx .invokingState >= 0 && following .contains (Token .EPSILON )) {
182182 ATNState invokingState = states .get (ctx .invokingState );
183- RuleTransition rt = (RuleTransition )invokingState .transition (0 );
183+ Transition t = invokingState .transition (0 );
184+ while (t instanceof EpsilonTransition ) {
185+ EpsilonTransition et = (EpsilonTransition ) t ;
186+ t = et .target .transition (0 );
187+ }
188+ RuleTransition rt = (RuleTransition ) t ;
184189 following = nextTokens (rt .followState );
185190 expected .addAll (following );
186191 expected .remove (Token .EPSILON );
You can’t perform that action at this time.
0 commit comments