mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #9255 from ethereum/solidity-upgrade-constructor
[BREAKING] solidity-upgrade: added module to remove visibility of constructors
This commit is contained in:
@@ -133,7 +133,8 @@ public:
|
||||
return regex_replace(
|
||||
_location.text(),
|
||||
_regex,
|
||||
_expression + " " + _keyword
|
||||
_expression + " " + _keyword,
|
||||
std::regex_constants::format_first_only
|
||||
);
|
||||
else
|
||||
solAssert(
|
||||
@@ -275,6 +276,14 @@ public:
|
||||
{
|
||||
return regex_replace(_location.text(), std::regex{"now"}, "block.timestamp");
|
||||
}
|
||||
|
||||
static std::string removeVisibility(langutil::SourceLocation const& _location)
|
||||
{
|
||||
std::string replacement = _location.text();
|
||||
for (auto const& replace: {"public ", "public", "internal ", "internal", "external ", "external"})
|
||||
replacement = regex_replace(replacement, std::regex{replace}, "");
|
||||
return replacement;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user