Commit 97d089f9 authored by Michael Schwarz's avatar Michael Schwarz

Fixed issue where shift was taken instead of reduce

parent d2e5e922
......@@ -112,7 +112,7 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
public boolean isResolvedInFavorOfShift(ShiftReduceDetails srd){
if(!srd.reduce.equals(srd.shift))
//TODO: Check if precedence set for terminal at all
return hasPrecedence(srd.reduce,srd.shift);
return hasPrecedence(srd.shift,srd.reduce);
else
return precs.get(srd.shift) == Precedence.Type.Right;
}
......@@ -263,10 +263,11 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
return true;
}
toCheck.addAll(edges.get(over));
toCheck.addAll(speculativeEdges.get(over));
// TODO:Sure ?
if(toCheck.size() == 0){
return true;
return false;
}
while(toCheck.size() > 0){
......@@ -773,14 +774,14 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
// The user wants to shift, but shifting affects other conflicts
if(srdetails.shiftAffectsOthers && resolutionOptions.getSelectionIndex() == 1){
beginConnectedResolution();
currentPrecs.add(srdetails.shift);
currentPrecs.add(srdetails.shift,srdetails.reduce);
return;
}
// The user wants to reduce, but reduce affects other conflicts
if(srdetails.reduceAffectsOthers && resolutionOptions.getSelectionIndex() == 2){
beginConnectedResolution();
currentPrecs.add(srdetails.reduce);
currentPrecs.add(srdetails.reduce,srdetails.shift);
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment