diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2013-05-09 16:44:02 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2013-05-09 16:44:02 +0000 |
| commit | 5cd4c41422b8d65a08e0ec007743d7a0ae72ec27 (patch) | |
| tree | f84f1004c6cf8ea0d13b6e15cd76b24d31dad495 /lib/AST/CommentLexer.cpp | |
| parent | 0332e0a1bb8f96c83cfbbbe90a3708a85f409f5e (diff) | |
| download | clang-5cd4c41422b8d65a08e0ec007743d7a0ae72ec27.tar.gz clang-5cd4c41422b8d65a08e0ec007743d7a0ae72ec27.tar.bz2 clang-5cd4c41422b8d65a08e0ec007743d7a0ae72ec27.tar.xz | |
[doc parsing]: So, in this patch, single character
'commands' will not go through typo fixit logic,
preserving the old behavior (no typo, no diagnostics).
// rdar://12381408
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181521 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/CommentLexer.cpp')
| -rw-r--r-- | lib/AST/CommentLexer.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/AST/CommentLexer.cpp b/lib/AST/CommentLexer.cpp index b195d52e8e..c589219f06 100644 --- a/lib/AST/CommentLexer.cpp +++ b/lib/AST/CommentLexer.cpp @@ -355,6 +355,10 @@ void Lexer::lexCommentText(Token &T) { if (!Info) { formTokenWithChars(T, TokenPtr, tok::unknown_command); T.setUnknownCommandName(CommandName); + // single character command impostures, such as \t or \n must not go + // through the fixit logic. + if (CommandName.size() <= 1) + return; if ((Info = Traits.getTypoCorrectCommandInfo(CommandName))) { StringRef CorrectedName = Info->Name; SourceRange CommandRange(T.getLocation().getLocWithOffset(1), |
