aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/inlineasm/AsmParser.h
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-01-10 22:25:53 +0800
committerGitHub <noreply@github.com>2018-01-10 22:25:53 +0800
commita75d5333d8ae614316b9c707e2022c2d144eaf33 (patch)
tree24ae6722975b86c4702d12feb825f3e3aa8663c5 /libsolidity/inlineasm/AsmParser.h
parent2548228b365d56612e2f039f735be0fdf6ce0807 (diff)
parent8b20a7cd53b04a4b3b3e26df4ddd9ad81d28bb1b (diff)
downloaddexon-solidity-a75d5333d8ae614316b9c707e2022c2d144eaf33.tar.gz
dexon-solidity-a75d5333d8ae614316b9c707e2022c2d144eaf33.tar.zst
dexon-solidity-a75d5333d8ae614316b9c707e2022c2d144eaf33.zip
Merge pull request #3317 from ethereum/looseStrictAsm
Split inline assembly into loose and strict flavour.
Diffstat (limited to 'libsolidity/inlineasm/AsmParser.h')
-rw-r--r--libsolidity/inlineasm/AsmParser.h8
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;
};
}