Skip to content
Snippets Groups Projects
Commit aa029d31 authored by Geluos's avatar Geluos
Browse files

Fix 1: Module7

parent 0aefdd53
No related merge requests found
Pipeline #6152 passed with warnings with stages
in 7 minutes and 24 seconds
......@@ -24,26 +24,25 @@ namespace SimpleLang.Visitors
public override void VisitCycleNode(CycleNode c)
{
VisitedLoops += 1;
_nCyc += 1;
VisitedLoops++;
_nCyc++;
c.Stat.Visit(this);
_nCyc -= 1;
_nCyc--;
}
public override void VisitBinOpNode(BinOpNode binop)
public override void VisitVarDefNode(VarDefNode w)
{
if (_nCyc > 0)
TotalOps += 1;
binop.Left.Visit(this);
binop.Right.Visit(this);
foreach (var v in w.vars)
v.Visit(this);
}
public override void VisitAssignNode(AssignNode a)
public override void VisitWriteNode(WriteNode w)
{
if (_nCyc > 0)
TotalOps += 1;
a.Expr.Visit(this);
w.Expr.Visit(this);
}
}
......
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