aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/interface
diff options
context:
space:
mode:
Diffstat (limited to 'libsolidity/interface')
-rw-r--r--libsolidity/interface/AssemblyStack.cpp23
-rw-r--r--libsolidity/interface/AssemblyStack.h2
2 files changed, 22 insertions, 3 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;
}
diff --git a/libsolidity/interface/AssemblyStack.h b/libsolidity/interface/AssemblyStack.h
index 2ae596ed..6ae7e8d1 100644
--- a/libsolidity/interface/AssemblyStack.h
+++ b/libsolidity/interface/AssemblyStack.h
@@ -51,7 +51,7 @@ struct MachineAssemblyObject
class AssemblyStack
{
public:
- enum class Language { JULIA, Assembly };
+ enum class Language { JULIA, Assembly, StrictAssembly };
enum class Machine { EVM, EVM15, eWasm };
explicit AssemblyStack(Language _language = Language::Assembly):