diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-04-27 06:58:34 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-05-06 05:31:22 +0800 |
commit | d6396ee85fd21424568074c41a131e8c52961983 (patch) | |
tree | cc0fa48f71be625bc40f67ee15ca0ef903f84fbc /libsolidity/inlineasm/AsmScope.h | |
parent | b0f2a5c162480ab6ecdc5e1397567242a137768a (diff) | |
download | dexon-solidity-d6396ee85fd21424568074c41a131e8c52961983.tar.gz dexon-solidity-d6396ee85fd21424568074c41a131e8c52961983.tar.zst dexon-solidity-d6396ee85fd21424568074c41a131e8c52961983.zip |
Parse types in Julia mode
Diffstat (limited to 'libsolidity/inlineasm/AsmScope.h')
-rw-r--r-- | libsolidity/inlineasm/AsmScope.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/libsolidity/inlineasm/AsmScope.h b/libsolidity/inlineasm/AsmScope.h index b70bee67..dd45613d 100644 --- a/libsolidity/inlineasm/AsmScope.h +++ b/libsolidity/inlineasm/AsmScope.h @@ -61,6 +61,8 @@ struct GenericVisitor<>: public boost::static_visitor<> { struct Scope { + using JuliaType = std::string; + struct Variable { /// Used during code generation to store the stack height. @todo move there. @@ -68,6 +70,7 @@ struct Scope /// Used during analysis to check whether we already passed the declaration inside the block. /// @todo move there. bool active = false; + JuliaType type; }; struct Label @@ -78,18 +81,22 @@ struct Scope struct Function { - Function(size_t _arguments, size_t _returns): arguments(_arguments), returns(_returns) {} - size_t arguments = 0; - size_t returns = 0; + Function(std::vector<JuliaType> const& _arguments, std::vector<JuliaType> const& _returns): arguments(_arguments), returns(_returns) {} + std::vector<JuliaType> arguments; + std::vector<JuliaType> returns; }; using Identifier = boost::variant<Variable, Label, Function>; using Visitor = GenericVisitor<Variable const, Label const, Function const>; using NonconstVisitor = GenericVisitor<Variable, Label, Function>; - bool registerVariable(std::string const& _name); + bool registerVariable(std::string const& _name, JuliaType const& _type); bool registerLabel(std::string const& _name); - bool registerFunction(std::string const& _name, size_t _arguments, size_t _returns); + bool registerFunction( + std::string const& _name, + std::vector<JuliaType> const& _arguments, + std::vector<JuliaType> const& _returns + ); /// Looks up the identifier in this or super scopes and returns a valid pointer if found /// or a nullptr if not found. Variable lookups up across function boundaries will fail, as |