Exemplo n.º 1
0
        public Void visitIfStmt(Stmt.If stmt)
        {
            Resolve(stmt.condition);
            Resolve(stmt.then);
            if (stmt.el != null)
            {
                Resolve(stmt.el);
            }

            return(null);
        }
Exemplo n.º 2
0
        public Void visitIfStmt(Stmt.If stmt)
        {
            bool cond = IsTruthy(Evaluate(stmt.condition));

            if (cond)
            {
                Execute(stmt.then);
            }
            else if (stmt.el != null)
            {
                Execute(stmt.el);
            }

            return(null);
        }