mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Adding Libraries as source units
This commit is contained in:
+4
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user