Skip to content

Commit

Permalink
Fixed visitors for new logical types
Browse files Browse the repository at this point in the history
  • Loading branch information
martindevans committed Jul 17, 2019
1 parent b0efca6 commit 7b6d69f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Yolol.Analysis/TreeVisitor/ProgramDecomposition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,10 @@ protected override IEnumerable<BaseStatement> Visit(PostIncrement inc)

protected override IEnumerable<BaseStatement> Visit(Bracketed brk) => Visit(brk.Expression);

protected override IEnumerable<BaseStatement> Visit(And and) => Binary(and, (a, b) => new And(a, b));

protected override IEnumerable<BaseStatement> Visit(Or or) => Binary(or, (a, b) => new Or(a, b));

protected override IEnumerable<BaseStatement> Visit(Add add) => Binary(add, (a, b) => new Add(a, b));

protected override IEnumerable<BaseStatement> Visit(Subtract sub) => Binary(sub, (a, b) => new Subtract(a, b));
Expand Down
4 changes: 4 additions & 0 deletions Yolol.Analysis/Types/ExpressionTypeInference.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ protected override Type Visit(Phi phi)
return result;
}

protected override Type Visit(And and) => BinaryLogical(and);

protected override Type Visit(Or or) => BinaryLogical(or);

protected override Type Visit(LessThanEqualTo eq) => BinaryLogical(eq);

protected override Type Visit(LessThan eq) => BinaryLogical(eq);
Expand Down

0 comments on commit 7b6d69f

Please sign in to comment.