mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Simplify expectIdentifierToken by using expectToken
This commit is contained in:
@@ -992,7 +992,7 @@ BOOST_AUTO_TEST_CASE(keyword_is_reserved)
|
||||
for (const auto& keyword: keywords)
|
||||
{
|
||||
auto text = std::string("contract ") + keyword + " {}";
|
||||
CHECK_PARSE_ERROR(text.c_str(), "Expected identifier");
|
||||
CHECK_PARSE_ERROR(text.c_str(), "Expected token Identifier got reserved keyword");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -326,8 +326,8 @@ BOOST_AUTO_TEST_CASE(compilation_error)
|
||||
{
|
||||
BOOST_CHECK_EQUAL(
|
||||
dev::jsonCompactPrint(error),
|
||||
"{\"component\":\"general\",\"formattedMessage\":\"fileA:1:23: ParserError: Expected identifier, got 'RBrace'\\n"
|
||||
"contract A { function }\\n ^\\n\",\"message\":\"Expected identifier, got 'RBrace'\","
|
||||
"{\"component\":\"general\",\"formattedMessage\":\"fileA:1:23: ParserError: Expected token Identifier got 'RBrace'\\n"
|
||||
"contract A { function }\\n ^\\n\",\"message\":\"Expected token Identifier got 'RBrace'\","
|
||||
"\"severity\":\"error\",\"sourceLocation\":{\"end\":22,\"file\":\"fileA\",\"start\":22},\"type\":\"ParserError\"}"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,4 +2,4 @@ contract Foo {
|
||||
uint constant = 4;
|
||||
}
|
||||
// ----
|
||||
// ParserError: (30-30): Expected identifier, got 'Assign'
|
||||
// ParserError: (30-30): Expected token Identifier got 'Assign'
|
||||
|
||||
@@ -2,4 +2,4 @@ contract c {
|
||||
uint external x;
|
||||
}
|
||||
// ----
|
||||
// ParserError: (19-19): Expected identifier, got 'External'
|
||||
// ParserError: (19-19): Expected token Identifier got 'External'
|
||||
|
||||
@@ -2,4 +2,4 @@ contract Foo {
|
||||
uint[] memory x;
|
||||
}
|
||||
// ----
|
||||
// ParserError: (23-23): Expected identifier, got 'Memory'
|
||||
// ParserError: (23-23): Expected token Identifier got 'Memory'
|
||||
|
||||
@@ -3,4 +3,4 @@ contract test {
|
||||
function b() returns (uint r) { r = a({: 1, : 2, : 3}); }
|
||||
}
|
||||
// ----
|
||||
// ParserError: (143-143): Expected identifier, got 'Colon'
|
||||
// ParserError: (143-143): Expected token Identifier got 'Colon'
|
||||
|
||||
@@ -2,4 +2,4 @@ contract test {
|
||||
uint256 ;
|
||||
}
|
||||
// ----
|
||||
// ParserError: (28-28): Expected identifier, got 'Semicolon'
|
||||
// ParserError: (28-28): Expected token Identifier got 'Semicolon'
|
||||
|
||||
@@ -2,4 +2,4 @@ contract test {
|
||||
uint payable x;
|
||||
}
|
||||
// ----
|
||||
// ParserError: (22-22): Expected identifier, got 'Payable'
|
||||
// ParserError: (22-22): Expected token Identifier got 'Payable'
|
||||
|
||||
@@ -2,4 +2,4 @@ contract Foo {
|
||||
function f() { var[] a; }
|
||||
}
|
||||
// ----
|
||||
// ParserError: (34-34): Expected identifier, got 'LBrack'
|
||||
// ParserError: (34-34): Expected token Identifier got 'LBrack'
|
||||
|
||||
Reference in New Issue
Block a user