Oops. This is not quite right. I need to leave single character commands completely alone. - Fariborz
On May 9, 2013, at 9:22 AM, Fariborz Jahanian <[email protected]> wrote: > Author: fjahanian > Date: Thu May 9 11:22:31 2013 > New Revision: 181517 > > URL: http://llvm.org/viewvc/llvm-project?rev=181517&view=rev > Log: > [doc parsing]: don't attempt to fix single character > commands (\t \n are common). \\ rdar://12381408 > > Modified: > cfe/trunk/lib/AST/CommentCommandTraits.cpp > cfe/trunk/test/Sema/warn-documentation-fixits.cpp > > Modified: cfe/trunk/lib/AST/CommentCommandTraits.cpp > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/CommentCommandTraits.cpp?rev=181517&r1=181516&r2=181517&view=diff > ============================================================================== > --- cfe/trunk/lib/AST/CommentCommandTraits.cpp (original) > +++ cfe/trunk/lib/AST/CommentCommandTraits.cpp Thu May 9 11:22:31 2013 > @@ -49,6 +49,10 @@ HelperTypoCorrectCommandInfo(SmallVector > const unsigned MaxEditDistance = 1; > unsigned BestEditDistance = MaxEditDistance + 1; > StringRef Name = Command->Name; > + // Don't attempt trying to typo fix single character commands. > + // \t and \n are very common > + if (Name.size() <= 1) > + return; > > unsigned MinPossibleEditDistance = abs((int)Name.size() - (int)Typo.size()); > if (MinPossibleEditDistance > 0 && > > Modified: cfe/trunk/test/Sema/warn-documentation-fixits.cpp > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/warn-documentation-fixits.cpp?rev=181517&r1=181516&r2=181517&view=diff > ============================================================================== > --- cfe/trunk/test/Sema/warn-documentation-fixits.cpp (original) > +++ cfe/trunk/test/Sema/warn-documentation-fixits.cpp Thu May 9 11:22:31 2013 > @@ -67,6 +67,9 @@ int FooBar(); > /// \fooba bbb IS_DOXYGEN_END > int gorf(); > > +/// \t bbb IS_DOXYGEN_END > +int Bar(); > + > // CHECK: fix-it:"{{.*}}":{5:12-5:22}:"a" > // CHECK: fix-it:"{{.*}}":{9:12-9:15}:"aaa" > // CHECK: fix-it:"{{.*}}":{13:13-13:23}:"T" > > > _______________________________________________ > cfe-commits mailing list > [email protected] > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
