mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Cleaner solution to provide standard sources.
This commit is contained in:
+4
-6
@@ -59,7 +59,8 @@ extern const std::map<std::string, std::string> StandardSources;
|
||||
class CompilerStack: boost::noncopyable
|
||||
{
|
||||
public:
|
||||
CompilerStack(): m_parseSuccessful(false) {}
|
||||
/// Creates a new compiler stack. Adds standard sources if @a _addStandardSources.
|
||||
explicit CompilerStack(bool _addStandardSources = true);
|
||||
|
||||
/// Adds a source object (e.g. file) to the parser. After this, parse has to be called again.
|
||||
/// @returns true if a source object by the name already existed and was replaced.
|
||||
@@ -68,7 +69,7 @@ public:
|
||||
void setSource(std::string const& _sourceCode);
|
||||
/// Parses all source units that were added
|
||||
void parse();
|
||||
/// Sets the given source code as the only source unit and parses it.
|
||||
/// Sets the given source code as the only source unit apart from standard sources and parses it.
|
||||
void parse(std::string const& _sourceCode);
|
||||
/// Returns a list of the contract names in the sources.
|
||||
std::vector<std::string> getContractNames() const;
|
||||
@@ -141,16 +142,13 @@ private:
|
||||
Contract();
|
||||
};
|
||||
|
||||
/// Expand source code with preprocessor-like includes.
|
||||
/// @todo Replace with better framework.
|
||||
std::string expanded(std::string const& _sourceCode);
|
||||
|
||||
void reset(bool _keepSources = false);
|
||||
void resolveImports();
|
||||
|
||||
Contract const& getContract(std::string const& _contractName = "") const;
|
||||
Source const& getSource(std::string const& _sourceName = "") const;
|
||||
|
||||
bool m_addStandardSources; ///< If true, standard sources are added.
|
||||
bool m_parseSuccessful;
|
||||
std::map<std::string const, Source> m_sources;
|
||||
std::shared_ptr<GlobalContext> m_globalContext;
|
||||
|
||||
Reference in New Issue
Block a user