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

Bugfix match

parent 2e39b7de
Pipeline #32001 failed with stages
......@@ -16,7 +16,7 @@ import java.util.Collections;
import java.util.List;
/**
* Evaluator specially for Expressions in a case "declaration".
* Evaluator especially for Expressions in a case "declaration".
* Created by sarah on 5/22/17.
*/
public class MatchEvaluator extends DefaultASTVisitor<List<VariableAssignment>> implements ScopeObservable {
......@@ -190,9 +190,13 @@ public class MatchEvaluator extends DefaultASTVisitor<List<VariableAssignment>>
public List<VariableAssignment> visit(UnaryExpression e) {
Operator op = e.getOperator();
Expression expr = e.getExpression();
Value exValue = (Value) expr.accept(this);
Value ret = op.evaluate(exValue);
return null;
List<VariableAssignment> exValue = (List<VariableAssignment>) expr.accept(this);
if(exValue.isEmpty()){
return transformTruthValue(Value.TRUE);
}else{
return transformTruthValue(Value.FALSE);
}
}
......
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