Exemplo n.º 1
0
 public object VisitIfStmt(Stmt.If stmt)
 {
     Resolve(stmt.condition);
     Resolve(stmt.thenBranch);
     if (stmt.elseBranch != null)
     {
         Resolve(stmt.elseBranch);
     }
     return(null);
 }
Exemplo n.º 2
0
 public Void VisitIfStmt(Stmt.If stmt)
 {
     Resolve(stmt.Condition);
     Resolve(stmt.ThenBranch);
     if (stmt.ElseBranch != null)
     {
         Resolve(stmt.ElseBranch);
     }
     return(null);
 }
Exemplo n.º 3
0
        public object Visit(Stmt.If _if)
        {
            Resolve(_if.condition);
            Resolve(_if.thenBranch);
            if (_if.elseBranch != null)
            {
                Resolve(_if.elseBranch);
            }

            return(null);
        }
Exemplo n.º 4
0
 public object VisitIfStmt(Stmt.If stmt)
 {
     if (IsTruthy(Evaluate(stmt.condition)))
     {
         Execute(stmt.thenBranch);
     }
     else if (stmt.elseBranch != null)
     {
         Execute(stmt.elseBranch);
     }
     return(null);
 }
Exemplo n.º 5
0
        public Void VisitIfStmt(Stmt.If stmt)
        {
            if (IsTruthy(Evaluate(stmt.Condition)))
            {
                Execute(stmt.ThenBranch);
            }
            else if (stmt.ElseBranch != null)
            {
                Execute(stmt.ElseBranch);
            }

            return(null);
        }
Exemplo n.º 6
0
        public object visitIfStmt(Stmt.If stmt)
        {
            object result = null;

            if (isTruthy(evaluate(stmt.condition)))
            {
                result = execute(stmt.thenBranch);
            }
            else if (stmt.elseBranch != null)
            {
                result = execute(stmt.elseBranch);
            }

            return(result);
        }
Exemplo n.º 7
0
 public string VisitIfStmt(Stmt.If stmt)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 8
0
 public string VisitIfStmt(Stmt.If stmt) => Parenthesize("ifstmt", stmt.Condition);