aboutsummaryrefslogtreecommitdiffstats
path: root/CompilerStack.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'CompilerStack.cpp')
-rw-r--r--CompilerStack.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/CompilerStack.cpp b/CompilerStack.cpp
index b3fedc45..4f976407 100644
--- a/CompilerStack.cpp
+++ b/CompilerStack.cpp
@@ -31,7 +31,7 @@
#include <libsolidity/CompilerStack.h>
#include <libsolidity/InterfaceHandler.h>
-#include <libdevcrypto/SHA3.h>
+#include <libdevcore/SHA3.h>
using namespace std;
@@ -55,12 +55,29 @@ const map<string, string> StandardSources = map<string, string>{
};
CompilerStack::CompilerStack(bool _addStandardSources):
- m_addStandardSources(_addStandardSources), m_parseSuccessful(false)
+ m_parseSuccessful(false)
{
- if (m_addStandardSources)
+ if (_addStandardSources)
addSources(StandardSources, true); // add them as libraries
}
+void CompilerStack::reset(bool _keepSources, bool _addStandardSources)
+{
+ m_parseSuccessful = false;
+ if (_keepSources)
+ for (auto sourcePair: m_sources)
+ sourcePair.second.reset();
+ else
+ {
+ m_sources.clear();
+ if (_addStandardSources)
+ addSources(StandardSources, true);
+ }
+ m_globalContext.reset();
+ m_sourceOrder.clear();
+ m_contracts.clear();
+}
+
bool CompilerStack::addSource(string const& _name, string const& _content, bool _isLibrary)
{
bool existed = m_sources.count(_name) != 0;
@@ -269,23 +286,6 @@ tuple<int, int, int, int> CompilerStack::positionFromSourceLocation(SourceLocati
return make_tuple(++startLine, ++startColumn, ++endLine, ++endColumn);
}
-void CompilerStack::reset(bool _keepSources)
-{
- m_parseSuccessful = false;
- if (_keepSources)
- for (auto sourcePair: m_sources)
- sourcePair.second.reset();
- else
- {
- m_sources.clear();
- if (m_addStandardSources)
- addSources(StandardSources, true);
- }
- m_globalContext.reset();
- m_sourceOrder.clear();
- m_contracts.clear();
-}
-
void CompilerStack::resolveImports()
{
// topological sorting (depth first search) of the import graph, cutting potential cycles