Beispiel #1
0
        public string VisitIfStmt(Stmt.IfStmt stmt)
        {
            if (stmt.ElseBranch == null)
            {
                return(Parenthesize2("if", stmt.Condition, stmt.ThenBranch));
            }

            return(Parenthesize2("if-else", stmt.Condition, stmt.ThenBranch, stmt.ElseBranch));
        }
Beispiel #2
0
 public object VisitIfStmt(Stmt.IfStmt stmt)
 {
     Resolve(stmt.Condition);
     Resolve(stmt.ThenBranch);
     if (stmt.ElseBranch != null)
     {
         Resolve(stmt.ElseBranch);
     }
     return(null);
 }