aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/inlineasm/AsmScopeFiller.cpp
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-04-27 06:58:34 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-05-06 05:31:22 +0800
commitd6396ee85fd21424568074c41a131e8c52961983 (patch)
treecc0fa48f71be625bc40f67ee15ca0ef903f84fbc /libsolidity/inlineasm/AsmScopeFiller.cpp
parentb0f2a5c162480ab6ecdc5e1397567242a137768a (diff)
downloaddexon-solidity-d6396ee85fd21424568074c41a131e8c52961983.tar
dexon-solidity-d6396ee85fd21424568074c41a131e8c52961983.tar.gz
dexon-solidity-d6396ee85fd21424568074c41a131e8c52961983.tar.bz2
dexon-solidity-d6396ee85fd21424568074c41a131e8c52961983.tar.lz
dexon-solidity-d6396ee85fd21424568074c41a131e8c52961983.tar.xz
dexon-solidity-d6396ee85fd21424568074c41a131e8c52961983.tar.zst
dexon-solidity-d6396ee85fd21424568074c41a131e8c52961983.zip
Parse types in Julia mode
Diffstat (limited to 'libsolidity/inlineasm/AsmScopeFiller.cpp')
-rw-r--r--libsolidity/inlineasm/AsmScopeFiller.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/libsolidity/inlineasm/AsmScopeFiller.cpp b/libsolidity/inlineasm/AsmScopeFiller.cpp
index 4a651388..eb10dbb3 100644
--- a/libsolidity/inlineasm/AsmScopeFiller.cpp
+++ b/libsolidity/inlineasm/AsmScopeFiller.cpp
@@ -59,13 +59,19 @@ bool ScopeFiller::operator()(Label const& _item)
bool ScopeFiller::operator()(assembly::VariableDeclaration const& _varDecl)
{
- return registerVariable(_varDecl.name, _varDecl.location, *m_currentScope);
+ return registerVariable(_varDecl.variable, _varDecl.location, *m_currentScope);
}
bool ScopeFiller::operator()(assembly::FunctionDefinition const& _funDef)
{
bool success = true;
- if (!m_currentScope->registerFunction(_funDef.name, _funDef.arguments.size(), _funDef.returns.size()))
+ vector<Scope::JuliaType> arguments;
+ for (auto const& _argument: _funDef.arguments)
+ arguments.push_back(_argument.type);
+ vector<Scope::JuliaType> returns;
+ for (auto const& _return: _funDef.returns)
+ returns.push_back(_return.type);
+ if (!m_currentScope->registerFunction(_funDef.name, arguments, returns))
{
//@TODO secondary location
m_errors.push_back(make_shared<Error>(
@@ -102,14 +108,14 @@ bool ScopeFiller::operator()(Block const& _block)
return success;
}
-bool ScopeFiller::registerVariable(string const& _name, SourceLocation const& _location, Scope& _scope)
+bool ScopeFiller::registerVariable(TypedName const& _name, SourceLocation const& _location, Scope& _scope)
{
- if (!_scope.registerVariable(_name))
+ if (!_scope.registerVariable(_name.name, _name.type))
{
//@TODO secondary location
m_errors.push_back(make_shared<Error>(
Error::Type::DeclarationError,
- "Variable name " + _name + " already taken in this scope.",
+ "Variable name " + _name.name + " already taken in this scope.",
_location
));
return false;