mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
JuliaType -> YulType
This commit is contained in:
parent
e0d95a6641
commit
e1d0bfe1ca
@ -32,7 +32,7 @@ bool Scope::registerLabel(string const& _name)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Scope::registerVariable(string const& _name, JuliaType const& _type)
|
||||
bool Scope::registerVariable(string const& _name, YulType const& _type)
|
||||
{
|
||||
if (exists(_name))
|
||||
return false;
|
||||
@ -42,7 +42,7 @@ bool Scope::registerVariable(string const& _name, JuliaType const& _type)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Scope::registerFunction(string const& _name, std::vector<JuliaType> const& _arguments, std::vector<JuliaType> const& _returns)
|
||||
bool Scope::registerFunction(string const& _name, std::vector<YulType> const& _arguments, std::vector<YulType> const& _returns)
|
||||
{
|
||||
if (exists(_name))
|
||||
return false;
|
||||
|
@ -62,27 +62,27 @@ struct GenericVisitor<>: public boost::static_visitor<> {
|
||||
|
||||
struct Scope
|
||||
{
|
||||
using JuliaType = std::string;
|
||||
using YulType = std::string;
|
||||
using LabelID = size_t;
|
||||
|
||||
struct Variable { JuliaType type; };
|
||||
struct Variable { YulType type; };
|
||||
struct Label { };
|
||||
struct Function
|
||||
{
|
||||
std::vector<JuliaType> arguments;
|
||||
std::vector<JuliaType> returns;
|
||||
std::vector<YulType> arguments;
|
||||
std::vector<YulType> 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, JuliaType const& _type);
|
||||
bool registerVariable(std::string const& _name, YulType const& _type);
|
||||
bool registerLabel(std::string const& _name);
|
||||
bool registerFunction(
|
||||
std::string const& _name,
|
||||
std::vector<JuliaType> const& _arguments,
|
||||
std::vector<JuliaType> const& _returns
|
||||
std::vector<YulType> const& _arguments,
|
||||
std::vector<YulType> const& _returns
|
||||
);
|
||||
|
||||
/// Looks up the identifier in this or super scopes and returns a valid pointer if found
|
||||
|
@ -75,10 +75,10 @@ bool ScopeFiller::operator()(assembly::VariableDeclaration const& _varDecl)
|
||||
bool ScopeFiller::operator()(assembly::FunctionDefinition const& _funDef)
|
||||
{
|
||||
bool success = true;
|
||||
vector<Scope::JuliaType> arguments;
|
||||
vector<Scope::YulType> arguments;
|
||||
for (auto const& _argument: _funDef.parameters)
|
||||
arguments.push_back(_argument.type);
|
||||
vector<Scope::JuliaType> returns;
|
||||
vector<Scope::YulType> returns;
|
||||
for (auto const& _return: _funDef.returnVariables)
|
||||
returns.push_back(_return.type);
|
||||
if (!m_currentScope->registerFunction(_funDef.name, arguments, returns))
|
||||
|
Loading…
Reference in New Issue
Block a user