mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Display nicer error messages in the parser (display tokens and not internal names)
This commit is contained in:
parent
81d61ca086
commit
e3279d8af8
@ -4,6 +4,7 @@ Features:
|
|||||||
* Build System: Update internal dependency of jsoncpp to 1.8.4, which introduces more strictness and reduces memory usage.
|
* Build System: Update internal dependency of jsoncpp to 1.8.4, which introduces more strictness and reduces memory usage.
|
||||||
* Code Generator: Use native shift instructions on target Constantinople.
|
* Code Generator: Use native shift instructions on target Constantinople.
|
||||||
* Optimizer: Remove unnecessary masking of the result of known short instructions (``ADDRESS``, ``CALLER``, ``ORIGIN`` and ``COINBASE``).
|
* 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.
|
||||||
* Type Checker: Deprecate the ``years`` unit denomination and raise a warning for it (or an error as experimental 0.5.0 feature).
|
* 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: Make literals (without explicit type casting) an error for tight packing as experimental 0.5.0 feature.
|
||||||
|
|
||||||
|
@ -71,10 +71,10 @@ void ParserBase::expectToken(Token::Value _value, bool _advance)
|
|||||||
if (Token::isReservedKeyword(tok))
|
if (Token::isReservedKeyword(tok))
|
||||||
{
|
{
|
||||||
fatalParserError(
|
fatalParserError(
|
||||||
string("Expected token ") +
|
string("Expected '") +
|
||||||
string(Token::name(_value)) +
|
string(Token::toString(_value)) +
|
||||||
string(" got reserved keyword '") +
|
string("' but got reserved keyword '") +
|
||||||
string(Token::name(tok)) +
|
string(Token::toString(tok)) +
|
||||||
string("'")
|
string("'")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -82,19 +82,19 @@ void ParserBase::expectToken(Token::Value _value, bool _advance)
|
|||||||
{
|
{
|
||||||
ElementaryTypeNameToken elemTypeName = m_scanner->currentElementaryTypeNameToken();
|
ElementaryTypeNameToken elemTypeName = m_scanner->currentElementaryTypeNameToken();
|
||||||
fatalParserError(
|
fatalParserError(
|
||||||
string("Expected token ") +
|
string("Expected '") +
|
||||||
string(Token::name(_value)) +
|
string(Token::toString(_value)) +
|
||||||
string(" got '") +
|
string("' but got '") +
|
||||||
elemTypeName.toString() +
|
elemTypeName.toString() +
|
||||||
string("'")
|
string("'")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
fatalParserError(
|
fatalParserError(
|
||||||
string("Expected token ") +
|
string("Expected '") +
|
||||||
string(Token::name(_value)) +
|
string(Token::toString(_value)) +
|
||||||
string(" got '") +
|
string("' but got '") +
|
||||||
string(Token::name(m_scanner->currentToken())) +
|
string(Token::toString(m_scanner->currentToken())) +
|
||||||
string("'")
|
string("'")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user