Commit 96ea72e2 authored by Alexander Weigl's avatar Alexander Weigl

Merge remote-tracking branch 'origin/weigl-sync' into weigl-sync

parents 9f676085 450ad8d1
Pipeline #15107 failed with stages
in 17 seconds
...@@ -350,9 +350,9 @@ public class TransformAst implements ScriptLanguageVisitor<Object> { ...@@ -350,9 +350,9 @@ public class TransformAst implements ScriptLanguageVisitor<Object> {
CaseStatement cs = null; CaseStatement cs = null;
if (ctx.TRY() != null) { if (ctx.TRY() != null) {
cs = new TryCase(); cs = new TryCase();
} else if (ctx.closesScript != null) { } else if (ctx.closesGuard != null) {
cs = new ClosesCase(); cs = new ClosesCase();
Statements closes = (Statements) ctx.closesScript.accept(this); Statements closes = (Statements) ctx.closesGuard.accept(this);
((ClosesCase) cs).setClosesGuard(closes); ((ClosesCase) cs).setClosesGuard(closes);
closes.setParent(cs); closes.setParent(cs);
} else { } else {
......
...@@ -11,6 +11,7 @@ import edu.kit.iti.formal.psdbg.parser.DefaultASTVisitor; ...@@ -11,6 +11,7 @@ import edu.kit.iti.formal.psdbg.parser.DefaultASTVisitor;
import edu.kit.iti.formal.psdbg.parser.Visitor; import edu.kit.iti.formal.psdbg.parser.Visitor;
import edu.kit.iti.formal.psdbg.parser.ast.*; import edu.kit.iti.formal.psdbg.parser.ast.*;
import edu.kit.iti.formal.psdbg.parser.data.Value; import edu.kit.iti.formal.psdbg.parser.data.Value;
import edu.kit.iti.formal.psdbg.parser.types.SimpleType;
import edu.kit.iti.formal.psdbg.parser.types.Type; import edu.kit.iti.formal.psdbg.parser.types.Type;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
...@@ -439,12 +440,25 @@ public class Interpreter<T> extends DefaultASTVisitor<Object> ...@@ -439,12 +440,25 @@ public class Interpreter<T> extends DefaultASTVisitor<Object>
*/ */
private VariableAssignment evaluateMatchInGoal(Expression matchExpression, GoalNode<T> goal) { private VariableAssignment evaluateMatchInGoal(Expression matchExpression, GoalNode<T> goal) {
enterScope(matchExpression); enterScope(matchExpression);
MatchEvaluator mEval = new MatchEvaluator(goal.getAssignments(), goal, matcherApi); List<VariableAssignment> matchResult;
mEval.getEntryListeners().addAll(getEntryListeners()); if (matchExpression.hasMatchExpression()) {
mEval.getExitListeners().addAll(getExitListeners()); MatchEvaluator mEval = new MatchEvaluator(goal.getAssignments(), goal, matcherApi);
exitScope(matchExpression); mEval.getEntryListeners().addAll(getEntryListeners());
mEval.getExitListeners().addAll(getExitListeners());
exitScope(matchExpression);
matchResult = mEval.eval(matchExpression);
} else {
List<VariableAssignment> matchResult = mEval.eval(matchExpression); matchResult = new ArrayList<>();
Evaluator eval = new Evaluator(goal.getAssignments(), goal);
Value eval1 = eval.eval(matchExpression);
if (eval1.getType().equals(SimpleType.BOOL) && eval1.equals(Value.TRUE)) {
VariableAssignment emptyAssignment = new VariableAssignment(null);
matchResult.add(emptyAssignment);
}
exitScope(matchExpression);
}
if (matchResult.isEmpty()) { if (matchResult.isEmpty()) {
return null; return null;
} else { } else {
......
...@@ -9,7 +9,6 @@ import javafx.scene.control.*; ...@@ -9,7 +9,6 @@ import javafx.scene.control.*;
import javafx.scene.text.Text; import javafx.scene.text.Text;
import javafx.scene.text.TextFlow; import javafx.scene.text.TextFlow;
import javafx.stage.Modality; import javafx.stage.Modality;
import lombok.Getter;
import java.util.List; import java.util.List;
...@@ -25,7 +24,7 @@ import java.util.List; ...@@ -25,7 +24,7 @@ import java.util.List;
* @author A. Weigl * @author A. Weigl
*/ */
public class ContractChooser extends Dialog<Contract> { public class ContractChooser extends Dialog<Contract> {
@Getter
private final MultipleSelectionModel<Contract> selectionModel; private final MultipleSelectionModel<Contract> selectionModel;
private final ObjectProperty<ObservableList<Contract>> items; private final ObjectProperty<ObservableList<Contract>> items;
......
...@@ -130,8 +130,8 @@ public class SequentView extends CodeArea { ...@@ -130,8 +130,8 @@ public class SequentView extends CodeArea {
NamespaceSet nss = services.getNamespaces(); NamespaceSet nss = services.getNamespaces();
Sequent sequent = node.get().sequent(); Sequent sequent = node.get().sequent();
filter = new IdentitySequentPrintFilter(); filter = new IdentitySequentPrintFilter(sequent);
filter.setSequent(sequent); //filter.setSequent(sequent);
ProgramPrinter prgPrinter = new ProgramPrinter(new StringWriter()); ProgramPrinter prgPrinter = new ProgramPrinter(new StringWriter());
this.backend = new LogicPrinter.PosTableStringBackend(80); this.backend = new LogicPrinter.PosTableStringBackend(80);
......
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