@@ -51,6 +51,14 @@ namespace swift {
5151 // / Determine the part of speech for the given word.
5252 PartOfSpeech getPartOfSpeech (StringRef word);
5353
54+ // / Scratch space used for returning a set of StringRefs.
55+ class StringScratchSpace {
56+ llvm::BumpPtrAllocator Allocator;
57+
58+ public:
59+ StringRef copyString (StringRef string);
60+ };
61+
5462 namespace camel_case {
5563 class WordIterator ;
5664
@@ -219,6 +227,16 @@ namespace swift {
219227 // / unchanged.
220228 StringRef toLowercaseWord (StringRef string, SmallVectorImpl<char > &scratch);
221229
230+ // / Lowercase the first word within the given camelCase string.
231+ // /
232+ // / \param string The string to lowercase.
233+ // / \param scratch Scratch buffer used to form the resulting string.
234+ // /
235+ // / \returns the string with the first word lowercased. When the
236+ // / first word is an acronym, the string will be returned
237+ // / unchanged.
238+ StringRef toLowercaseWord (StringRef string, StringScratchSpace &scratch);
239+
222240 // / Sentence-case the given camelCase string by turning the first
223241 // / letter into an uppercase letter.
224242 // /
@@ -358,14 +376,6 @@ struct OmissionTypeName {
358376// / would produce "ByAppendingString".
359377StringRef matchLeadingTypeName (StringRef name, OmissionTypeName typeName);
360378
361- // / Scratch space used for returning a set of StringRefs.
362- class StringScratchSpace {
363- llvm::BumpPtrAllocator Allocator;
364-
365- public:
366- StringRef copyString (StringRef string);
367- };
368-
369379// / Describes a set of names with an inheritance relationship.
370380class InheritedNameSet {
371381 const InheritedNameSet *Parent;
0 commit comments