diff options
author | wbt <wbt@users.noreply.github.com> | 2018-01-23 22:44:37 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-23 22:44:37 +0800 |
commit | 761eae2499b172334e5ea3e75573af99fae2a975 (patch) | |
tree | 3ec324015e8d97e9b7ca43cb4dcc3c46b1b3bf31 /libsolidity/interface/AssemblyStack.cpp | |
parent | 7c69d88f937324b64ed8825f9e611e417421434b (diff) | |
parent | e5def2da3d9b6cffbff42e2c9e1941831d2fe5ea (diff) | |
download | dexon-solidity-761eae2499b172334e5ea3e75573af99fae2a975.tar dexon-solidity-761eae2499b172334e5ea3e75573af99fae2a975.tar.gz dexon-solidity-761eae2499b172334e5ea3e75573af99fae2a975.tar.bz2 dexon-solidity-761eae2499b172334e5ea3e75573af99fae2a975.tar.lz dexon-solidity-761eae2499b172334e5ea3e75573af99fae2a975.tar.xz dexon-solidity-761eae2499b172334e5ea3e75573af99fae2a975.tar.zst dexon-solidity-761eae2499b172334e5ea3e75573af99fae2a975.zip |
Update from official repo
Diffstat (limited to 'libsolidity/interface/AssemblyStack.cpp')
-rw-r--r-- | libsolidity/interface/AssemblyStack.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/libsolidity/interface/AssemblyStack.cpp b/libsolidity/interface/AssemblyStack.cpp index 504ad92c..1b4bd270 100644 --- a/libsolidity/interface/AssemblyStack.cpp +++ b/libsolidity/interface/AssemblyStack.cpp @@ -38,6 +38,25 @@ using namespace std; using namespace dev; using namespace dev::solidity; +namespace +{ +assembly::AsmFlavour languageToAsmFlavour(AssemblyStack::Language _language) +{ + switch (_language) + { + case AssemblyStack::Language::Assembly: + return assembly::AsmFlavour::Loose; + case AssemblyStack::Language::StrictAssembly: + return assembly::AsmFlavour::Strict; + case AssemblyStack::Language::JULIA: + return assembly::AsmFlavour::IULIA; + } + solAssert(false, ""); + return assembly::AsmFlavour::IULIA; +} + +} + Scanner const& AssemblyStack::scanner() const { @@ -50,7 +69,7 @@ bool AssemblyStack::parseAndAnalyze(std::string const& _sourceName, std::string m_errors.clear(); m_analysisSuccessful = false; m_scanner = make_shared<Scanner>(CharStream(_source), _sourceName); - m_parserResult = assembly::Parser(m_errorReporter, m_language == Language::JULIA).parse(m_scanner); + m_parserResult = assembly::Parser(m_errorReporter, languageToAsmFlavour(m_language)).parse(m_scanner); if (!m_errorReporter.errors().empty()) return false; solAssert(m_parserResult, ""); @@ -72,7 +91,7 @@ bool AssemblyStack::analyze(assembly::Block const& _block, Scanner const* _scann bool AssemblyStack::analyzeParsed() { m_analysisInfo = make_shared<assembly::AsmAnalysisInfo>(); - assembly::AsmAnalyzer analyzer(*m_analysisInfo, m_errorReporter, m_language == Language::JULIA); + assembly::AsmAnalyzer analyzer(*m_analysisInfo, m_errorReporter, languageToAsmFlavour(m_language)); m_analysisSuccessful = analyzer.analyze(*m_parserResult); return m_analysisSuccessful; } |