Disable the ability to use '$' as an identifier harder

When in Swift 3 Compatibility Mode we now acceptable a standalone
'$' as an identifier.  In all other cases this is now disallowed
and must be surrounded by backticks.
This commit is contained in:
Robert Widmann
2016-10-13 11:47:05 -04:00
parent 23525d984a
commit 6accc5989e
5 changed files with 80 additions and 22 deletions

View File

@@ -28,7 +28,8 @@ using namespace swift;
using namespace camel_case;
bool swift::canBeArgumentLabel(StringRef identifier) {
if (identifier == "var" || identifier == "let" || identifier == "inout")
if (identifier == "var" || identifier == "let" || identifier == "inout" ||
identifier == "$")
return false;
return true;