Commit 7ace485e authored by Sarah Grebing's avatar Sarah Grebing

Bugfix concerning " for stringliterals

parent a730de1d
Pipeline #15284 failed with stages
in 1 minute and 14 seconds
......@@ -138,6 +138,23 @@ public class PrettyPrinter extends DefaultASTVisitor<Void> {
return null;
}
@Override
public Void visit(StringLiteral stringLiteral) {
s.append(String.format("\'\'%s\'\'", stringLiteral.getText()));
return super.visit(stringLiteral);
}
/**
* clear line
*/
private void cl() {
int i = s.length() - 1;
while (Character.isWhitespace(s.charAt(i))) {
s.deleteCharAt(i--);
}
nl();
}
@Override
public Void visit(CasesStatement casesStatement) {
s.append("cases {");
......@@ -154,10 +171,10 @@ public class PrettyPrinter extends DefaultASTVisitor<Void> {
s.append("}");
}*/
if (casesStatement.getDefCaseStmt() != null) {
s.append("default {");
s.append("default : ");
casesStatement.getDefCaseStmt().accept(this);
cl();
s.append("}");
// s.append("}");
}
decrementIndent();
......@@ -166,28 +183,6 @@ public class PrettyPrinter extends DefaultASTVisitor<Void> {
return null;
}
/**
* clear line
*/
private void cl() {
int i = s.length() - 1;
while (Character.isWhitespace(s.charAt(i))) {
s.deleteCharAt(i--);
}
nl();
}
@Override
public Void visit(GuardedCaseStatement caseStatement) {
s.append("case ");
caseStatement.getGuard().accept(this);
s.append(" {");
caseStatement.getBody().accept(this);
nl();
s.append("}");
return super.visit(caseStatement);
}
@Override
public Void visit(CallStatement call) {
s.append(call.getCommand());
......@@ -206,9 +201,14 @@ public class PrettyPrinter extends DefaultASTVisitor<Void> {
}
@Override
public Void visit(StringLiteral stringLiteral) {
s.append(String.format("\"%s\"", stringLiteral.getText()));
return super.visit(stringLiteral);
public Void visit(GuardedCaseStatement caseStatement) {
s.append("case ");
caseStatement.getGuard().accept(this);
s.append(": ");
caseStatement.getBody().accept(this);
nl();
// s.append("}");
return super.visit(caseStatement);
}
@Override
......
......@@ -53,7 +53,7 @@ public class LabelFactory {
}
cur = cur.parent();
} while (cur != null);
sb.append("$$");
sb.append("END");
return sb.toString();
}
......@@ -70,7 +70,7 @@ public class LabelFactory {
}
node = p;
}
sb.append("$$");
sb.append("END");
return sb.toString();
}
......
package edu.kit.iti.formal.psdbg.gui.controls;
import com.google.common.eventbus.Subscribe;
import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon;
import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIconView;
import de.uka.ilkd.key.logic.SequentFormula;
import edu.kit.iti.formal.psdbg.gui.controller.Events;
import edu.kit.iti.formal.psdbg.gui.model.MainScriptIdentifier;
import edu.kit.iti.formal.psdbg.interpreter.dbg.Breakpoint;
......@@ -11,7 +9,7 @@ import edu.kit.iti.formal.psdbg.lint.LintProblem;
import edu.kit.iti.formal.psdbg.lint.LinterStrategy;
import edu.kit.iti.formal.psdbg.parser.Facade;
import edu.kit.iti.formal.psdbg.parser.ScriptLanguageLexer;
import edu.kit.iti.formal.psdbg.parser.ast.*;
import edu.kit.iti.formal.psdbg.parser.ast.ProofScript;
import javafx.beans.InvalidationListener;
import javafx.beans.Observable;
import javafx.beans.binding.BooleanBinding;
......@@ -201,7 +199,9 @@ public class ScriptArea extends CodeArea {
String newValue = getText();
if (newValue.length() != 0) {
clearStyle(0, newValue.length());
StyleSpans<? extends Collection<String>> spans = highlighter.highlight(newValue);
if (spans != null) setStyleSpans(0, spans);
markedRegions.forEach(reg -> {
......
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