// file : tests/compiler/cxx-indenter/driver.cxx // author : Boris Kolpackov // copyright : Copyright (c) 2009 Code Synthesis Tools CC // license : MIT; see accompanying LICENSE file #include #include #include #include using namespace std; using namespace cutl::compiler; int main () { //std::wostream& os (wcout); //ostream_filter filt (os); std::ostream& os (cout); ostream_filter filt (os); os << "if (true)" << "{" << "// Hello there" << endl << "//" << endl << "a ();" << "}" << "else" << "{" << "b ();" << "}"; os << "if (false)" << "{" << "if (true)" << "{" << "// test" << endl << "}" << "else" << "{" << "// test" << endl << "b ();" << "}" << "}"; os << "namespace a" << "{" << "void f ();" << "}" << "#if defined(__HP_aCC) && __HP_aCC <= 39999" << endl << "#include " << endl << "#endif" << endl << endl << "namespace b" << "{" << "void f ();" << "}"; // Test do-while handling. // os << "do" << endl << "f ();" << "while (false);" << endl; os << "do" << "{" << "f ();" << "}" << "while (false);" << endl; os << "do" << "{" << "if (f ())" << "{" << "g ();" << "}" << "}" << "while (false);" << endl; os << "do" << "{" << "do" << endl << "f ();" << "while (false);" << "}" << "while (false);" << endl; os << "do" << "{" << "do" << "{" << "f ();" << "}" << "while (false);" << "}" << "while (false);" << endl; }