mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Corrected coding style.
This commit is contained in:
parent
3e72f3d455
commit
8c0b7054f3
24
main.cpp
24
main.cpp
@ -10,8 +10,10 @@
|
|||||||
#include <libsolidity/ASTPrinter.h>
|
#include <libsolidity/ASTPrinter.h>
|
||||||
#include <libsolidity/NameAndTypeResolver.h>
|
#include <libsolidity/NameAndTypeResolver.h>
|
||||||
|
|
||||||
namespace dev {
|
namespace dev
|
||||||
namespace solidity {
|
{
|
||||||
|
namespace solidity
|
||||||
|
{
|
||||||
|
|
||||||
ptr<ContractDefinition> parseAST(std::string const& _source)
|
ptr<ContractDefinition> parseAST(std::string const& _source)
|
||||||
{
|
{
|
||||||
@ -20,15 +22,16 @@ ptr<ContractDefinition> parseAST(std::string const& _source)
|
|||||||
return parser.parse(scanner);
|
return parser.parse(scanner);
|
||||||
}
|
}
|
||||||
|
|
||||||
} } // end namespaces
|
}
|
||||||
|
} // end namespaces
|
||||||
|
|
||||||
void help()
|
void help()
|
||||||
{
|
{
|
||||||
std::cout
|
std::cout
|
||||||
<< "Usage solc [OPTIONS] <file>" << std::endl
|
<< "Usage solc [OPTIONS] <file>" << std::endl
|
||||||
<< "Options:" << std::endl
|
<< "Options:" << std::endl
|
||||||
<< " -h,--help Show this help message and exit." << std::endl
|
<< " -h,--help Show this help message and exit." << std::endl
|
||||||
<< " -V,--version Show the version and exit." << std::endl;
|
<< " -V,--version Show the version and exit." << std::endl;
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,7 +47,6 @@ void version()
|
|||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
std::string infile;
|
std::string infile;
|
||||||
|
|
||||||
for (int i = 1; i < argc; ++i)
|
for (int i = 1; i < argc; ++i)
|
||||||
{
|
{
|
||||||
std::string arg = argv[i];
|
std::string arg = argv[i];
|
||||||
@ -55,7 +57,6 @@ int main(int argc, char** argv)
|
|||||||
else
|
else
|
||||||
infile = argv[i];
|
infile = argv[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string src;
|
std::string src;
|
||||||
if (infile.empty())
|
if (infile.empty())
|
||||||
{
|
{
|
||||||
@ -65,10 +66,11 @@ int main(int argc, char** argv)
|
|||||||
getline(std::cin, s);
|
getline(std::cin, s);
|
||||||
src.append(s);
|
src.append(s);
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
src = dev::asString(dev::contents(infile));
|
src = dev::asString(dev::contents(infile));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << "Parsing..." << std::endl;
|
std::cout << "Parsing..." << std::endl;
|
||||||
// @todo catch exception
|
// @todo catch exception
|
||||||
dev::solidity::ptr<dev::solidity::ContractDefinition> ast = dev::solidity::parseAST(src);
|
dev::solidity::ptr<dev::solidity::ContractDefinition> ast = dev::solidity::parseAST(src);
|
||||||
|
Loading…
Reference in New Issue
Block a user