mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
AsmParser: Require whitespace before tags in location comments
This commit is contained in:
parent
14396c207c
commit
fbdfc6bb7a
@ -131,7 +131,7 @@ void Parser::fetchSourceLocationFromComment()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
static regex const tagRegex = regex(
|
static regex const tagRegex = regex(
|
||||||
R"~~(\s*(@[a-zA-Z0-9\-_]+)(?:\s+|$))~~", // tag, e.g: @src
|
R"~~((?:^|\s+)(@[a-zA-Z0-9\-_]+)(?:\s+|$))~~", // tag, e.g: @src
|
||||||
regex_constants::ECMAScript | regex_constants::optimize
|
regex_constants::ECMAScript | regex_constants::optimize
|
||||||
);
|
);
|
||||||
static regex const srcTagArgsRegex = regex(
|
static regex const srcTagArgsRegex = regex(
|
||||||
|
@ -534,7 +534,7 @@ BOOST_AUTO_TEST_CASE(customSourceLocations_invalid_prefix)
|
|||||||
EVMDialectTyped const& dialect = EVMDialectTyped::instance(EVMVersion{});
|
EVMDialectTyped const& dialect = EVMDialectTyped::instance(EVMVersion{});
|
||||||
shared_ptr<Block> result = parse(sourceText, dialect, reporter);
|
shared_ptr<Block> result = parse(sourceText, dialect, reporter);
|
||||||
BOOST_REQUIRE(!!result && errorList.size() == 0);
|
BOOST_REQUIRE(!!result && errorList.size() == 0);
|
||||||
CHECK_LOCATION(result->debugData->location, "source0", 111, 222);
|
CHECK_LOCATION(result->debugData->location, "", -1, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(customSourceLocations_unspecified)
|
BOOST_AUTO_TEST_CASE(customSourceLocations_unspecified)
|
||||||
|
Loading…
Reference in New Issue
Block a user