diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2018-01-04 20:04:19 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-04 20:04:19 +0800 |
commit | 2cdd789b5d371de6612dadb4ae9a18359cf150df (patch) | |
tree | 963ca2fdf9cf4859fb894205576592622ca934da /libsolidity/inlineasm/AsmData.h | |
parent | 14db10b21480ef0876e05ececa7e395ae05326a0 (diff) | |
parent | ca0d244bf7252e76b640f88fbefd6b497a4e9d09 (diff) | |
download | dexon-solidity-2cdd789b5d371de6612dadb4ae9a18359cf150df.tar dexon-solidity-2cdd789b5d371de6612dadb4ae9a18359cf150df.tar.gz dexon-solidity-2cdd789b5d371de6612dadb4ae9a18359cf150df.tar.bz2 dexon-solidity-2cdd789b5d371de6612dadb4ae9a18359cf150df.tar.lz dexon-solidity-2cdd789b5d371de6612dadb4ae9a18359cf150df.tar.xz dexon-solidity-2cdd789b5d371de6612dadb4ae9a18359cf150df.tar.zst dexon-solidity-2cdd789b5d371de6612dadb4ae9a18359cf150df.zip |
Merge pull request #3297 from ethereum/separate_expression_and_statement
Separate expression and statement
Diffstat (limited to 'libsolidity/inlineasm/AsmData.h')
-rw-r--r-- | libsolidity/inlineasm/AsmData.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/libsolidity/inlineasm/AsmData.h b/libsolidity/inlineasm/AsmData.h index 11e56fae..2982d5e0 100644 --- a/libsolidity/inlineasm/AsmData.h +++ b/libsolidity/inlineasm/AsmData.h @@ -58,23 +58,25 @@ struct StackAssignment { SourceLocation location; Identifier variableName; }; /// Multiple assignment ("x, y := f()"), where the left hand side variables each occupy /// a single stack slot and expects a single expression on the right hand returning /// the same amount of items as the number of variables. -struct Assignment { SourceLocation location; std::vector<Identifier> variableNames; std::shared_ptr<Statement> value; }; +struct Assignment { SourceLocation location; std::vector<Identifier> variableNames; std::shared_ptr<Expression> value; }; /// Functional instruction, e.g. "mul(mload(20:u256), add(2:u256, x))" -struct FunctionalInstruction { SourceLocation location; solidity::Instruction instruction; std::vector<Statement> arguments; }; -struct FunctionCall { SourceLocation location; Identifier functionName; std::vector<Statement> arguments; }; +struct FunctionalInstruction { SourceLocation location; solidity::Instruction instruction; std::vector<Expression> arguments; }; +struct FunctionCall { SourceLocation location; Identifier functionName; std::vector<Expression> arguments; }; +/// Statement that contains only a single expression +struct ExpressionStatement { SourceLocation location; Expression expression; }; /// Block-scope variable declaration ("let x:u256 := mload(20:u256)"), non-hoisted -struct VariableDeclaration { SourceLocation location; TypedNameList variables; std::shared_ptr<Statement> value; }; +struct VariableDeclaration { SourceLocation location; TypedNameList variables; std::shared_ptr<Expression> value; }; /// Block that creates a scope (frees declared stack variables) struct Block { SourceLocation location; std::vector<Statement> statements; }; /// Function definition ("function f(a, b) -> (d, e) { ... }") struct FunctionDefinition { SourceLocation location; std::string name; TypedNameList parameters; TypedNameList returnVariables; Block body; }; /// Conditional execution without "else" part. -struct If { SourceLocation location; std::shared_ptr<Statement> condition; Block body; }; +struct If { SourceLocation location; std::shared_ptr<Expression> condition; 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 ForLoop { SourceLocation location; Block pre; std::shared_ptr<Statement> condition; Block post; Block body; }; +struct Switch { SourceLocation location; std::shared_ptr<Expression> expression; std::vector<Case> cases; }; +struct ForLoop { SourceLocation location; Block pre; std::shared_ptr<Expression> condition; Block post; Block body; }; struct LocationExtractor: boost::static_visitor<SourceLocation> { |