Skip to content

Commit

Permalink
Suggestion to use stripPrefix has been implemented for RESULT.
Browse files Browse the repository at this point in the history
For consistency also implemented for arguments.
  • Loading branch information
albert-github committed Jan 1, 2015
1 parent 21f9e87 commit 6720a71
Showing 1 changed file with 14 additions and 25 deletions.
39 changes: 14 additions & 25 deletions src/fortranscanner.l
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2232,14 +2232,10 @@ static void subrHandleCommentBlock(const QCString &doc,bool brief)
current->inbodyDocs = ""; current->inbodyDocs = "";


// strip \\param or @param, so we can do some extra checking. We will add it later on again. // strip \\param or @param, so we can do some extra checking. We will add it later on again.
if (loc_doc.find("\\param") == 0) if (!loc_doc.stripPrefix("\\param") &&
{ !loc_doc.stripPrefix("@param")
loc_doc = loc_doc.right(loc_doc.length()-strlen("\\param")).stripWhiteSpace(); ); // Do nothing work has been done by stripPrefix
} loc_doc.stripWhiteSpace();
else if (loc_doc.find("@param") == 0)
{
loc_doc = loc_doc.right(loc_doc.length()-strlen("@param")).stripWhiteSpace();
}


// direction as defined with the declaration of the parameter // direction as defined with the declaration of the parameter
int dir1 = modifiers[current_root][argName.lower()].direction; int dir1 = modifiers[current_root][argName.lower()].direction;
Expand All @@ -2252,6 +2248,7 @@ static void subrHandleCommentBlock(const QCString &doc,bool brief)
{ {
// strip direction // strip direction
loc_doc = loc_doc.right(loc_doc.length()-strlen(directionParam[SymbolModifiers::IN])); loc_doc = loc_doc.right(loc_doc.length()-strlen(directionParam[SymbolModifiers::IN]));
loc_doc.stripWhiteSpace();
// in case of emty documentation or (now) just name, consider it as no documemntation // in case of emty documentation or (now) just name, consider it as no documemntation
if (loc_doc.isEmpty() || (loc_doc.lower() == argName.lower())) if (loc_doc.isEmpty() || (loc_doc.lower() == argName.lower()))
{ {
Expand All @@ -2278,6 +2275,7 @@ static void subrHandleCommentBlock(const QCString &doc,bool brief)
(directionParam[dir1] == directionParam[SymbolModifiers::OUT])) (directionParam[dir1] == directionParam[SymbolModifiers::OUT]))
{ {
loc_doc = loc_doc.right(loc_doc.length()-strlen(directionParam[SymbolModifiers::OUT])); loc_doc = loc_doc.right(loc_doc.length()-strlen(directionParam[SymbolModifiers::OUT]));
loc_doc.stripWhiteSpace();
if (loc_doc.isEmpty() || (loc_doc.lower() == argName.lower())) if (loc_doc.isEmpty() || (loc_doc.lower() == argName.lower()))
{ {
current=tmp_entry; current=tmp_entry;
Expand All @@ -2301,6 +2299,7 @@ static void subrHandleCommentBlock(const QCString &doc,bool brief)
(directionParam[dir1] == directionParam[SymbolModifiers::INOUT])) (directionParam[dir1] == directionParam[SymbolModifiers::INOUT]))
{ {
loc_doc = loc_doc.right(loc_doc.length()-strlen(directionParam[SymbolModifiers::INOUT])); loc_doc = loc_doc.right(loc_doc.length()-strlen(directionParam[SymbolModifiers::INOUT]));
loc_doc.stripWhiteSpace();
if (loc_doc.isEmpty() || (loc_doc.lower() == argName.lower())) if (loc_doc.isEmpty() || (loc_doc.lower() == argName.lower()))
{ {
current=tmp_entry; current=tmp_entry;
Expand Down Expand Up @@ -2345,23 +2344,13 @@ static void subrHandleCommentBlockResult(const QCString &doc,bool brief)
// Still in the specification section so no inbodyDocs yet, but parameter documentation // Still in the specification section so no inbodyDocs yet, but parameter documentation
current->inbodyDocs = ""; current->inbodyDocs = "";


// strip \\param or @param, so we can do some extra checking. We will add it later on again. // strip \\returns or @returns. We will add it later on again.
if (loc_doc.find("\\returns") == 0) if (!loc_doc.stripPrefix("\\returns") &&
{ !loc_doc.stripPrefix("\\return") &&
loc_doc = loc_doc.right(loc_doc.length()-strlen("\\returns")).stripWhiteSpace(); !loc_doc.stripPrefix("@returns") &&
} !loc_doc.stripPrefix("@return")
else if (loc_doc.find("@returns") == 0) ); // Do nothing work has been done by stripPrefix
{ loc_doc.stripWhiteSpace();
loc_doc = loc_doc.right(loc_doc.length()-strlen("@returns")).stripWhiteSpace();
}
if (loc_doc.find("\\return") == 0)
{
loc_doc = loc_doc.right(loc_doc.length()-strlen("\\return")).stripWhiteSpace();
}
else if (loc_doc.find("@return") == 0)
{
loc_doc = loc_doc.right(loc_doc.length()-strlen("@return")).stripWhiteSpace();
}


if (loc_doc.isEmpty() || (loc_doc.lower() == argName.lower())) if (loc_doc.isEmpty() || (loc_doc.lower() == argName.lower()))
{ {
Expand Down

0 comments on commit 6720a71

Please sign in to comment.