Skip to content

Commit 1b857ff

Browse files
committed
tweak comment to be consistent with code. Fixes antlr#2172
1 parent cf71922 commit 1b857ff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

runtime/Java/src/org/antlr/v4/runtime/atn/PredictionContext.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,14 +316,14 @@ public static PredictionContext mergeRoot(SingletonPredictionContext a,
316316
}
317317
else {
318318
if ( a == EMPTY && b == EMPTY ) return EMPTY; // $ + $ = $
319-
if ( a == EMPTY ) { // $ + x = [$,x]
319+
if ( a == EMPTY ) { // $ + x = [x,$]
320320
int[] payloads = {b.returnState, EMPTY_RETURN_STATE};
321321
PredictionContext[] parents = {b.parent, null};
322322
PredictionContext joined =
323323
new ArrayPredictionContext(parents, payloads);
324324
return joined;
325325
}
326-
if ( b == EMPTY ) { // x + $ = [$,x] ($ is always first if present)
326+
if ( b == EMPTY ) { // x + $ = [x,$] ($ is always last if present)
327327
int[] payloads = {a.returnState, EMPTY_RETURN_STATE};
328328
PredictionContext[] parents = {a.parent, null};
329329
PredictionContext joined =

0 commit comments

Comments
 (0)