[doc parsing]: make single character command impostures

warn in pedantic mode.

llvm-svn: 181523
This commit is contained in:
Fariborz Jahanian 2013-05-09 17:18:52 +00:00
parent fc4f7dc0a6
commit 0321b8ffd6
3 changed files with 9 additions and 4 deletions

View File

@ -68,6 +68,11 @@ HelperTypoCorrectCommandInfo(SmallVectorImpl<const CommandInfo *> &BestCommand,
const CommandInfo * const CommandInfo *
CommandTraits::getTypoCorrectCommandInfo(StringRef Typo) const { CommandTraits::getTypoCorrectCommandInfo(StringRef Typo) const {
// single character command impostures, such as \t or \n must not go
// through the fixit logic.
if (Typo.size() <= 1)
return NULL;
SmallVector<const CommandInfo *, 2> BestCommand; SmallVector<const CommandInfo *, 2> BestCommand;
int NumOfCommands = sizeof(Commands) / sizeof(CommandInfo); int NumOfCommands = sizeof(Commands) / sizeof(CommandInfo);

View File

@ -355,10 +355,6 @@ void Lexer::lexCommentText(Token &T) {
if (!Info) { if (!Info) {
formTokenWithChars(T, TokenPtr, tok::unknown_command); formTokenWithChars(T, TokenPtr, tok::unknown_command);
T.setUnknownCommandName(CommandName); 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))) { if ((Info = Traits.getTypoCorrectCommandInfo(CommandName))) {
StringRef CorrectedName = Info->Name; StringRef CorrectedName = Info->Name;
SourceRange CommandRange(T.getLocation().getLocWithOffset(1), SourceRange CommandRange(T.getLocation().getLocWithOffset(1),

View File

@ -172,3 +172,7 @@ struct S;
@struct S1 THIS IS IT @struct S1 THIS IS IT
*/ */
@interface S1 @end @interface S1 @end
// expected-warning@+1 {{unknown command tag name}}
/// \t bbb IS_DOXYGEN_END
int FooBar();