From d6396ee85fd21424568074c41a131e8c52961983 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 26 Apr 2017 23:58:34 +0100 Subject: Parse types in Julia mode --- libsolidity/inlineasm/AsmScope.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'libsolidity/inlineasm/AsmScope.h') 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 const& _arguments, std::vector const& _returns): arguments(_arguments), returns(_returns) {} + std::vector arguments; + std::vector returns; }; using Identifier = boost::variant; using Visitor = GenericVisitor; using NonconstVisitor = GenericVisitor; - 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 const& _arguments, + std::vector 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 -- cgit