public MyVoid VisitIfStmt(Stmt.If stmt)
        {
            resolve(stmt.condition);
            resolve(stmt.thenBranch);
            if (stmt.elseBranch != null)
            {
                resolve(stmt.elseBranch);
            }

            return(null);
        }
Esempio n. 2
0
        public MyVoid VisitIfStmt(Stmt.If stmt)
        {
            if (isTruthy(Evaluate(stmt.condition)))
            {
                Execute(stmt.thenBranch);
            }
            else if (stmt.elseBranch != null)
            {
                Execute(stmt.elseBranch);
            }

            return(null);
        }