|
@ -17,9 +17,9 @@ |
|
|
/**
|
|
|
/**
|
|
|
* @author Lefteris <lefteris@ethdev.com> |
|
|
* @author Lefteris <lefteris@ethdev.com> |
|
|
* @date 2014 |
|
|
* @date 2014 |
|
|
* Solidity compiler context class. |
|
|
* Solidity command line interface. |
|
|
*/ |
|
|
*/ |
|
|
#include "SolContext.h" |
|
|
#include "CommandLineInterface.h" |
|
|
|
|
|
|
|
|
#include <string> |
|
|
#include <string> |
|
|
#include <iostream> |
|
|
#include <iostream> |
|
@ -77,7 +77,6 @@ static inline bool outputToStdout(OutputType type) |
|
|
return type == OutputType::STDOUT || type == OutputType::BOTH; |
|
|
return type == OutputType::STDOUT || type == OutputType::BOTH; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static std::istream& operator>>(std::istream& _in, OutputType& io_output) |
|
|
static std::istream& operator>>(std::istream& _in, OutputType& io_output) |
|
|
{ |
|
|
{ |
|
|
std::string token; |
|
|
std::string token; |
|
@ -93,7 +92,7 @@ static std::istream& operator>>(std::istream& _in, OutputType& io_output) |
|
|
return _in; |
|
|
return _in; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void SolContext::handleBytecode(string const& _argName, |
|
|
void CommandLineInterface::handleBytecode(string const& _argName, |
|
|
string const& _title, |
|
|
string const& _title, |
|
|
string const& _contract, |
|
|
string const& _contract, |
|
|
string const& _suffix) |
|
|
string const& _suffix) |
|
@ -126,7 +125,7 @@ void SolContext::handleBytecode(string const& _argName, |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void SolContext::handleJson(DocumentationType _type, |
|
|
void CommandLineInterface::handleJson(DocumentationType _type, |
|
|
string const& _contract) |
|
|
string const& _contract) |
|
|
{ |
|
|
{ |
|
|
std::string argName; |
|
|
std::string argName; |
|
@ -172,16 +171,7 @@ void SolContext::handleJson(DocumentationType _type, |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool CommandLineInterface::parseArguments(int argc, char** argv) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool SolContext::parseArguments(int argc, char** argv) |
|
|
|
|
|
{ |
|
|
{ |
|
|
#define OUTPUT_TYPE_STR "Legal values:\n" \ |
|
|
#define OUTPUT_TYPE_STR "Legal values:\n" \ |
|
|
"\tstdout: Print it to standard output\n" \ |
|
|
"\tstdout: Print it to standard output\n" \ |
|
@ -241,7 +231,7 @@ bool SolContext::parseArguments(int argc, char** argv) |
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
bool SolContext::processInput() |
|
|
bool CommandLineInterface::processInput() |
|
|
{ |
|
|
{ |
|
|
if (!m_args.count("input-file")) |
|
|
if (!m_args.count("input-file")) |
|
|
{ |
|
|
{ |
|
@ -302,7 +292,7 @@ bool SolContext::processInput() |
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void SolContext::actOnInput() |
|
|
void CommandLineInterface::actOnInput() |
|
|
{ |
|
|
{ |
|
|
// do we need AST output?
|
|
|
// do we need AST output?
|
|
|
if (m_args.count("ast")) |
|
|
if (m_args.count("ast")) |