Use new escaping helpers for type identifiers

This commit is contained in:
Alex Beregszaszi 2018-02-24 01:13:34 +01:00
parent 842fd0cd2c
commit 26047b784b

View File

@ -261,6 +261,17 @@ string Type::escapeIdentifier(string const& _identifier)
return ret;
}
string Type::unescapeIdentifier(string const& _identifier)
{
string ret = _identifier;
// FIXME: should be _$$$_
boost::algorithm::replace_all(ret, "$$$", "$");
boost::algorithm::replace_all(ret, "_$_", ",");
boost::algorithm::replace_all(ret, "$_", "(");
boost::algorithm::replace_all(ret, "_$", ")");
return ret;
}
TypePointer Type::fromElementaryTypeName(ElementaryTypeNameToken const& _type)
{
solAssert(Token::isElementaryTypeName(_type.token()),