aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/parsing/Parser.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-09-05 02:21:03 +0800
committerGitHub <noreply@github.com>2018-09-05 02:21:03 +0800
commit85debe77d9b616a37ecf0ed080045b3747b3aa7d (patch)
tree95ae6123afb0caf32ecb2405a54aa34635ee71ca /libsolidity/parsing/Parser.cpp
parentc9f50b36aac0328d65fa4061e982ce26b997add6 (diff)
parent3d7b0d691f8b5f86cd81bd56f2a40508832e9a0e (diff)
downloaddexon-solidity-85debe77d9b616a37ecf0ed080045b3747b3aa7d.tar.gz
dexon-solidity-85debe77d9b616a37ecf0ed080045b3747b3aa7d.tar.zst
dexon-solidity-85debe77d9b616a37ecf0ed080045b3747b3aa7d.zip
Merge pull request #4866 from bakaoh/issue4743
Fix#4743: Incorrect source location for nameless parameters
Diffstat (limited to 'libsolidity/parsing/Parser.cpp')
-rw-r--r--libsolidity/parsing/Parser.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/libsolidity/parsing/Parser.cpp b/libsolidity/parsing/Parser.cpp
index bfa0ad24..c9c26f57 100644
--- a/libsolidity/parsing/Parser.cpp
+++ b/libsolidity/parsing/Parser.cpp
@@ -572,6 +572,7 @@ ASTPointer<VariableDeclaration> Parser::parseVariableDeclaration(
Token::Value token = m_scanner->currentToken();
if (_options.isStateVariable && Token::isVariableVisibilitySpecifier(token))
{
+ nodeFactory.markEndPosition();
if (visibility != Declaration::Visibility::Default)
{
parserError(string(
@@ -616,21 +617,21 @@ ASTPointer<VariableDeclaration> Parser::parseVariableDeclaration(
}
else
break;
+ nodeFactory.markEndPosition();
m_scanner->next();
}
}
- nodeFactory.markEndPosition();
if (_options.allowEmptyName && m_scanner->currentToken() != Token::Identifier)
{
identifier = make_shared<ASTString>("");
solAssert(!_options.allowVar, ""); // allowEmptyName && allowVar makes no sense
- if (type)
- nodeFactory.setEndPositionFromNode(type);
- // if type is null this has already caused an error
}
else
+ {
+ nodeFactory.markEndPosition();
identifier = expectIdentifierToken();
+ }
ASTPointer<Expression> value;
if (_options.allowInitialValue)
{