Skip to content

Commit

Permalink
issue #8642 invalid argument for command iline
Browse files Browse the repository at this point in the history
From the string presented to the tokenizer the end spaces are stripped so it is not necessary that a soace is present at the end.
Due to the brief command it is also possible tat a `.` is present at the end.
These cases are handled now.

Furthermore small improvement on warning message.
  • Loading branch information
albert-github committed Jul 2, 2021
1 parent fc67a82 commit 430b59c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/docparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4766,7 +4766,7 @@ void DocPara::handleIline()
int tok = doctokenizerYYlex();
if (tok!=TK_WORD)
{
warn_doc_error(g_parserContext.fileName,getDoctokinizerLineNr(),"invalid argument for command iline\n");
warn_doc_error(g_parserContext.fileName,getDoctokinizerLineNr(),"invalid argument for command '\\iline'\n");
return;
}
doctokenizerYYsetStatePara();
Expand Down
8 changes: 6 additions & 2 deletions src/doctokenizer.l
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ REFWORD4 {REFWORD4_NOCV}{CVSPEC}?
REFWORD {FILEMASK}|{LABELID}|{REFWORD2}|{REFWORD3}|{REFWORD4}
REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
RCSID "$"("Author"|"Date"|"Header"|"Id"|"Locker"|"Log"|"Name"|"RCSfile"|"Revision"|"Source"|"State")":"[^:\n$][^\n$]*"$"
LINENR {BLANK}*[1-9][0-9]*{BLANK}
LINENR {BLANK}*[1-9][0-9]*

%option noyywrap

Expand Down Expand Up @@ -1301,7 +1301,11 @@ LINENR {BLANK}*[1-9][0-9]*{BLANK}
<St_Emoji>. {
return 0;
}
<St_Iline>{LINENR} {
<St_Iline>{LINENR}/[\n\.] {
g_yyLineNr = QCString(yytext).toInt();
return TK_WORD;
}
<St_Iline>{LINENR}{BLANK} {
g_yyLineNr = QCString(yytext).toInt();
return TK_WORD;
}
Expand Down

0 comments on commit 430b59c

Please sign in to comment.