aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Kirchner <daniel@ekpyron.org>2018-05-09 19:02:20 +0800
committerDaniel Kirchner <daniel@ekpyron.org>2018-05-09 20:08:22 +0800
commit02380113d417b298282c81bf35ddb596006ce77a (patch)
tree60400b00f1dda9d9ef23bea28ce8c238af68f372
parent87826a7d87991f9c054d27def6fb9a79eb18e3ae (diff)
downloaddexon-solidity-02380113d417b298282c81bf35ddb596006ce77a.tar
dexon-solidity-02380113d417b298282c81bf35ddb596006ce77a.tar.gz
dexon-solidity-02380113d417b298282c81bf35ddb596006ce77a.tar.bz2
dexon-solidity-02380113d417b298282c81bf35ddb596006ce77a.tar.lz
dexon-solidity-02380113d417b298282c81bf35ddb596006ce77a.tar.xz
dexon-solidity-02380113d417b298282c81bf35ddb596006ce77a.tar.zst
dexon-solidity-02380113d417b298282c81bf35ddb596006ce77a.zip
Use the entire token as source location for parser errors.
-rw-r--r--Changelog.md1
-rw-r--r--libsolidity/parsing/ParserBase.cpp4
2 files changed, 3 insertions, 2 deletions
diff --git a/Changelog.md b/Changelog.md
index a87c8dd4..9004dc29 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -6,6 +6,7 @@ Features:
* Gas Estimator: Only explore paths with higher gas costs. This reduces accuracy but greatly improves the speed of gas estimation.
* Optimizer: Remove unnecessary masking of the result of known short instructions (``ADDRESS``, ``CALLER``, ``ORIGIN`` and ``COINBASE``).
* Parser: Display nicer error messages by showing the actual tokens and not internal names.
+ * Parser: Use the entire location of the token instead of only its starting position as source location for parser errors.
* Type Checker: Deprecate the ``years`` unit denomination and raise a warning for it (or an error as experimental 0.5.0 feature).
* Type Checker: Make literals (without explicit type casting) an error for tight packing as experimental 0.5.0 feature.
* Type Checker: Warn about wildcard tuple assignments (this will turn into an error with version 0.5.0).
diff --git a/libsolidity/parsing/ParserBase.cpp b/libsolidity/parsing/ParserBase.cpp
index d0c7a551..71133746 100644
--- a/libsolidity/parsing/ParserBase.cpp
+++ b/libsolidity/parsing/ParserBase.cpp
@@ -106,10 +106,10 @@ void ParserBase::decreaseRecursionDepth()
void ParserBase::parserError(string const& _description)
{
- m_errorReporter.parserError(SourceLocation(position(), position(), sourceName()), _description);
+ m_errorReporter.parserError(SourceLocation(position(), endPosition(), sourceName()), _description);
}
void ParserBase::fatalParserError(string const& _description)
{
- m_errorReporter.fatalParserError(SourceLocation(position(), position(), sourceName()), _description);
+ m_errorReporter.fatalParserError(SourceLocation(position(), endPosition(), sourceName()), _description);
}