diff options
author | Lefteris Karapetsas <lefteris@refu.co> | 2015-02-21 01:15:34 +0800 |
---|---|---|
committer | Lefteris Karapetsas <lefteris@refu.co> | 2015-02-21 23:03:44 +0800 |
commit | 7b709c7c8ad1553feabd294f83e3b7ce2281114a (patch) | |
tree | 63d0ac75e9f3e0f8ad138ff0584851141f2ea0d2 /CompilerStack.h | |
parent | 75498a48d83277240605b43e27197be36c02ce23 (diff) | |
download | dexon-solidity-7b709c7c8ad1553feabd294f83e3b7ce2281114a.tar.gz dexon-solidity-7b709c7c8ad1553feabd294f83e3b7ce2281114a.tar.zst dexon-solidity-7b709c7c8ad1553feabd294f83e3b7ce2281114a.zip |
Adding Libraries as source units
Diffstat (limited to 'CompilerStack.h')
-rw-r--r-- | CompilerStack.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/CompilerStack.h b/CompilerStack.h index cb4770cd..c9642745 100644 --- a/CompilerStack.h +++ b/CompilerStack.h @@ -64,8 +64,8 @@ public: /// 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. - void addSources(std::map<std::string, std::string> const& _nameContents) { for (auto const& i: _nameContents) addSource(i.first, i.second); } - bool addSource(std::string const& _name, std::string const& _content); + void addSources(std::map<std::string, std::string> const& _nameContents, bool _isLibrary = false) { for (auto const& i: _nameContents) addSource(i.first, i.second, _isLibrary); } + bool addSource(std::string const& _name, std::string const& _content, bool _isLibrary = false); void setSource(std::string const& _sourceCode); /// Parses all source units that were added void parse(); @@ -125,7 +125,8 @@ private: std::shared_ptr<Scanner> scanner; std::shared_ptr<SourceUnit> ast; std::string interface; - void reset() { scanner.reset(); ast.reset(); interface.clear(); } + bool isLibrary; + void reset() { scanner.reset(); ast.reset(); interface.clear(); isLibrary = false;} }; struct Contract |