diff options
author | chriseth <chris@ethereum.org> | 2017-12-13 21:40:54 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2018-01-06 09:23:38 +0800 |
commit | 124190336b0a70ea32d5f8ca0c4b364f1fc774d0 (patch) | |
tree | 6be4f7815f417c9343ed57a85ec51f77f0c53aff /libsolidity/inlineasm/AsmParser.h | |
parent | 2548228b365d56612e2f039f735be0fdf6ce0807 (diff) | |
download | dexon-solidity-124190336b0a70ea32d5f8ca0c4b364f1fc774d0.tar.gz dexon-solidity-124190336b0a70ea32d5f8ca0c4b364f1fc774d0.tar.zst dexon-solidity-124190336b0a70ea32d5f8ca0c4b364f1fc774d0.zip |
Split inline assembly into loose and strict flavours.
Diffstat (limited to 'libsolidity/inlineasm/AsmParser.h')
-rw-r--r-- | libsolidity/inlineasm/AsmParser.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libsolidity/inlineasm/AsmParser.h b/libsolidity/inlineasm/AsmParser.h index bd90bb43..015aeef3 100644 --- a/libsolidity/inlineasm/AsmParser.h +++ b/libsolidity/inlineasm/AsmParser.h @@ -37,7 +37,8 @@ namespace assembly class Parser: public ParserBase { public: - explicit Parser(ErrorReporter& _errorReporter, bool _julia = false): ParserBase(_errorReporter), m_julia(_julia) {} + explicit Parser(ErrorReporter& _errorReporter, AsmFlavour _flavour = AsmFlavour::Loose): + ParserBase(_errorReporter), m_flavour(_flavour) {} /// Parses an inline assembly block starting with `{` and ending with `}`. /// @returns an empty shared pointer on error. @@ -70,6 +71,9 @@ protected: assembly::Expression parseExpression(); static std::map<std::string, dev::solidity::Instruction> const& instructions(); static std::map<dev::solidity::Instruction, std::string> const& instructionNames(); + /// Parses an elementary operation, i.e. a literal, identifier or instruction. + /// This will parse instructions even in strict mode as part of the full parser + /// for FunctionalInstruction. ElementaryOperation parseElementaryOperation(); VariableDeclaration parseVariableDeclaration(); FunctionDefinition parseFunctionDefinition(); @@ -80,7 +84,7 @@ protected: static bool isValidNumberLiteral(std::string const& _literal); private: - bool m_julia = false; + AsmFlavour m_flavour = AsmFlavour::Loose; }; } |