Skip to content

Commit

Permalink
fix AddEmptyList for --bison-lists (#1298)
Browse files Browse the repository at this point in the history
Co-authored-by: rv-jenkins <admin@runtimeverification.com>
  • Loading branch information
dwightguth and rv-jenkins committed May 26, 2020
1 parent 4201087 commit a2f6e8b
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -137,7 +137,12 @@ public Tuple2<Either<Set<KEMException>, Term>, Set<KEMException>> apply(TermCons
UserList ulTerm = lists.get(leastTerm.iterator().next()).get(0);
TermCons terminator = TermCons.apply(ConsPStack.empty(), ulTerm.pTerminator, child.location(), child.source());
// TermCons with PStack requires the elements to be in the reverse order
TermCons newTc = TermCons.apply(ConsPStack.from(Arrays.asList(terminator, child)), ul.pList, child.location(), child.source());
TermCons newTc;
if (ul.leftAssoc) {
newTc = TermCons.apply(ConsPStack.from(Arrays.asList(child, terminator)), ul.pList, child.location(), child.source());
} else {
newTc = TermCons.apply(ConsPStack.from(Arrays.asList(terminator, child)), ul.pList, child.location(), child.source());
}
newItems.add(newTc);
changed = true;
}
Expand Down

0 comments on commit a2f6e8b

Please sign in to comment.