Commit bd40666b authored by Michael Schwarz's avatar Michael Schwarz

ignoring of RR now after // ~~ CUP-ECLIPSE:CONFLICT-RES-RR ~~

parent c70b49cd
......@@ -56,9 +56,11 @@ import de.tum.in.www2.cupplugin.views.PrecedenceToInsert.PrecedenceCyclicExcepti
public class CupConflictsView extends FailableView implements ICupEditorPageVisibility,
ICupParserLaLrChangeObserver, IRegisterForControllerChanges {
private static final int OUTER_MARGIN = 10; // TODO: share between panels.
private static final int OUTER_MARGIN = 10;
static final int INNER_MARGIN = 5;
private static final String TRESHOLD_STRING = "~~ CUP-ECLIPSE:CONFLICT-RES-RR ~~ ";
Jumper jumper;
private CupTextEditor editor;
private boolean isVisible;
......@@ -525,7 +527,20 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
private boolean isIgnored(Conflict c){
if(c instanceof ReduceReduceConflict){
ReduceReduceConflict rrc = (ReduceReduceConflict) c;
int treshold = 200;
IDocument document = editor.getDocument();
int offset = document.get().indexOf(TRESHOLD_STRING);
if(offset == -1){
return false;
}
int treshold;
try {
treshold = document.getLineOfOffset(offset)+1;
} catch (BadLocationException e) {
return false;
}
return (rrc.getConflictItem1().the_production().getAstNode().getEnd().getLine() > treshold)
&& (rrc.getConflictItem2().the_production().getAstNode().getEnd().getLine() > treshold);
......
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