Пример #1
0
        public Void visitIfStmt(Stmt.If stmt)
        {
            Resolve(stmt.condition);
            Resolve(stmt.then);
            if (stmt.el != null)
            {
                Resolve(stmt.el);
            }

            return(null);
        }
Пример #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);
        }