aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/inlineasm/AsmData.h
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-05-26 17:24:38 +0800
committerGitHub <noreply@github.com>2017-05-26 17:24:38 +0800
commitec676ba9f208d16c1ceb88eda98ff555fa1da7c2 (patch)
treec50f864332bad1bbcb2577b254310bb21274dd52 /libsolidity/inlineasm/AsmData.h
parent7126aadab1ecb1eea004c45a7348af2a4d919b36 (diff)
parent05fcf1989ca619d197d22d3acab79b25ef7aa695 (diff)
downloaddexon-solidity-ec676ba9f208d16c1ceb88eda98ff555fa1da7c2.tar
dexon-solidity-ec676ba9f208d16c1ceb88eda98ff555fa1da7c2.tar.gz
dexon-solidity-ec676ba9f208d16c1ceb88eda98ff555fa1da7c2.tar.bz2
dexon-solidity-ec676ba9f208d16c1ceb88eda98ff555fa1da7c2.tar.lz
dexon-solidity-ec676ba9f208d16c1ceb88eda98ff555fa1da7c2.tar.xz
dexon-solidity-ec676ba9f208d16c1ceb88eda98ff555fa1da7c2.tar.zst
dexon-solidity-ec676ba9f208d16c1ceb88eda98ff555fa1da7c2.zip
Merge pull request #2224 from ethereum/julia-switch
Implement switch statement in the assembly parser/printer
Diffstat (limited to 'libsolidity/inlineasm/AsmData.h')
-rw-r--r--libsolidity/inlineasm/AsmData.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/libsolidity/inlineasm/AsmData.h b/libsolidity/inlineasm/AsmData.h
index 3b4048c3..72afeef1 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::shared_ptr<Literal> value; Block body; };
+/// Switch statement
+struct Switch { SourceLocation location; std::shared_ptr<Statement> expression; std::vector<Case> cases; };
struct LocationExtractor: boost::static_visitor<SourceLocation>
{