diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-04-28 21:27:56 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-05-26 10:16:09 +0800 |
commit | b5080860d5f2d141b8fccceaa635378a86c996a8 (patch) | |
tree | a68c289d101e5f4d3a990da2e8c7608bb4f0fcbc /libsolidity/inlineasm/AsmData.h | |
parent | af2d2499c1ccd431f5ac9455c2cbb63d3891f9b0 (diff) | |
download | dexon-solidity-b5080860d5f2d141b8fccceaa635378a86c996a8.tar.gz dexon-solidity-b5080860d5f2d141b8fccceaa635378a86c996a8.tar.zst dexon-solidity-b5080860d5f2d141b8fccceaa635378a86c996a8.zip |
Implement switch statement in the assembly parser/printer
Diffstat (limited to 'libsolidity/inlineasm/AsmData.h')
-rw-r--r-- | libsolidity/inlineasm/AsmData.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libsolidity/inlineasm/AsmData.h b/libsolidity/inlineasm/AsmData.h index 3b4048c3..92ff1c5a 100644 --- a/libsolidity/inlineasm/AsmData.h +++ b/libsolidity/inlineasm/AsmData.h @@ -50,9 +50,10 @@ struct VariableDeclaration; struct FunctionalInstruction; struct FunctionDefinition; struct FunctionCall; +struct Switch; struct Block; -using Statement = boost::variant<Instruction, Literal, Label, StackAssignment, Identifier, Assignment, FunctionCall, FunctionalInstruction, VariableDeclaration, FunctionDefinition, Block>; +using Statement = boost::variant<Instruction, Literal, Label, StackAssignment, Identifier, Assignment, FunctionCall, FunctionalInstruction, VariableDeclaration, FunctionDefinition, Switch, Block>; /// Direct EVM instruction (except PUSHi and JUMPDEST) struct Instruction { SourceLocation location; solidity::Instruction instruction; }; @@ -77,6 +78,10 @@ struct VariableDeclaration { SourceLocation location; TypedNameList variables; s struct Block { SourceLocation location; std::vector<Statement> statements; }; /// Function definition ("function f(a, b) -> (d, e) { ... }") struct FunctionDefinition { SourceLocation location; std::string name; TypedNameList arguments; TypedNameList returns; Block body; }; +/// Switch case or default case +struct Case { SourceLocation location; std::string name; Block body; }; +/// Switch statement +struct Switch { SourceLocation location; std::shared_ptr<Statement> expression; std::vector<Case> cases; }; struct LocationExtractor: boost::static_visitor<SourceLocation> { |