From 8c0b7054f3849fcf2b611c4aa21af6a53dd4b57e Mon Sep 17 00:00:00 2001 From: Christian Date: Thu, 16 Oct 2014 14:08:54 +0200 Subject: [PATCH] Corrected coding style. --- main.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/main.cpp b/main.cpp index a92f466ec..a2b791462 100644 --- a/main.cpp +++ b/main.cpp @@ -10,8 +10,10 @@ #include #include -namespace dev { -namespace solidity { +namespace dev +{ +namespace solidity +{ ptr parseAST(std::string const& _source) { @@ -20,15 +22,16 @@ ptr parseAST(std::string const& _source) return parser.parse(scanner); } -} } // end namespaces +} +} // end namespaces void help() { std::cout - << "Usage solc [OPTIONS] " << std::endl - << "Options:" << std::endl - << " -h,--help Show this help message and exit." << std::endl - << " -V,--version Show the version and exit." << std::endl; + << "Usage solc [OPTIONS] " << std::endl + << "Options:" << std::endl + << " -h,--help Show this help message and exit." << std::endl + << " -V,--version Show the version and exit." << std::endl; exit(0); } @@ -44,7 +47,6 @@ void version() int main(int argc, char** argv) { std::string infile; - for (int i = 1; i < argc; ++i) { std::string arg = argv[i]; @@ -55,7 +57,6 @@ int main(int argc, char** argv) else infile = argv[i]; } - std::string src; if (infile.empty()) { @@ -65,10 +66,11 @@ int main(int argc, char** argv) getline(std::cin, s); src.append(s); } - } else { + } + else + { src = dev::asString(dev::contents(infile)); } - std::cout << "Parsing..." << std::endl; // @todo catch exception dev::solidity::ptr ast = dev::solidity::parseAST(src);