Example #1
0
 public Nothing VisitIfStmt(Stmt.If stmt)
 {
     Resolve(stmt.Condition);
     Resolve(stmt.ThenBranch);
     if (stmt.ElseBranch != null)
     {
         Resolve(stmt.ElseBranch);
     }
     return(Nothing.AtAll);
 }
Example #2
0
        public Nothing VisitIfStmt(Stmt.If stmt)
        {
            if (IsTruthy(Evaluate(stmt.Condition)))
            {
                Execute(stmt.ThenBranch);
            }
            else if (stmt.ElseBranch != null)
            {
                Execute(stmt.ElseBranch);
            }

            return(Nothing.AtAll);
        }