Commit 5161af32 authored by Michael Schwarz's avatar Michael Schwarz

fixed insert location of precedences

parent 97758e5c
......@@ -823,6 +823,8 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
resolutionOptions.select(0);
changeColors(backgroundColorShiftReduce,foregroundColorShiftReduce);
}
partOfCurrentConnected = false;
}
// replace (*) generated by CUP with BULLET U+2022 •
......@@ -950,8 +952,7 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
}
public CupConflictsView(Composite realParent, Jumper jumper,
CupTextEditor editor) {
public CupConflictsView(Composite realParent, Jumper jumper,CupTextEditor editor) {
super(realParent);
Composite parent = getMain();
......@@ -1167,18 +1168,21 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
positionForPrec = r.symbols.get(r.symbols.size() - 1).getEnd().getOffsetFromStart();
toInsert = "\n\n//Precedences added by Eclipse plugin\n" + toInsert;
} else {
positionForPrec = r.precedences.get(r.precedences.size() - 1).getRange().getBegin()
positionForPrec = r.precedences.get(0).getRange().getBegin()
.getOffsetFromStart();
toInsert = toInsert + "\n";
}
document.replace(positionForPrec, 0, toInsert);
abortConnectedResolution();
} catch (BadLocationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
finally{
abortConnectedResolution();
}
}
private void insertPrecedence(terminal terminal,Precedence.Type assoc){
......@@ -1195,7 +1199,7 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
toInsert = "\n\n//Precedences added by Eclipse plugin\n" + toInsert;
}
else {
positionForPrec = r.precedences.get(r.precedences.size()-1).getRange().getBegin().getOffsetFromStart();
positionForPrec = r.precedences.get(0).getRange().getBegin().getOffsetFromStart();
toInsert = toInsert + "\n";
}
......
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