mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Move string distance function to utils and format error message
This commit is contained in:
committed by
Alex Beregszaszi
parent
2859834e58
commit
b1417b318f
@@ -431,13 +431,13 @@ string NameAndTypeResolver::similarNameSuggestions(ASTString const& _name) const
|
||||
if (suggestions.empty())
|
||||
return "";
|
||||
if (suggestions.size() == 1)
|
||||
return suggestions.front();
|
||||
return "\"" + suggestions.front() + "\"";
|
||||
|
||||
string choices = suggestions.front();
|
||||
string choices = "\"" + suggestions.front() + "\"";
|
||||
for (size_t i = 1; i + 1 < suggestions.size(); ++i)
|
||||
choices += ", " + suggestions[i];
|
||||
choices += ", \"" + suggestions[i] + "\"";
|
||||
|
||||
choices += " or " + suggestions.back();
|
||||
choices += " or \"" + suggestions.back() + "\"";
|
||||
|
||||
return choices;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user