aboutsummaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-10-16 20:08:54 +0800
committerChristian <c@ethdev.com>2014-10-16 20:08:54 +0800
commit8c0b7054f3849fcf2b611c4aa21af6a53dd4b57e (patch)
tree672fbc07ee7d228c37ead6ab84a82c8972bf75f1 /main.cpp
parent3e72f3d455951c447a92501d05380efe394f42f5 (diff)
downloaddexon-solidity-8c0b7054f3849fcf2b611c4aa21af6a53dd4b57e.tar
dexon-solidity-8c0b7054f3849fcf2b611c4aa21af6a53dd4b57e.tar.gz
dexon-solidity-8c0b7054f3849fcf2b611c4aa21af6a53dd4b57e.tar.bz2
dexon-solidity-8c0b7054f3849fcf2b611c4aa21af6a53dd4b57e.tar.lz
dexon-solidity-8c0b7054f3849fcf2b611c4aa21af6a53dd4b57e.tar.xz
dexon-solidity-8c0b7054f3849fcf2b611c4aa21af6a53dd4b57e.tar.zst
dexon-solidity-8c0b7054f3849fcf2b611c4aa21af6a53dd4b57e.zip
Corrected coding style.
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/main.cpp b/main.cpp
index a92f466e..a2b79146 100644
--- a/main.cpp
+++ b/main.cpp
@@ -10,8 +10,10 @@
#include <libsolidity/ASTPrinter.h>
#include <libsolidity/NameAndTypeResolver.h>
-namespace dev {
-namespace solidity {
+namespace dev
+{
+namespace solidity
+{
ptr<ContractDefinition> parseAST(std::string const& _source)
{
@@ -20,15 +22,16 @@ ptr<ContractDefinition> parseAST(std::string const& _source)
return parser.parse(scanner);
}
-} } // end namespaces
+}
+} // end namespaces
void help()
{
std::cout
- << "Usage solc [OPTIONS] <file>" << 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] <file>" << 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<dev::solidity::ContractDefinition> ast = dev::solidity::parseAST(src);