]> git.saurik.com Git - cycript.git/blobdiff - Output.cpp
Replace the svnversion mechanism with git describe.
[cycript.git] / Output.cpp
index 6e70b6b94c68d25adb6a205392243a6524d03235..c97474451d17285acdcd36743577828de96a2453 100644 (file)
 
 #include <sstream>
 
-_finline CYFlags operator ~(CYFlags rhs) {
-    return static_cast<CYFlags>(~static_cast<unsigned>(rhs));
-}
-
-_finline CYFlags operator &(CYFlags lhs, CYFlags rhs) {
-    return static_cast<CYFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs));
-}
-
-_finline CYFlags operator |(CYFlags lhs, CYFlags rhs) {
-    return static_cast<CYFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs));
-}
-
-_finline CYFlags &operator |=(CYFlags &lhs, CYFlags rhs) {
-    return lhs = lhs | rhs;
-}
-
-_finline CYFlags CYLeft(CYFlags flags) {
-    return flags & ~(CYNoDangle | CYNoInteger);
-}
-
-_finline CYFlags CYRight(CYFlags flags) {
-    return flags & ~CYNoBF;
-}
-
-_finline CYFlags CYCenter(CYFlags flags) {
-    return CYLeft(CYRight(flags));
-}
-
 void CYOutput::Terminate() {
     out_ << ';';
     mode_ = NoMode;
@@ -378,8 +350,12 @@ void CYFor::Output(CYOutput &out, CYFlags flags) const {
     if (initialiser_ != NULL)
         initialiser_->For(out);
     out.Terminate();
+    if (test_ != NULL)
+        out << ' ';
     out << test_;
     out.Terminate();
+    if (increment_ != NULL)
+        out << ' ';
     out << increment_;
     out << ')';
     code_->Single(out, CYRight(flags));
@@ -460,7 +436,7 @@ void CYIf::Output(CYOutput &out, CYFlags flags) const {
     true_->Single(out, jacks);
 
     if (false_ != NULL) {
-        out << "else";
+        out << '\t' << "else";
         false_->Single(out, right);
     }
 
@@ -607,7 +583,7 @@ void CYRubyProc::Output(CYOutput &out, CYFlags flags) const {
 
 void CYStatement::Multiple(CYOutput &out, CYFlags flags) const {
     bool first(true);
-    for (const CYStatement *next(this); next != NULL; next = next->next_) {
+    CYForEach (next, this) {
         bool last(next->next_ == NULL);
         CYFlags jacks(first ? last ? flags : CYLeft(flags) : last ? CYRight(flags) : CYCenter(flags));
         first = false;