public void VisitIfStmt(IfStmt stmt) { Resolve(stmt.Condition); Resolve(stmt.ThenBranch); if (stmt.ElseBranch != null) { Resolve(stmt.ElseBranch); } }
public void VisitIfStmt(IfStmt stmt) { if (IsTruthy(Evaluate(stmt.Condition))) { Execute(stmt.ThenBranch); } else if (stmt.ElseBranch != null) { Execute(stmt.ElseBranch); } }