r181517 - [doc parsing]: don't attempt to fix single character

jahanian fjahanian at apple.com
Thu May 9 09:30:30 PDT 2013


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 <fjahanian at apple.com> 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
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130509/f2830193/attachment.html>


More information about the cfe-commits mailing list