diff options
Diffstat (limited to 'src/commentscan.l')
-rw-r--r-- | src/commentscan.l | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/commentscan.l b/src/commentscan.l index dc80846..82178d4 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -656,24 +656,31 @@ static inline void setOutput(OutputContext ctx) } } + int oldContext = inContext; inContext = ctx; if (inContext!=OutputXRef && inBody) inContext=OutputInbody; switch(inContext) { case OutputDoc: - stripTrailingWhiteSpace(current->doc); - if (current->docFile.isEmpty()) + if (oldContext!=inContext) { - current->docFile = yyFileName; - current->docLine = yyLineNr; + stripTrailingWhiteSpace(current->doc); + if (current->docFile.isEmpty()) + { + current->docFile = yyFileName; + current->docLine = yyLineNr; + } } pOutputString = ¤t->doc; break; case OutputBrief: - if (current->briefFile.isEmpty()) + if (oldContext!=inContext) { - current->briefFile = yyFileName; - current->briefLine = yyLineNr; + if (current->briefFile.isEmpty()) + { + current->briefFile = yyFileName; + current->briefLine = yyLineNr; + } } pOutputString = ¤t->brief; break; |