diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2005-03-28 13:38:53 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2005-03-28 13:38:53 (GMT) |
commit | c8be4837b6a2a96cc3e57aa941645b9dc017e8b2 (patch) | |
tree | 8e755f934e036b4b48c96948a075bf607fadc0cf /src/commentscan.l | |
parent | 2fcc16df64d2af93fc0bb01617f8531116118e8d (diff) | |
download | Doxygen-c8be4837b6a2a96cc3e57aa941645b9dc017e8b2.zip Doxygen-c8be4837b6a2a96cc3e57aa941645b9dc017e8b2.tar.gz Doxygen-c8be4837b6a2a96cc3e57aa941645b9dc017e8b2.tar.bz2 |
Release-1.4.2
Diffstat (limited to 'src/commentscan.l')
-rw-r--r-- | src/commentscan.l | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/src/commentscan.l b/src/commentscan.l index 0ea11ed..225706b 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -43,6 +43,7 @@ #include "membergroup.h" #include "reflist.h" #include "code.h" +#include "debug.h" // forward declarations static void handleBrief(const QCString &); @@ -602,9 +603,19 @@ static inline void setOutput(OutputContext ctx) switch(inContext) { case OutputDoc: + if (current->docFile.isEmpty()) + { + current->docFile = yyFileName; + current->docLine = yyLineNr; + } pOutputString = ¤t->doc; break; case OutputBrief: + if (current->briefFile.isEmpty()) + { + current->briefFile = yyFileName; + current->briefLine = yyLineNr; + } pOutputString = ¤t->brief; break; case OutputXRef: @@ -667,8 +678,7 @@ OL [oO][lL] DL [dD][lL] IMG [iI][mM][gG] HR [hH][rR] -CODE [cC][oO][dD][eE] -DETAILEDHTML {PRE}|{UL}|{TABLE}|{OL}|{DL}|{P}|[Hh][1-6]|{IMG}|{HR}|{CODE} +DETAILEDHTML {PRE}|{UL}|{TABLE}|{OL}|{DL}|{P}|[Hh][1-6]|{IMG}|{HR} BN [ \t\n\r] BL [ \t\r]*"\n" B [ \t] @@ -1421,7 +1431,7 @@ SCOPENAME "$"?(({ID}?{BN}*"::"{BN}*)*)((~{BN}*)?{ID}) BEGIN( Comment ); } } -<SkipGuardedSection>{CMD}"else"/{NW}] { +<SkipGuardedSection>{CMD}"else"/{NW} { if (guards.isEmpty()) { warn(yyFileName,yyLineNr, @@ -2011,18 +2021,16 @@ bool parseCommentBlock(/* in,out */ Entry *curEntry, { //fprintf(stderr,"parseCommentBlock() isBrief=%d isJavaDocStyle=%d lineNr=%d\n", // isBrief,isJavaDocStyle,lineNr); + initParser(); guards.setAutoDelete(TRUE); guards.clear(); - //current_root = rootEntry; current = curEntry; - //previous = prevEntry; inputString = comment; if (inputString==0) return FALSE; // avoid empty strings inputPosition = 0; yyLineNr = lineNr; yyFileName = fileName; - //inBody = foundInBody; protection = prot; needNewEntry = FALSE; xrefKind = XRef_None; @@ -2040,11 +2048,20 @@ bool parseCommentBlock(/* in,out */ Entry *curEntry, warn(yyFileName,yyLineNr,"Documentation block ended in the middle of a conditional section!"); } + // strip any leading/trailing whitespace + current->doc=current->doc.stripWhiteSpace(); + if (current->section==Entry::FILEDOC_SEC && current->doc.isEmpty()) { // to allow a comment block with just a @file command. current->doc="\n\n"; } + + Debug::print(Debug::CommentScan,0,"CommentScanner\n%s:%d\n" + "input=[%s]\nbrief=[%s]\ndocs=[%s]\n------------\n", + fileName.data(),lineNr,comment.data(), + current->brief.data(),current->doc.data() + ); checkFormula(); prot = protection; |