summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/clangparser.h2
-rw-r--r--src/code.l8
-rw-r--r--src/commentcnv.l4
-rw-r--r--src/commentscan.l56
-rw-r--r--src/config.xml10
-rw-r--r--src/context.cpp2
-rw-r--r--src/definition.cpp10
-rw-r--r--src/docparser.cpp49
-rw-r--r--src/doctokenizer.l7
-rw-r--r--src/doxygen.cpp2
-rw-r--r--src/fortrancode.l53
-rw-r--r--src/fortranscanner.l49
-rw-r--r--src/htmldocvisitor.cpp14
-rw-r--r--src/htmlgen.cpp10
-rw-r--r--src/latexgen.cpp2
-rw-r--r--src/markdown.cpp4
-rw-r--r--src/memberdef.cpp5
-rw-r--r--src/pyscanner.l39
-rw-r--r--src/scanner.l5
-rw-r--r--src/tclscanner.l17
20 files changed, 224 insertions, 124 deletions
diff --git a/src/clangparser.h b/src/clangparser.h
index 6072208..8bb9aba 100644
--- a/src/clangparser.h
+++ b/src/clangparser.h
@@ -19,7 +19,7 @@ class ClangParser
* @param[in,out] filesInTranslationUnit Other files that are
* part of the input and included by the file.
* The function will return a subset of the files,
- * only including the onces that were actually found
+ * only including the ones that were actually found
* during parsing.
*/
void start(const char *fileName,QStrList &filesInTranslationUnit);
diff --git a/src/code.l b/src/code.l
index d7d5d74..d34412b 100644
--- a/src/code.l
+++ b/src/code.l
@@ -116,6 +116,7 @@ static int g_memCallContext;
static int g_lastCContext;
static int g_skipInlineInitContext;
+static bool g_insideCpp;
static bool g_insideObjC;
static bool g_insideJava;
static bool g_insideCS;
@@ -1823,7 +1824,7 @@ TEMPLIST "<"[^\"\}\{\(\)\/\n\>]*">"
SCOPETNAME (((({ID}{TEMPLIST}?){BN}*)?{SEP}{BN}*)*)((~{BN}*)?{ID})
SCOPEPREFIX ({ID}{TEMPLIST}?{BN}*{SEP}{BN}*)+
KEYWORD_OBJC ("@public"|"@private"|"@protected"|"@class"|"@implementation"|"@interface"|"@end"|"@selector"|"@protocol"|"@optional"|"@required"|"@throw"|"@synthesize"|"@property")
-KEYWORD ("asm"|"__assume"|"auto"|"class"|"const"|"delete"|"enum"|"explicit"|"extern"|"false"|"friend"|"gcnew"|"gcroot"|"set"|"get"|"inline"|"internal"|"mutable"|"namespace"|"new"|"nullptr"|"override"|"operator"|"pin_ptr"|"private"|"protected"|"public"|"raise"|"register"|"remove"|"self"|"sizeof"|"static"|"struct"|"__super"|"function"|"template"|"generic"|"this"|"true"|"typedef"|"typeid"|"typename"|"union"|"using"|"virtual"|"volatile"|"abstract"|"final"|"import"|"synchronized"|"transient"|"alignas"|"alignof"|{KEYWORD_OBJC})
+KEYWORD ("asm"|"__assume"|"auto"|"class"|"const"|"delete"|"enum"|"explicit"|"extern"|"false"|"friend"|"gcnew"|"gcroot"|"set"|"get"|"inline"|"internal"|"mutable"|"namespace"|"new"|"null"|"nullptr"|"override"|"operator"|"pin_ptr"|"private"|"protected"|"public"|"raise"|"register"|"remove"|"self"|"sizeof"|"static"|"struct"|"__super"|"function"|"template"|"generic"|"this"|"true"|"typedef"|"typeid"|"typename"|"union"|"using"|"virtual"|"volatile"|"abstract"|"final"|"import"|"synchronized"|"transient"|"alignas"|"alignof"|{KEYWORD_OBJC})
FLOWKW ("break"|"catch"|"continue"|"default"|"do"|"else"|"finally"|"return"|"switch"|"throw"|"throws"|"@catch"|"@finally")
FLOWCONDITION ("case"|"for"|"foreach"|"for each"|"goto"|"if"|"try"|"while"|"@try")
TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"object"|"short"|"signed"|"unsigned"|"void"|"wchar_t"|"size_t"|"boolean"|"id"|"SEL"|"string"|"nullptr")
@@ -2415,6 +2416,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
g_prefixed_with_this_keyword = TRUE;
}
<Body>{KEYWORD}/([^a-z_A-Z0-9]) {
+ if (g_insideCpp && (QCString(yytext) =="set" ||QCString(yytext) =="get")) REJECT;
startFontClass("keyword");
codifyLines(yytext);
if (QCString(yytext)=="typedef")
@@ -2425,11 +2427,13 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
endFontClass();
}
<Body>{KEYWORD}/{B}* {
+ if (g_insideCpp && (QCString(yytext) =="set" ||QCString(yytext) =="get")) REJECT;
startFontClass("keyword");
codifyLines(yytext);
endFontClass();
}
<Body>{KEYWORD}/{BN}*"(" {
+ if (g_insideCpp && (QCString(yytext) =="set" ||QCString(yytext) =="get")) REJECT;
startFontClass("keyword");
codifyLines(yytext);
endFontClass();
@@ -2984,6 +2988,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
<MemberCall2,FuncCall>{KEYWORD}/([^a-z_A-Z0-9]) {
//addParmType();
//g_parmName=yytext;
+ if (g_insideCpp && (QCString(yytext) =="set" ||QCString(yytext) =="get")) REJECT;
startFontClass("keyword");
g_code->codify(yytext);
endFontClass();
@@ -3742,6 +3747,7 @@ void parseCCode(CodeOutputInterface &od,const char *className,const QCString &s,
g_insideJava = lang==SrcLangExt_Java;
g_insideCS = lang==SrcLangExt_CSharp;
g_insidePHP = lang==SrcLangExt_PHP;
+ g_insideCpp = lang==SrcLangExt_Cpp;
if (g_sourceFileDef)
{
setCurrentDoc("l00001");
diff --git a/src/commentcnv.l b/src/commentcnv.l
index 44e2543..aca7300 100644
--- a/src/commentcnv.l
+++ b/src/commentcnv.l
@@ -1093,7 +1093,9 @@ void convertCppComments(BufStr *inBuf,BufStr *outBuf,const char *fileName)
if (Debug::isFlagSet(Debug::CommentCnv))
{
g_outBuf->at(g_outBuf->curPos())='\0';
- msg("-------------\n%s\n-------------\n",g_outBuf->data());
+ Debug::print(Debug::CommentCnv,0,"-----------\nCommentCnv: %s\n"
+ "output=[\n%s]\n-----------\n",fileName,g_outBuf->data()
+ );
}
printlex(yy_flex_debug, FALSE, __FILE__, fileName);
}
diff --git a/src/commentscan.l b/src/commentscan.l
index 588d40a..07eb28f 100644
--- a/src/commentscan.l
+++ b/src/commentscan.l
@@ -563,14 +563,7 @@ static void addXRefItem(const char *listName,const char *itemTitle,
RefItem *item = refList->getRefItem(lii->itemId);
ASSERT(item!=0);
item->text += " <p>";
- if (Doxygen::markdownSupport)
- {
- item->text += processMarkdown(yyFileName,yyLineNr,current,outputXRef);
- }
- else
- {
- item->text += outputXRef;
- }
+ item->text += outputXRef;
//printf("%s: text +=%s\n",listName,item->text.data());
}
else // new item
@@ -585,14 +578,7 @@ static void addXRefItem(const char *listName,const char *itemTitle,
sprintf(anchorLabel,"_%s%06d",listName,itemId);
RefItem *item = refList->getRefItem(itemId);
ASSERT(item!=0);
- if (Doxygen::markdownSupport)
- {
- item->text = processMarkdown(yyFileName,yyLineNr,current,outputXRef);
- }
- else
- {
- item->text = outputXRef;
- }
+ item->text = outputXRef;
item->listAnchor = anchorLabel;
docEntry->addSpecialListItem(listName,itemId);
QCString cmdString;
@@ -1860,10 +1846,10 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
addOutput(*yytext);
}
<FormatBlock><<EOF>> {
- QCString endTag = "@end"+blockName;
+ QCString endTag = "end"+blockName;
if (blockName=="startuml") endTag="enduml";
warn(yyFileName,yyLineNr,
- "reached end of comment while inside a @%s block; check for missing @%s tag!",
+ "reached end of comment while inside a \\%s block; check for missing \\%s tag!",
blockName.data(),endTag.data()
);
yyterminate();
@@ -1944,7 +1930,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
if (guards.isEmpty())
{
warn(yyFileName,yyLineNr,
- "found @endif without matching start command");
+ "found \\endif without matching start command");
}
else
{
@@ -1962,7 +1948,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
if (guards.isEmpty())
{
warn(yyFileName,yyLineNr,
- "found @else without matching start command");
+ "found \\else without matching start command");
}
else
{
@@ -1979,7 +1965,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
if (guards.isEmpty())
{
warn(yyFileName,yyLineNr,
- "found @elseif without matching start command");
+ "found \\elseif without matching start command");
}
else
{
@@ -2943,7 +2929,19 @@ bool parseCommentBlock(/* in */ ParserInterface *parser,
langParser = parser;
current = curEntry;
if (comment.isEmpty()) return FALSE; // avoid empty strings
- inputString = comment;
+ if (Doxygen::markdownSupport)
+ {
+ inputString = processMarkdown(fileName,lineNr,NULL,comment);
+ QString qq(inputString);
+ while (qq.startsWith(" ")) qq = qq.mid(1);
+ while (qq.startsWith("\n")) qq = qq.mid(1);
+ if (qq.startsWith("<br>")) qq = qq.mid(4);
+ inputString = QCString(qq.data());
+ }
+ else
+ {
+ inputString = comment;
+ }
inputString.append(" ");
inputPosition = position;
yyLineNr = lineNr;
@@ -2970,7 +2968,7 @@ bool parseCommentBlock(/* in */ ParserInterface *parser,
}
Debug::print(Debug::CommentScan,0,"-----------\nCommentScanner: %s:%d\n"
- "input=[\n%s]\n",qPrint(fileName),lineNr,qPrint(comment)
+ "input=[\n%s]\n",qPrint(fileName),lineNr,qPrint(inputString)
);
commentscanYYrestart( commentscanYYin );
@@ -3008,15 +3006,9 @@ bool parseCommentBlock(/* in */ ParserInterface *parser,
openGroup(current,yyFileName,yyLineNr);
}
- if (Doxygen::markdownSupport)
- {
- current->brief = processMarkdown(fileName,lineNr,current,current->brief);
- current->doc = processMarkdown(fileName,lineNr,current,current->doc);
- current->inbodyDocs = processMarkdown(fileName,lineNr,current,current->inbodyDocs);
- }
-
- Debug::print(Debug::CommentScan,0,
- "brief=[line=%d\n%s]\ndocs=[line=%d\n%s]\ninbody=[line=%d\n%s]\n===========\n",
+ Debug::print(Debug::CommentScan,0,"-----------\nCommentScanner: %s:%d\noutput=[\n"
+ "brief=[line=%d\n%s]\ndocs=[line=%d\n%s]\ninbody=[line=%d\n%s]\n]\n===========\n",
+ qPrint(fileName),lineNr,
current->briefLine,qPrint(current->brief),
current->docLine,qPrint(current->doc),
current->inbodyLine,qPrint(current->inbodyDocs)
diff --git a/src/config.xml b/src/config.xml
index 38dfefb..fa0ae26 100644
--- a/src/config.xml
+++ b/src/config.xml
@@ -125,7 +125,7 @@ SEARCHENGINE = YES
\endverbatim
To regenerate the Qt-1.44 documentation from the sources, you could use the
-following config file:
+following configuration file:
\verbatim
PROJECT_NAME = Qt
OUTPUT_DIRECTORY = qt_docs
@@ -212,7 +212,7 @@ Go to the <a href="commands.html">next</a> section or return to the
<option type='string' id='DOXYFILE_ENCODING' format='string' defval='UTF-8'>
<docs>
<![CDATA[
- This tag specifies the encoding used for all characters in the config file that
+ This tag specifies the encoding used for all characters in the configuration file that
follow. The default is UTF-8 which is also the encoding used for all text before
the first occurrence of this tag. Doxygen uses \c libiconv (or the iconv built into
\c libc) for the transcoding. See https://www.gnu.org/software/libiconv/ for the list of
@@ -1606,7 +1606,7 @@ to disable this feature.
<br>
To use it do the following:
-# Install the latest version of \c global
- -# Enable \ref cfg_source_browser "SOURCE_BROWSER" and \c USE_HTAGS in the config file
+ -# Enable \ref cfg_source_browser "SOURCE_BROWSER" and \c USE_HTAGS in the configuration file
-# Make sure the \ref cfg_input "INPUT" points to the root of the source tree
-# Run \c doxygen as normal
<br>
@@ -2772,7 +2772,7 @@ or
<docs>
<![CDATA[
Load stylesheet definitions from file. Syntax is similar to doxygen's
- config file, i.e. a series of assignments. You only have to provide
+ configuration file, i.e. a series of assignments. You only have to provide
replacements, missing definitions are set to their default value.
<br>
See also section \ref doxygen_usage for information on how to generate
@@ -2785,7 +2785,7 @@ or
<docs>
<![CDATA[
Set optional variables used in the generation of an RTF document.
- Syntax is similar to doxygen's config file.
+ Syntax is similar to doxygen's configuration file.
A template extensions file can be generated using
<code>doxygen -e rtf extensionFile</code>.
]]>
diff --git a/src/context.cpp b/src/context.cpp
index 896c4e0..4584920 100644
--- a/src/context.cpp
+++ b/src/context.cpp
@@ -246,7 +246,6 @@ class PropertyMapper
/** Add a property to the map
* @param[in] name The name of the property to add.
- * @param[in] obj The object handling access to the property.
* @param[in] handle The method to call when the property is accessed.
*/
void addProperty(const char *name,typename PropertyFunc::Handler handle)
@@ -262,6 +261,7 @@ class PropertyMapper
}
/** Gets the value of a property.
+ * @param[in] obj The object handling access to the property.
* @param[in] name The name of the property.
* @returns A variant representing the properties value or an
* invalid variant if it was not found.
diff --git a/src/definition.cpp b/src/definition.cpp
index ff30429..92baf0c 100644
--- a/src/definition.cpp
+++ b/src/definition.cpp
@@ -1034,15 +1034,15 @@ void Definition::writeSourceDef(OutputList &ol,const char *)
ol.pushGeneratorState();
ol.disable(OutputGenerator::Man);
- if (!latexSourceCode)
+ ol.disableAllBut(OutputGenerator::Html);
+ if (latexSourceCode)
{
- ol.disable(OutputGenerator::Latex);
+ ol.enable(OutputGenerator::Latex);
}
- if (!rtfSourceCode)
+ if (rtfSourceCode)
{
- ol.disable(OutputGenerator::RTF);
+ ol.enable(OutputGenerator::RTF);
}
- ol.disableAllBut(OutputGenerator::Html);
// write line link (HTML only)
ol.writeObjectLink(0,fn,anchorStr,lineStr);
ol.enableAll();
diff --git a/src/docparser.cpp b/src/docparser.cpp
index 3d57c2e..215439a 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -451,11 +451,12 @@ static void checkArgumentName(const QCString &name,bool isParam)
}
/*! Checks if the parameters that have been specified using \@param are
- * indeed all parameters.
+ * indeed all parameters and that a parameter does not have multiple
+ * \@param blocks.
* Must be called after checkArgumentName() has been called for each
* argument.
*/
-static void checkUndocumentedParams()
+static void checkUnOrMultipleDocumentedParams()
{
if (g_memberDef && g_hasParamCommand && Config_getBool(WARN_IF_DOC_ERROR))
{
@@ -470,18 +471,37 @@ static void checkUndocumentedParams()
bool found=FALSE;
for (ali.toFirst();(a=ali.current());++ali)
{
+ int count = 0;
QCString argName = g_memberDef->isDefine() ? a->type : a->name;
if (lang==SrcLangExt_Fortran) argName = argName.lower();
argName=argName.stripWhiteSpace();
+ QCString aName = argName;
if (argName.right(3)=="...") argName=argName.left(argName.length()-3);
- if (g_memberDef->getLanguage()==SrcLangExt_Python && (argName=="self" || argName=="cls"))
+ if (lang==SrcLangExt_Python && (argName=="self" || argName=="cls"))
{
// allow undocumented self / cls parameter for Python
}
else if (!argName.isEmpty() && g_paramsFound.find(argName)==0 && a->docs.isEmpty())
{
found = TRUE;
- break;
+ }
+ else
+ {
+ QDictIterator<void> it1(g_paramsFound);
+ void *item1;
+ for (;(item1=it1.current());++it1)
+ {
+ if (argName == it1.currentKey()) count++;
+ }
+ }
+ if (count > 1)
+ {
+ warn_doc_error(g_memberDef->getDefFileName(),
+ g_memberDef->getDefLine(),
+ "argument '" + aName +
+ "' from the argument list of " +
+ QCString(g_memberDef->qualifiedName()) +
+ " has muliple @param documentation sections");
}
}
if (found)
@@ -497,7 +517,7 @@ static void checkUndocumentedParams()
QCString argName = g_memberDef->isDefine() ? a->type : a->name;
if (lang==SrcLangExt_Fortran) argName = argName.lower();
argName=argName.stripWhiteSpace();
- if (g_memberDef->getLanguage()==SrcLangExt_Python && (argName=="self" || argName=="cls"))
+ if (lang==SrcLangExt_Python && (argName=="self" || argName=="cls"))
{
// allow undocumented self / cls parameter for Python
}
@@ -6125,16 +6145,15 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
}
}
}
- else if (findAttribute(tagHtmlAttribs,"langword",&cref)) // <see langword="..."/> or <see langworld="..."></see>
+ else if (findAttribute(tagHtmlAttribs,"langword",&cref)) // <see langword="..."/> or <see langword="..."></see>
{
- doctokenizerYYsetStatePara();
- DocLink *lnk = new DocLink(this,cref);
- m_children.append(lnk);
- QCString leftOver = lnk->parse(FALSE,TRUE);
- if (!leftOver.isEmpty())
- {
- m_children.append(new DocWord(this,leftOver));
- }
+ bool inSeeBlock = g_inSeeBlock;
+ g_token->name = cref;
+ g_inSeeBlock = TRUE;
+ m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Code,TRUE));
+ handleLinkedWord(this,m_children,TRUE);
+ m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Code,FALSE));
+ g_inSeeBlock = inSeeBlock;
}
else
{
@@ -7541,7 +7560,7 @@ DocRoot *validatingParseDoc(const char *fileName,int startLine,
delete v;
}
- checkUndocumentedParams();
+ checkUnOrMultipleDocumentedParams();
detectNoDocumentedParams();
// TODO: These should be called at the end of the program.
diff --git a/src/doctokenizer.l b/src/doctokenizer.l
index 90a8c55..e6b8865 100644
--- a/src/doctokenizer.l
+++ b/src/doctokenizer.l
@@ -387,7 +387,8 @@ LNKWORD2 (({SCOPEPRE}*"operator"{OPMASK})|({SCOPEPRE}"operator"{OPMASKOPT})|(("
LNKWORD3 ([0-9a-z_A-Z\-]+("/"|"\\"))*[0-9a-z_A-Z\-]+("."[0-9a-z_A-Z]+)+
CHARWORDQ [^ \t\n\r\\@<>()\[\]:;\?{}&%$#,."=']
ESCWORD ("%"{ID}(("::"|"."){ID})*)|("%'")
-WORD1 {ESCWORD}|{CHARWORDQ}+|"{"|"}"|"'\"'"|("\""[^"\n]*\n?[^"\n]*"\"")
+CHARWORDQ1 [^ \-+0-9\t\n\r\\@<>()\[\]:;\?{}&%$#,."=']
+WORD1 {ESCWORD}|{CHARWORDQ1}+|"{"|"}"|"'\"'"|("\""[^"\n]*\n?[^"\n]*"\"")
WORD2 "."|","|"("|")"|"["|"]"|":"|";"|"\?"|"="|"'"
WORD1NQ {ESCWORD}|{CHARWORDQ}+|"{"|"}"
WORD2NQ "."|","|"("|")"|"["|"]"|":"|";"|"\?"|"="|"'"
@@ -554,7 +555,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
g_token->indent = computeIndent(text,dotPos);
return TK_ENDLIST;
}
-<St_Para>"{"{BLANK}*"@link" {
+<St_Para>"{"{BLANK}*"@link"/{BLANK}+ {
g_token->name = "javalink";
return TK_COMMAND;
}
@@ -696,6 +697,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
}
/********* patterns for normal words ******************/
+<St_Para,St_Text>[\-+0-9] |
<St_Para,St_Text>{WORD1} |
<St_Para,St_Text>{WORD2} { /* function call */
if (yytext[0]=='%') // strip % if present
@@ -931,6 +933,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
g_token->name = yytext;
return TK_WORD;
}
+<St_TitleN>[\-+0-9] |
<St_TitleN>{WORD1} |
<St_TitleN>{WORD2} { /* word */
if (yytext[0]=='%') // strip % if present
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index 00826d6..263b59f 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -10965,7 +10965,7 @@ void parseInput()
/**************************************************************************
- * Check/create output directorties *
+ * Check/create output directories *
**************************************************************************/
QCString htmlOutput;
diff --git a/src/fortrancode.l b/src/fortrancode.l
index 501b492..f491acb 100644
--- a/src/fortrancode.l
+++ b/src/fortrancode.l
@@ -159,6 +159,9 @@ static char stringStartSymbol; // single or double quote
// declared from referenced names
static int bracketCount = 0;
+// signal when in type / class /procedure declaration
+static int inTypeDecl = 0;
+
static bool g_endComment;
static void endFontClass()
@@ -687,14 +690,14 @@ CHAR (CHARACTER{ARGS}?|CHARACTER{BS}"*"({BS}[0-9]+|{ARGS}))
TYPE_SPEC (({NUM_TYPE}({BS}"*"{BS}[0-9]+)?)|({NUM_TYPE}{KIND})|DOUBLE{BS}COMPLEX|DOUBLE{BS}PRECISION|{CHAR}|TYPE|CLASS|PROCEDURE)
INTENT_SPEC intent{BS}"("{BS}(in|out|in{BS}out){BS}")"
-ATTR_SPEC (IMPLICIT|ALLOCATABLE|DIMENSION{ARGS}|EXTERNAL|{INTENT_SPEC}|INTRINSIC|OPTIONAL|PARAMETER|POINTER|PROTECTED|PRIVATE|PUBLIC|SAVE|TARGET|RECURSIVE|PURE|IMPURE|ELEMENTAL|VALUE|NOPASS|DEFERRED|CONTIGUOUS|VOLATILE)
+ATTR_SPEC (IMPLICIT|ALLOCATABLE|DIMENSION{ARGS}|EXTERNAL|{INTENT_SPEC}|INTRINSIC|OPTIONAL|PARAMETER|POINTER|PROTECTED|PRIVATE|PUBLIC|SAVE|TARGET|(NON_)?RECURSIVE|PURE|IMPURE|ELEMENTAL|VALUE|NOPASS|DEFERRED|CONTIGUOUS|VOLATILE)
ACCESS_SPEC (PROTECTED|PRIVATE|PUBLIC)
/* Assume that attribute statements are almost the same as attributes. */
ATTR_STMT {ATTR_SPEC}|DIMENSION
FLOW (DO|SELECT|CASE|SELECT{BS}(CASE|TYPE)|WHERE|IF|THEN|ELSE|WHILE|FORALL|ELSEWHERE|ELSEIF|RETURN|CONTINUE|EXIT|GO{BS}TO)
COMMANDS (FORMAT|CONTAINS|MODULE{BS_}PROCEDURE|WRITE|READ|ALLOCATE|ALLOCATED|ASSOCIATED|PRESENT|DEALLOCATE|NULLIFY|SIZE|INQUIRE|OPEN|CLOSE|FLUSH|DATA|COMMON)
IGNORE (CALL)
-PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|IMPURE|PURE|ELEMENTAL)?
+PREFIX ((NON_)?RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,4}((NON_)?RECURSIVE|IMPURE|PURE|ELEMENTAL)?
/* | */
@@ -813,7 +816,8 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I
unput(*yytext);
yy_pop_state();YY_FTN_RESET
}
-<Start>"import"{BS_} {
+<*>"import"{BS}/"\n" |
+<*>"import"{BS_} {
startFontClass("keywordtype");
codifyLines(yytext);
endFontClass();
@@ -825,6 +829,11 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I
generateLink(*g_code, yytext);
g_insideBody=FALSE;
}
+<Import>("ONLY"|"NONE"|"ALL") {
+ startFontClass("keywordtype");
+ codifyLines(yytext);
+ endFontClass();
+ }
/*-------- fortran module -----------------------------------------*/
<Start>("block"{BS}"data"|"program"|"module"|"interface")/{BS_}|({COMMA}{ACCESS_SPEC})|\n { //
startScope();
@@ -836,14 +845,14 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I
if (!qstricmp(yytext,"module")) currentModule="module";
}
<Start>("type")/{BS_}|({COMMA}({ACCESS_SPEC}|ABSTRACT|EXTENDS))|\n { //
- startScope();
- startFontClass("keyword");
- codifyLines(yytext);
- endFontClass();
+ startScope();
+ startFontClass("keyword");
+ codifyLines(yytext);
+ endFontClass();
yy_push_state(YY_START);
- BEGIN(ClassName);
- currentClass="class";
- }
+ BEGIN(ClassName);
+ currentClass="class";
+ }
<ClassName>{ID} {
if (currentModule == "module")
{
@@ -876,7 +885,7 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I
codifyLines(yytext);
endFontClass();
}
-<Start>({PREFIX}{BS_})?{SUBPROG}{BS_} { // Fortran subroutine or function found
+<Start>({PREFIX}{BS_})?{SUBPROG}{BS_} { // Fortran subroutine or function found
startFontClass("keyword");
codifyLines(yytext);
endFontClass();
@@ -923,6 +932,9 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I
}
/*-------- variable declaration ----------------------------------*/
<Start>{TYPE_SPEC}/[,:( ] {
+ QCString typ = yytext;
+ typ = typ.lower();
+ if (typ == "type" || typ == "class" || typ == "procedure") inTypeDecl = 1;
yy_push_state(YY_START);
BEGIN(Declaration);
startFontClass("keywordtype");
@@ -946,7 +958,7 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I
g_code->codify(yytext);
endFontClass();
}
- else if (g_currentMemberDef && ((g_currentMemberDef->isFunction() && (g_currentMemberDef->typeString() != QCString("subroutine"))) ||
+ else if (g_currentMemberDef && ((g_currentMemberDef->isFunction() && (g_currentMemberDef->typeString() != QCString("subroutine") || inTypeDecl)) ||
g_currentMemberDef->isVariable()))
{
generateLink(*g_code, yytext);
@@ -956,22 +968,23 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I
g_code->codify(yytext);
addLocalVar(yytext);
}
- }
-<Declaration>{BS}("=>"|"="){BS} { // Procedure binding
- BEGIN(DeclarationBinding);
- g_code->codify(yytext);
- }
-<DeclarationBinding>{ID} { // Type bound procedure link
+ }
+<Declaration>{BS}("=>"|"="){BS} { // Procedure binding
+ BEGIN(DeclarationBinding);
+ g_code->codify(yytext);
+ }
+<DeclarationBinding>{ID} { // Type bound procedure link
generateLink(*g_code, yytext);
yy_pop_state();
- }
-<Declaration>[(] { // start of array specification
+ }
+<Declaration>[(] { // start of array or type / class specification
bracketCount++;
g_code->codify(yytext);
}
<Declaration>[)] { // end array specification
bracketCount--;
+ if (!bracketCount) inTypeDecl = 0;
g_code->codify(yytext);
}
diff --git a/src/fortranscanner.l b/src/fortranscanner.l
index 85b6de9..774251b 100644
--- a/src/fortranscanner.l
+++ b/src/fortranscanner.l
@@ -198,6 +198,8 @@ static SymbolModifiers currentModifiers;
//! Holds program scope->symbol name->symbol modifiers.
static QMap<Entry*,QMap<QCString,SymbolModifiers> > modifiers;
+static Entry *global_scope = NULL;
+
//-----------------------------------------------------------------------------
static int yyread(char *buf,int max_size);
@@ -248,6 +250,7 @@ SUBPROG (subroutine|function)
B [ \t]
BS [ \t]*
BS_ [ \t]+
+BT_ ([ \t]+|[ \t]*"(")
COMMA {BS},{BS}
ARGS_L0 ("("[^)]*")")
ARGS_L1a [^()]*"("[^)]*")"[^)]*
@@ -271,7 +274,7 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC}
EXTERNAL_STMT (EXTERNAL)
CONTAINS CONTAINS
-PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|IMPURE|PURE|ELEMENTAL)?
+PREFIX ((NON_)?RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,4}((NON_)?RECURSIVE|IMPURE|PURE|ELEMENTAL)?
SCOPENAME ({ID}{BS}"::"{BS})*
%option noyywrap
@@ -558,7 +561,18 @@ SCOPENAME ({ID}{BS}"::"{BS})*
if (!endScope(current_root))
yyterminate();
defaultProtection = Public;
- yy_pop_state();
+ if (global_scope)
+ {
+ if (global_scope != (Entry *) -1)
+ yy_push_state(Start);
+ else
+ yy_pop_state(); // cannot pop artrificial entry
+ }
+ else
+ {
+ yy_push_state(Start);
+ global_scope = (Entry *)-1; // signal that the global_scope has already been used.
+ }
}
<Module>{ID} {
addModule(yytext, TRUE);
@@ -602,7 +616,7 @@ abstract {
current->spec |= Entry::AbstractClass;
}
extends{ARGS} {
- QCString basename = extractFromParens(yytext);
+ QCString basename = extractFromParens(yytext).lower();
current->extends->append(new BaseInfo(basename, Public, Normal));
}
public {
@@ -667,7 +681,8 @@ private {
addCurrentEntry(1);
}
{BS}"=>"[^(\n|\!)]* { /* Specific bindings come after the ID. */
- last_entry->args = yytext;
+ QCString args = yytext;
+ last_entry->args = args.lower();
}
"\n" {
currentModifiers = SymbolModifiers();
@@ -773,8 +788,10 @@ private {
}
{ID} {
}
-^{BS}"type"{BS_}"is"/{BS_} { }
+^{BS}"type"{BS_}"is"/{BT_} { }
^{BS}"type"{BS}"=" { }
+^{BS}"class"{BS_}"is"/{BT_} { }
+^{BS}"class"{BS_}"default" { }
}
<AttributeList>{
{COMMA} {}
@@ -1098,7 +1115,6 @@ private {
yy_push_state(YY_START);
BEGIN(StrIgnore);
debugStr="*!";
- //fprintf(stderr,"start comment %d\n",yyLineNr);
}
}
}
@@ -1552,7 +1568,10 @@ const char* prepassFixedForm(const char* contents, int *hasContLine)
}
// fallthrough
default:
- if(column==6 && emptyLabel) { // continuation
+ if ((column < 6) && ((c - '0') >= 0) && ((c - '0') <= 9)) { // remove numbers, i.e. labels from first 5 positions.
+ newContents[j]=' ';
+ }
+ else if(column==6 && emptyLabel) { // continuation
if (!commented) fullCommentLine=FALSE;
if (c != '0') { // 0 not allowed as continuation character, see f95 standard paragraph 3.3.2.3
newContents[j]=' ';
@@ -2017,14 +2036,23 @@ static void startScope(Entry *scope)
*/
static bool endScope(Entry *scope, bool isGlobalRoot)
{
+ if (global_scope == scope)
+ {
+ global_scope = NULL;
+ return TRUE;
+ }
+ if (global_scope == (Entry *) -1)
+ {
+ return TRUE;
+ }
//cout<<"end scope: "<<scope->name<<endl;
if (current_root->parent() || isGlobalRoot)
{
current_root= current_root->parent(); /* end substructure */
}
- else
+ else // if (current_root != scope)
{
- fprintf(stderr,"parse error in end <scopename>");
+ fprintf(stderr,"parse error in end <scopename>\n");
scanner_abort();
return FALSE;
}
@@ -2558,6 +2586,7 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt, Fortra
yyFileName = fileName;
msg("Parsing file %s...\n",yyFileName.data());
+ global_scope = rt;
startScope(rt); // implies current_root = rt
initParser();
groupEnterFile(yyFileName,yyLineNr);
@@ -2579,7 +2608,7 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt, Fortra
fortranscannerYYlex();
groupLeaveFile(yyFileName,yyLineNr);
- endScope(current_root, TRUE); // TRUE - global root
+ if (global_scope && global_scope != (Entry *) -1) endScope(current_root, TRUE); // TRUE - global root
//debugCompounds(rt); //debug
diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp
index 8b6d26c..6a9c142 100644
--- a/src/htmldocvisitor.cpp
+++ b/src/htmldocvisitor.cpp
@@ -126,21 +126,29 @@ static bool mustBeOutsideParagraph(DocNode *n)
return FALSE;
}
-static QString htmlAttribsToString(const HtmlAttribList &attribs)
+static QString htmlAttribsToString(const HtmlAttribList &attribs, const bool img_tag = FALSE)
{
QString result;
HtmlAttribListIterator li(attribs);
HtmlAttrib *att;
+ bool alt_set = FALSE;
+
for (li.toFirst();(att=li.current());++li)
{
if (!att->value.isEmpty()) // ignore attribute without values as they
- // are not XHTML compliant
+ // are not XHTML compliant, with the exception
+ // of the alt attribute with the img tag
{
result+=" ";
result+=att->name;
result+="=\""+convertToXML(att->value)+"\"";
+ if (att->name == "alt") alt_set = TRUE;
}
}
+ if (!alt_set && img_tag)
+ {
+ result+=" alt=\"\"";
+ }
return result;
}
@@ -1521,7 +1529,7 @@ void HtmlDocVisitor::visitPre(DocImage *img)
else
{
m_t << "<img src=\"" << correctURL(url,img->relPath()) << "\""
- << sizeAttribs << htmlAttribsToString(img->attribs())
+ << sizeAttribs << htmlAttribsToString(img->attribs(), TRUE)
<< "/>" << endl;
}
}
diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp
index cc3e61d..accc6a0 100644
--- a/src/htmlgen.cpp
+++ b/src/htmlgen.cpp
@@ -375,7 +375,7 @@ static QCString substituteHtmlKeywords(const QCString &s,
mathJaxJs += "\n";
}
mathJaxJs += "</script>";
- mathJaxJs += "<script type=\"text/javascript\" async src=\"" + path + "MathJax.js\"></script>\n";
+ mathJaxJs += "<script type=\"text/javascript\" async=\"async\" src=\"" + path + "MathJax.js\"></script>\n";
}
// first substitute generic keywords
@@ -2354,7 +2354,7 @@ void HtmlGenerator::writeSearchPage()
if (cf.open(IO_WriteOnly))
{
FTextStream t(&cf);
- t << "<script language=\"php\">\n\n";
+ t << "<?php\n\n";
t << "$config = array(\n";
t << " 'PROJECT_NAME' => \"" << convertToHtml(projectName) << "\",\n";
t << " 'GENERATE_TREEVIEW' => " << (generateTreeView?"true":"false") << ",\n";
@@ -2372,7 +2372,7 @@ void HtmlGenerator::writeSearchPage()
t << " 'split_bar' => \"" << substitute(substitute(writeSplitBarAsString("search",""), "\"","\\\""), "\n","\\n") << "\",\n";
t << " 'logo' => \"" << substitute(substitute(writeLogoAsString(""), "\"","\\\""), "\n","\\n") << "\",\n";
t << ");\n\n";
- t << "</script>\n";
+ t << "?>\n";
}
ResourceMgr::instance().copyResource("search_functions.php",htmlOutput);
@@ -2403,10 +2403,10 @@ void HtmlGenerator::writeSearchPage()
t << "</div>" << endl;
}
- t << "<script language=\"php\">\n";
+ t << "<?php\n";
t << "require_once \"search_functions.php\";\n";
t << "main();\n";
- t << "</script>\n";
+ t << "?>\n";
// Write empty navigation path, to make footer connect properly
if (generateTreeView)
diff --git a/src/latexgen.cpp b/src/latexgen.cpp
index 1511dcb..9b07fe6 100644
--- a/src/latexgen.cpp
+++ b/src/latexgen.cpp
@@ -748,7 +748,7 @@ static void writeDefaultFooter(FTextStream &t)
t << "\\newpage\n"
"\\phantomsection\n"
"\\clearemptydoublepage\n"
- "\\addcontentsline{toc}{" << unit << "}{" << theTranslator->trRTFGeneralIndex() << "}\n"
+ "\\addcontentsline{toc}{" << unit << "}{\\indexname}\n"
"\\printindex\n"
"\n"
"\\end{document}\n";
diff --git a/src/markdown.cpp b/src/markdown.cpp
index d3ec3f1..de5805f 100644
--- a/src/markdown.cpp
+++ b/src/markdown.cpp
@@ -483,6 +483,8 @@ static int processNmdash(GrowBuf &out,const char *data,int off,int size)
{
count++;
}
+ if (count==2 && off>=2 && qstrncmp(data-2,"<!",2)==0) return 0; // start HTML comment
+ if (count==2 && (data[2]=='>')) return 0; // end HTML comment
if (count==2 && (off<8 || qstrncmp(data-8,"operator",8)!=0)) // -- => ndash
{
out.addStr("&ndash;");
@@ -2548,7 +2550,7 @@ QCString processMarkdown(const QCString &fileName,const int lineNr,Entry *e,cons
// finally process the inline markup (links, emphasis and code spans)
processInline(out,s,s.length());
out.addChar(0);
- Debug::print(Debug::Markdown,0,"======== Markdown =========\n---- input ------- \n%s\n---- output -----\n%s\n---------\n",qPrint(input),qPrint(out.get()));
+ Debug::print(Debug::Markdown,0,"======== Markdown =========\n---- input ------- \n%s\n---- output -----\n%s\n=========\n",qPrint(input),qPrint(out.get()));
return out.get();
}
diff --git a/src/memberdef.cpp b/src/memberdef.cpp
index 01f4d8d..4328437 100644
--- a/src/memberdef.cpp
+++ b/src/memberdef.cpp
@@ -3212,7 +3212,10 @@ QCString MemberDef::memberTypeName() const
void MemberDef::warnIfUndocumented()
{
- if (m_impl->memberGroup) return;
+ /*
+ * Removed bug_303020:
+ * if (m_impl->memberGroup) return;
+ */
ClassDef *cd = getClassDef();
NamespaceDef *nd = getNamespaceDef();
FileDef *fd = getFileDef();
diff --git a/src/pyscanner.l b/src/pyscanner.l
index 9c21d41..5c9aef5 100644
--- a/src/pyscanner.l
+++ b/src/pyscanner.l
@@ -109,7 +109,7 @@ static QCString g_packageName;
//static bool g_hideClassDocs;
-static QCString g_defVal;
+static QGString g_defVal;
static int g_braceCount;
static bool g_lexInit = FALSE;
@@ -993,35 +993,49 @@ STARTDOCSYMS "##"
}
<FunctionParamDefVal>{
- "(" { // internal opening brace
+ "[" |
+ "(" { // internal opening brace, assumption is that we have correct code so braces do match
g_braceCount++;
g_defVal+=*yytext;
}
"," |
+ "]" |
")" {
if (g_braceCount==0) // end of default argument
{
if (current->argList->getLast())
{
- current->argList->getLast()->defval=g_defVal.stripWhiteSpace();
+ current->argList->getLast()->defval=QCString(g_defVal.data()).stripWhiteSpace();
}
- if (*yytext == ')')
+ if (*yytext != ',')
current->args = argListToString(current->argList);
BEGIN(FunctionParams);
}
else // continue
{
- if (*yytext == ')')g_braceCount--;
+ if (*yytext != ',')g_braceCount--;
g_defVal+=*yytext;
}
}
- . {
- g_defVal+=*yytext;
- }
+ "'" {
+ g_defVal+=*yytext;
+ g_copyString=&g_defVal;
+ g_stringContext=FunctionParamDefVal;
+ BEGIN( SingleQuoteString );
+ }
+ "\"" {
+ g_defVal+=*yytext;
+ g_copyString=&g_defVal;
+ g_stringContext=FunctionParamDefVal;
+ BEGIN( DoubleQuoteString );
+ }
\n {
g_defVal+=*yytext;
incLineNr();
}
+ . {
+ g_defVal+=*yytext;
+ }
}
@@ -1168,13 +1182,17 @@ STARTDOCSYMS "##"
current->program+=yytext;
BEGIN(TripleComment);
}
-
{TRISINGLEQUOTE} { // start of a comment block
initTriSingleQuoteBlock();
current->program+=yytext;
BEGIN(TripleComment);
}
-
+ {STARTDOCSYMS}[#]* { // start of a special comment
+ initSpecialBlock();
+ BEGIN(SpecialComment);
+ }
+ {POUNDCOMMENT} { // ignore comment with just one #
+ }
^{BB} {
current->program+=yytext;
//current->startLine = yyLineNr;
@@ -1187,7 +1205,6 @@ STARTDOCSYMS "##"
}
""/({NONEMPTY}|{EXPCHAR}) {
-
// Just pushback an empty class, and
// resume parsing the body.
newEntry();
diff --git a/src/scanner.l b/src/scanner.l
index 08a5e52..619eb5d 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -3639,7 +3639,10 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
current->fileName = yyFileName;
current->startLine = yyLineNr;
current->startColumn = yyColNr;
- current->type = "@"; // enum marker
+ if (!(current_root->spec&Entry::Enum))
+ {
+ current->type = "@"; // enum marker
+ }
current->args = current->args.simplifyWhiteSpace();
current->name = current->name.stripWhiteSpace();
current->section = Entry::VARIABLE_SEC;
diff --git a/src/tclscanner.l b/src/tclscanner.l
index 791ecc4..56d2e3d 100644
--- a/src/tclscanner.l
+++ b/src/tclscanner.l
@@ -703,6 +703,7 @@ static void tcl_codify(const char *s,const char *str)
}
else
{
+ if (*(p-2)==0x1A) *(p-2) = '\0'; // remove ^Z
tcl.code->codify(sp);
done=TRUE;
}
@@ -3024,11 +3025,6 @@ void TclLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf,
}
tcl_inf("%s (%d,%d) %d %d\n",myStr.ascii(),startLine,endLine,isExampleBlock,inlineFragment);
//tcl_inf("%s\n"input.data());
- if (isExampleBlock)
- {
- tcl_codify(NULL,input);
- return;
- }
tcl_init();
tcl.collectXRefs = collectXRefs;
tcl.memberdef = memberDef;
@@ -3047,8 +3043,15 @@ tcl_inf("%s (%d,%d) %d %d\n",myStr.ascii(),startLine,endLine,isExampleBlock,inli
}
tcl.file_name = "";
tcl.this_parser = NULL;
- tcl.entry_main = tcl_entry_new();
- tcl_parse(myNs,myCls);
+ if (isExampleBlock)
+ {
+ tcl_codify(NULL,input);
+ }
+ else
+ {
+ tcl.entry_main = tcl_entry_new();
+ tcl_parse(myNs,myCls);
+ }
tcl.code->endCodeLine();
tcl.scan.clear();
tcl.ns.clear();