mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Omit needless words] The preposition "of" binds to the word preceding it.
This commit is contained in:
@@ -830,10 +830,6 @@ static bool wordConflictsBeforePreposition(StringRef word,
|
||||
camel_case::sameWordIgnoreFirstCase(word, "compatible"))
|
||||
return true;
|
||||
|
||||
if (camel_case::sameWordIgnoreFirstCase(preposition, "of") &&
|
||||
camel_case::sameWordIgnoreFirstCase(word, "kind"))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -877,6 +873,10 @@ static bool shouldPlacePrepositionOnArgLabel(StringRef beforePreposition,
|
||||
afterPreposition == "Z")
|
||||
return false;
|
||||
|
||||
// The preposition "of" binds tightly to the left word.
|
||||
if (camel_case::sameWordIgnoreFirstCase(preposition, "of"))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user