This new version is something that works OK for me. It was a bit harder than expected to get this version together, leading to the 0.2 quote:
"All you need is ignorance and confidence and the success is sure." --Mark Twain
Currently Code Shine will:
#includenamespace bob { class C; } int f2() { // Simple for, no body for(int i=0; i < 10; ++i); // For with body for (int i=0; i < 10; ++i) std::cout << i << std::endl; if (1==1) std::cout << "true" << std::endl; // For, K&R style for (int k =0;k<12; k++) { std::cout << k; std::cout << std::endl; if (k > 7) {std::cout << "k greater than 7" << std::endl;} } // Deliberately have incorrect logic here if (1==0); std::cout << "1==0" << std::endl; int z=0; while (z< 9) { std::cout << "z " << z << std::endl; int b=1; do { std::cout << "B " << b << std::endl; b++; } while (b < 3); ++z; } } int main() { f2(); }
#includenamespace bob { class C; } int f2() { // Simple for, no body for(int i=0; i < 10; ++i); // For with body for (int i=0; i < 10; ++i) std::cout << i << std::endl; if (1==1) std::cout << "true" << std::endl; // For, K&R style for (int k =0;k<12; k++) { std::cout << k; std::cout << std::endl; if (k > 7) {std::cout << "k greater than 7" << std::endl;} } // Deliberately have incorrect logic here if (1==0); std::cout << "1==0" << std::endl; int z=0; while (z< 9) { std::cout << "z " << z << std::endl; int b=1; do { std::cout << "B " << b << std::endl; b++; } while (b < 3); ++z; } } int main() { f2(); }
The Older Version (0.1) page is still available