aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-06-03 04:52:48 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-06-07 21:42:22 +0800
commitaa310f9fec9bba90da2f1f57d77270dab673c6f4 (patch)
tree9889ba3e7bc5146fd6a8d98e552c07e4b981515c
parent502304f30b1dfa45a936d500c173858baf5735df (diff)
downloaddexon-solidity-aa310f9fec9bba90da2f1f57d77270dab673c6f4.tar
dexon-solidity-aa310f9fec9bba90da2f1f57d77270dab673c6f4.tar.gz
dexon-solidity-aa310f9fec9bba90da2f1f57d77270dab673c6f4.tar.bz2
dexon-solidity-aa310f9fec9bba90da2f1f57d77270dab673c6f4.tar.lz
dexon-solidity-aa310f9fec9bba90da2f1f57d77270dab673c6f4.tar.xz
dexon-solidity-aa310f9fec9bba90da2f1f57d77270dab673c6f4.tar.zst
dexon-solidity-aa310f9fec9bba90da2f1f57d77270dab673c6f4.zip
Refactor AssemblyStack
-rw-r--r--libsolidity/interface/AssemblyStack.cpp10
-rw-r--r--libsolidity/interface/AssemblyStack.h1
2 files changed, 7 insertions, 4 deletions
diff --git a/libsolidity/interface/AssemblyStack.cpp b/libsolidity/interface/AssemblyStack.cpp
index a571a008..347de350 100644
--- a/libsolidity/interface/AssemblyStack.cpp
+++ b/libsolidity/interface/AssemblyStack.cpp
@@ -51,10 +51,7 @@ bool AssemblyStack::parseAndAnalyze(std::string const& _sourceName, std::string
return false;
solAssert(m_parserResult, "");
- m_analysisInfo = make_shared<assembly::AsmAnalysisInfo>();
- assembly::AsmAnalyzer analyzer(*m_analysisInfo, m_errorReporter);
- m_analysisSuccessful = analyzer.analyze(*m_parserResult);
- return m_analysisSuccessful;
+ return analyzeParsed();
}
bool AssemblyStack::analyze(assembly::Block const& _block, Scanner const* _scanner)
@@ -65,6 +62,11 @@ bool AssemblyStack::analyze(assembly::Block const& _block, Scanner const* _scann
m_scanner = make_shared<Scanner>(*_scanner);
m_parserResult = make_shared<assembly::Block>(_block);
+ return analyzeParsed();
+}
+
+bool AssemblyStack::analyzeParsed()
+{
m_analysisInfo = make_shared<assembly::AsmAnalysisInfo>();
assembly::AsmAnalyzer analyzer(*m_analysisInfo, m_errorReporter);
m_analysisSuccessful = analyzer.analyze(*m_parserResult);
diff --git a/libsolidity/interface/AssemblyStack.h b/libsolidity/interface/AssemblyStack.h
index f13a25ca..abecaae2 100644
--- a/libsolidity/interface/AssemblyStack.h
+++ b/libsolidity/interface/AssemblyStack.h
@@ -74,6 +74,7 @@ public:
std::string print();
private:
+ bool analyzeParsed();
Language m_language = Language::Assembly;