diff options
author | chriseth <chris@ethereum.org> | 2017-02-17 03:12:31 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-17 03:12:31 +0800 |
commit | 7bdc4ddab2be7990d09f102606f788f054da41db (patch) | |
tree | aadf29b475d77125da7101eeebaba7a4c6d8638a /libsolidity/inlineasm/AsmData.h | |
parent | 0ad8e53404514413761b198f42424cb2c1989b9a (diff) | |
parent | 01fcd989b57d31fa8fc63720401ffc77698ee57b (diff) | |
download | dexon-solidity-7bdc4ddab2be7990d09f102606f788f054da41db.tar dexon-solidity-7bdc4ddab2be7990d09f102606f788f054da41db.tar.gz dexon-solidity-7bdc4ddab2be7990d09f102606f788f054da41db.tar.bz2 dexon-solidity-7bdc4ddab2be7990d09f102606f788f054da41db.tar.lz dexon-solidity-7bdc4ddab2be7990d09f102606f788f054da41db.tar.xz dexon-solidity-7bdc4ddab2be7990d09f102606f788f054da41db.tar.zst dexon-solidity-7bdc4ddab2be7990d09f102606f788f054da41db.zip |
Merge pull request #1627 from ethereum/asmfunctions
Parsing assembly function definitions and calls.
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 d622ff54..d61b5803 100644 --- a/libsolidity/inlineasm/AsmData.h +++ b/libsolidity/inlineasm/AsmData.h @@ -48,17 +48,22 @@ struct Label { SourceLocation location; std::string name; }; struct Assignment { SourceLocation location; Identifier variableName; }; struct FunctionalAssignment; struct VariableDeclaration; +struct FunctionDefinition; +struct FunctionCall; struct Block; -using Statement = boost::variant<Instruction, Literal, Label, Assignment, Identifier, FunctionalAssignment, FunctionalInstruction, VariableDeclaration, Block>; +using Statement = boost::variant<Instruction, Literal, Label, Assignment, Identifier, FunctionalAssignment, FunctionCall, FunctionalInstruction, VariableDeclaration, FunctionDefinition, Block>; /// Functional assignment ("x := mload(20)", expects push-1-expression on the right hand /// side and requires x to occupy exactly one stack slot. struct FunctionalAssignment { SourceLocation location; Identifier variableName; std::shared_ptr<Statement> value; }; /// Functional instruction, e.g. "mul(mload(20), add(2, x))" struct FunctionalInstruction { SourceLocation location; Instruction instruction; std::vector<Statement> arguments; }; +struct FunctionCall { SourceLocation location; Identifier functionName; std::vector<Statement> arguments; }; /// Block-scope variable declaration ("let x := mload(20)"), non-hoisted struct VariableDeclaration { SourceLocation location; std::string name; std::shared_ptr<Statement> 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; std::vector<std::string> arguments; std::vector<std::string> returns; Block body; }; struct LocationExtractor: boost::static_visitor<SourceLocation> { |