From 26047b784ba9f83d7fc764f382667cfe6e3ca68f Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Sat, 24 Feb 2018 01:13:34 +0100 Subject: [PATCH] Use new escaping helpers for type identifiers --- libsolidity/ast/Types.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp index 51739cb01..8abbbc169 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -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()),