summaryrefslogtreecommitdiffstats
path: root/src/scanner.l
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2002-11-15 14:41:06 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2002-11-15 14:41:06 (GMT)
commite952dab58265a6f21867e51f72d7d81ffe39e082 (patch)
treeaa3814339507e0a58216fe75837a5f055b2405e2 /src/scanner.l
parentc400bd439b3df09704e33df382ed7b08f80dd8ed (diff)
downloadDoxygen-e952dab58265a6f21867e51f72d7d81ffe39e082.zip
Doxygen-e952dab58265a6f21867e51f72d7d81ffe39e082.tar.gz
Doxygen-e952dab58265a6f21867e51f72d7d81ffe39e082.tar.bz2
Release-1.3-rc1
Diffstat (limited to 'src/scanner.l')
-rw-r--r--src/scanner.l86
1 files changed, 63 insertions, 23 deletions
diff --git a/src/scanner.l b/src/scanner.l
index 6d055eb..67ec602 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -657,6 +657,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
%x GetCallType
%x JavaImport
%x CSAccessorDecl
+%x PreLineCtrl
%%
@@ -1356,6 +1357,17 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
current->bodyLine = yyLineNr;
BEGIN( Define );
}
+<FindMembers>{B}*"#"{B}+[0-9]+{B}+/"\"" { /* line control directive */
+ yyLineNr = atoi(&yytext[1]);
+ BEGIN( PreLineCtrl );
+ }
+<PreLineCtrl>"\""[^\n\"]*"\"" {
+ strncpy(yyFileName,stripQuotes(yytext),4096);
+ }
+<PreLineCtrl>. {}
+<PreLineCtrl>\n {
+ BEGIN(FindMembers);
+ }
<SkipCPP>.
<SkipCPP>\\[\r]*"\n"[\r]* { yyLineNr++ ; }
<SkipCPP>[\r]*\n[\r]* { yyLineNr++ ;
@@ -2587,6 +2599,14 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
}
else
{
+ if (!Config_getBool("HIDE_IN_BODY_DOCS") &&
+ !current->doc.isEmpty())
+ {
+ // copy documentation found inside the body
+ // to the previous item
+ previous->doc += current->doc;
+ current->doc.resize(0);
+ }
previous->endBodyLine=yyLineNr;
BEGIN( lastCurlyContext ) ;
}
@@ -2943,16 +2963,12 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
//printf("Start doc block at %d\n",yyLineNr);
removeSlashes=(yytext[1]=='/');
tmpDocType=-1;
- if (YY_START==ReadBody)
- {
- current->doc+="\n\n";
- }
- else
+ if (YY_START!=SkipCurly)
{
- current->doc.resize(0);
+ current->doc.resize(0);
+ current->docLine = yyLineNr;
+ current->docFile = yyFileName;
}
- current->docLine = yyLineNr;
- current->docFile = yyFileName;
lastDocContext = YY_START;
if (current_root->section & Entry::SCOPE_MASK)
{
@@ -2978,27 +2994,27 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
if (!Config_getBool("JAVADOC_AUTOBRIEF")) // use the Qt style
{
tmpDocType=-1;
- if (YY_START==ReadBody)
+ if (!Config_getBool("HIDE_IN_BODY_DOCS") &&
+ YY_START==SkipCurly) // inside body
{
current->doc+="\n\n";
}
else
{
current->doc.resize(0);
+ current->docLine = yyLineNr;
+ current->docFile = yyFileName;
}
- current->docLine = yyLineNr;
- current->docFile = yyFileName;
BEGIN( Doc );
}
else // Use the javadoc style
{
- if (YY_START==ReadBody)
+ if (!Config_getBool("HIDE_IN_BODY_DOCS") &&
+ YY_START==SkipCurly) // inside body
{
tmpDocType=-1;
current->doc+="\n\n";
- lastDocContext = ReadBody;
- current->docLine = yyLineNr;
- current->docFile = yyFileName;
+ lastDocContext = SkipCurly;
BEGIN( Doc );
}
else
@@ -3014,10 +3030,13 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
}
}
}
-<FindMembers,FindFields,MemberSpec,FuncQual,Operator,ClassVar,Bases>"//!" {
- current->brief.resize(0);
- current->briefFile=yyFileName;
- current->briefLine=yyLineNr;
+<FindMembers,FindFields,MemberSpec,SkipCurly,FuncQual,Operator,ClassVar,Bases>"//!" {
+ if (YY_START!=SkipCurly)
+ {
+ current->brief.resize(0);
+ current->briefFile=yyFileName;
+ current->briefLine=yyLineNr;
+ }
tmpDocType=-1;
lastDocContext = YY_START;
if (current_root->section & Entry::SCOPE_MASK)
@@ -3030,10 +3049,13 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
}
BEGIN( LineDoc );
}
-<FindMembers,FindFields,MemberSpec,FuncQual,Operator,ClassVar,Bases>"///"/[^/] {
- current->brief.resize(0);
- current->briefFile=yyFileName;
- current->briefLine=yyLineNr;
+<FindMembers,FindFields,MemberSpec,SkipCurly,FuncQual,Operator,ClassVar,Bases>"///"/[^/] {
+ if (YY_START!=SkipCurly)
+ {
+ current->brief.resize(0);
+ current->briefFile=yyFileName;
+ current->briefLine=yyLineNr;
+ }
tmpDocType=-1;
lastDocContext = YY_START;
if (current_root->section & Entry::SCOPE_MASK)
@@ -4089,6 +4111,10 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
else
{
current->brief += " ";
+ if (!current->doc.isEmpty())
+ {
+ current->doc += "<p>";
+ }
yyLineNr++ ;
}
}
@@ -4194,6 +4220,16 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
<LineDoc>[\n\r]+{B}*"//"[!/] { lineCount(); }
<LineDoc>\n {
yyLineNr++;
+ if (!Config_getBool("HIDE_IN_BODY_DOCS") &&
+ lastDocContext==SkipCurly) // inside body
+ {
+ if (!previous->doc.isEmpty())
+ {
+ previous->doc+="<p>";
+ }
+ previous->doc += current->brief;
+ current->brief.resize(0);
+ }
BEGIN( lastDocContext );
}
<DefLineDoc>\n {
@@ -4318,6 +4354,10 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
checkDocs();
current->doc += "\n\n";
//printf("End of docs at line %d\n",yyLineNr);
+ if (lastDocContext==SkipCurly && Config_getBool("HIDE_IN_BODY_DOCS"))
+ {
+ current->doc.resize(0);
+ }
BEGIN( lastDocContext );
}
<JavaDoc>"*/" {