diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/clangparser.cpp | 1 | ||||
-rw-r--r-- | src/classdef.cpp | 14 | ||||
-rw-r--r-- | src/dot.cpp | 17 | ||||
-rw-r--r-- | src/doxygen.cpp | 6 | ||||
-rw-r--r-- | src/fortrancode.l | 65 | ||||
-rw-r--r-- | src/fortranscanner.l | 112 | ||||
-rw-r--r-- | src/markdown.cpp | 13 | ||||
-rw-r--r-- | src/pycode.l | 30 | ||||
-rw-r--r-- | src/pyscanner.l | 1 | ||||
-rw-r--r-- | src/rtfdocvisitor.cpp | 16 | ||||
-rw-r--r-- | src/rtfgen.cpp | 49 | ||||
-rw-r--r-- | src/rtfgen.h | 4 | ||||
-rw-r--r-- | src/translator_cz.h | 8 | ||||
-rw-r--r-- | src/translator_sk.h | 10 | ||||
-rw-r--r-- | src/util.cpp | 2 |
15 files changed, 265 insertions, 83 deletions
diff --git a/src/clangparser.cpp b/src/clangparser.cpp index 77151d6..2ea15ee 100644 --- a/src/clangparser.cpp +++ b/src/clangparser.cpp @@ -4,6 +4,7 @@ #if USE_LIBCLANG #include <clang-c/Index.h> +#include "clang/Tooling/CompilationDatabase.h" #include "clang/Tooling/Tooling.h" #include <qfileinfo.h> #include <stdlib.h> diff --git a/src/classdef.cpp b/src/classdef.cpp index f810154..4977760 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -1935,21 +1935,7 @@ void ClassDef::writeDeclarationLink(OutputList &ol,bool &found,const char *heade if (rootNode && !rootNode->isEmpty()) { ol.startMemberDescription(anchor()); - - ol.pushGeneratorState(); - ol.disableAll(); - ol.enable(OutputGenerator::RTF); - ol.writeString("{"); - ol.popGeneratorState(); - ol.writeDoc(rootNode,this,0); - - ol.pushGeneratorState(); - ol.disableAll(); - ol.enable(OutputGenerator::RTF); - ol.writeString("\\par}"); - ol.popGeneratorState(); - if (isLinkableInProject()) { writeMoreLink(ol,anchor()); diff --git a/src/dot.cpp b/src/dot.cpp index eeb8b8b..5adc2ab 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -1878,10 +1878,10 @@ void DotNode::writeBox(FTextStream &t, << m_url.right(m_url.length()-anchorPos) << "\""; } } - if (!m_tooltip.isEmpty()) - { - t << ",tooltip=\"" << escapeTooltip(m_tooltip) << "\""; - } + } + if (!m_tooltip.isEmpty()) + { + t << ",tooltip=\"" << escapeTooltip(m_tooltip) << "\""; } t << "];" << endl; } @@ -3483,9 +3483,10 @@ DotInclDepGraph::DotInclDepGraph(FileDef *fd,bool inverse) m_inclDepFileName = fd->includeDependencyGraphFileName(); m_inclByDepFileName = fd->includedByDependencyGraphFileName(); QCString tmp_url=fd->getReference()+"$"+fd->getOutputFileBase(); + QCString tooltip = fd->briefDescriptionAsTooltip(); m_startNode = new DotNode(m_curNodeNumber++, fd->docName(), - "", + tooltip, tmp_url.data(), TRUE // root node ); @@ -3812,9 +3813,10 @@ DotCallGraph::DotCallGraph(MemberDef *md,bool inverse) { name = md->qualifiedName(); } + QCString tooltip = md->briefDescriptionAsTooltip(); m_startNode = new DotNode(m_curNodeNumber++, linkToText(md->getLanguage(),name,FALSE), - "", + tooltip, uniqueId.data(), TRUE // root node ); @@ -4336,7 +4338,8 @@ DotGroupCollaboration::DotGroupCollaboration(GroupDef* gd) { QCString tmp_url = gd->getReference()+"$"+gd->getOutputFileBase(); m_usedNodes = new QDict<DotNode>(1009); - m_rootNode = new DotNode(m_curNodeNumber++, gd->groupTitle(), "", tmp_url, TRUE ); + QCString tooltip = gd->briefDescriptionAsTooltip(); + m_rootNode = new DotNode(m_curNodeNumber++, gd->groupTitle(), tooltip, tmp_url, TRUE ); m_rootNode->markAsVisible(); m_usedNodes->insert(gd->name(), m_rootNode ); m_edges.setAutoDelete(TRUE); diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 263b59f..bc244b7 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -11558,6 +11558,12 @@ void generateOutput() Doxygen::formulaList->generateBitmaps(Config_getString(HTML_OUTPUT)); g_s.end(); } + if (Doxygen::formulaList->count()>0 && generateRtf) + { + g_s.begin("Generating bitmaps for formulas in RTF...\n"); + Doxygen::formulaList->generateBitmaps(Config_getString(RTF_OUTPUT)); + g_s.end(); + } if (Config_getBool(SORT_GROUP_NAMES)) { diff --git a/src/fortrancode.l b/src/fortrancode.l index 14268cf..e64c38e 100644 --- a/src/fortrancode.l +++ b/src/fortrancode.l @@ -687,7 +687,7 @@ NUM_TYPE (complex|integer|logical|real) LOG_OPER (\.and\.|\.eq\.|\.eqv\.|\.ge\.|\.gt\.|\.le\.|\.lt\.|\.ne\.|\.neqv\.|\.or\.|\.not\.) KIND {ARGS} 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) +TYPE_SPEC (({NUM_TYPE}({BS}"*"{BS}[0-9]+)?)|({NUM_TYPE}{KIND})|DOUBLE{BS}COMPLEX|DOUBLE{BS}PRECISION|{CHAR}|TYPE|CLASS|PROCEDURE|ENUMERATOR) 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|(NON_)?RECURSIVE|PURE|IMPURE|ELEMENTAL|VALUE|NOPASS|DEFERRED|CONTIGUOUS|VOLATILE) @@ -697,7 +697,8 @@ 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 ((NON_)?RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,4}((NON_)?RECURSIVE|IMPURE|PURE|ELEMENTAL)? +PREFIX ((NON_)?RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,4}((NON_)?RECURSIVE|IMPURE|PURE|ELEMENTAL)?0 +LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?")" /* | */ @@ -778,12 +779,12 @@ PREFIX ((NON_)?RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,4}((NON BEGIN(Use); } <Use>"ONLY" { // TODO: rename - startFontClass("keywordtype"); - codifyLines(yytext); - endFontClass(); + startFontClass("keywordtype"); + codifyLines(yytext); + endFontClass(); yy_push_state(YY_START); - BEGIN(UseOnly); - } + BEGIN(UseOnly); + } <Use>{ID} { QCString tmp = yytext; tmp = tmp.lower(); @@ -844,6 +845,20 @@ PREFIX ((NON_)?RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,4}((NON BEGIN(ClassName); if (!qstricmp(yytext,"module")) currentModule="module"; } +<Start>("enum")/{BS_}|{BS}{COMMA}{BS}{LANGUAGE_BIND_SPEC}|\n { // + startScope(); + startFontClass("keyword"); + codifyLines(yytext); + endFontClass(); + yy_push_state(YY_START); + BEGIN(ClassName); + currentClass="class"; + } +<*>{LANGUAGE_BIND_SPEC} { // + startFontClass("keyword"); + codifyLines(yytext); + endFontClass(); + } <Start>("type")/{BS_}|({COMMA}({ACCESS_SPEC}|ABSTRACT|EXTENDS))|\n { // startScope(); startFontClass("keyword"); @@ -869,15 +884,19 @@ PREFIX ((NON_)?RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,4}((NON } <ClassName>\n { // interface may be without name yy_pop_state(); - YY_FTN_REJECT; - } + YY_FTN_REJECT; + } +<Start>^{BS}"end"({BS_}"enum").* { // just reset currentClass, rest is done in following rule + currentClass=0; + YY_FTN_REJECT; + } <Start>^{BS}"end"({BS_}"type").* { // just reset currentClass, rest is done in following rule currentClass=0; - YY_FTN_REJECT; + YY_FTN_REJECT; } <Start>^{BS}"end"({BS_}"module").* { // just reset currentModule, rest is done in following rule currentModule=0; - YY_FTN_REJECT; + YY_FTN_REJECT; } /*-------- subprog definition -------------------------------------*/ <Start>({PREFIX}{BS_})?{TYPE_SPEC}{BS_}({PREFIX}{BS_})?{BS}/{SUBPROG}{BS_} { // TYPE_SPEC is for old function style function result @@ -910,7 +929,7 @@ PREFIX ((NON_)?RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,4}((NON yy_pop_state(); YY_FTN_RESET } -<Start>^{BS}"end"{BS}("block"{BS}"data"|{SUBPROG}|"module"|"program"|"type"|"interface")?{BS} { // Fortran subroutine or function ends +<Start>^{BS}"end"{BS}("block"{BS}"data"|{SUBPROG}|"module"|"program"|"enum"|"type"|"interface")?{BS} { // Fortran subroutine or function ends //cout << "===> end function " << yytext << endl; endScope(); startFontClass("keyword"); @@ -923,7 +942,7 @@ PREFIX ((NON_)?RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,4}((NON generateLink(*g_code,yytext); yy_pop_state(); } -<Start>^{BS}"end"{BS}("block"{BS}"data"|{SUBPROG}|"module"|"program"|"type"|"interface"){BS}/(\n|!) { // Fortran subroutine or function ends +<Start>^{BS}"end"{BS}("block"{BS}"data"|{SUBPROG}|"module"|"program"|"enum"|"type"|"interface"){BS}/(\n|!) { // Fortran subroutine or function ends //cout << "===> end function " << yytext << endl; endScope(); startFontClass("keyword"); @@ -966,8 +985,11 @@ PREFIX ((NON_)?RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,4}((NON g_code->codify(yytext); endFontClass(); } - else if (g_currentMemberDef && ((g_currentMemberDef->isFunction() && (g_currentMemberDef->typeString() != QCString("subroutine") || inTypeDecl)) || - g_currentMemberDef->isVariable())) + else if (g_currentMemberDef && + ((g_currentMemberDef->isFunction() && (g_currentMemberDef->typeString()!=QCString("subroutine") || inTypeDecl)) || + g_currentMemberDef->isVariable() || g_currentMemberDef->isEnumValue() + ) + ) { generateLink(*g_code, yytext); } @@ -1050,11 +1072,20 @@ PREFIX ((NON_)?RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,4}((NON // fixed form continuation line YY_FTN_REJECT; } + else if (QCString(yytext).stripWhiteSpace().lower() == "type") + { + yy_push_state(YY_START); + BEGIN(Declaration); + startFontClass("keywordtype"); + g_code->codify(QCString(yytext).stripWhiteSpace()); + endFontClass(); + g_code->codify(yytext + 4); + } else { - g_insideBody=TRUE; + g_insideBody=TRUE; generateLink(*g_code, yytext); - g_insideBody=FALSE; + g_insideBody=FALSE; } } diff --git a/src/fortranscanner.l b/src/fortranscanner.l index 774251b..d0503c2 100644 --- a/src/fortranscanner.l +++ b/src/fortranscanner.l @@ -164,6 +164,7 @@ static Entry* global_root = 0 ; static Entry* file_root = 0 ; static Entry* current = 0 ; static Entry* last_entry = 0 ; +static Entry* last_enum = 0 ; static ScanVar v_type = V_IGNORE; // type of parsed variable static QList<Entry> moduleProcedures; // list of all interfaces which contain unresolved // module procedures @@ -198,8 +199,8 @@ static SymbolModifiers currentModifiers; //! Holds program scope->symbol name->symbol modifiers. static QMap<Entry*,QMap<QCString,SymbolModifiers> > modifiers; -static Entry *global_scope = NULL; - +static Entry *global_scope = NULL; +static int anonCount = 0 ; //----------------------------------------------------------------------------- static int yyread(char *buf,int max_size); @@ -228,6 +229,7 @@ static QCString extractFromParens(const QCString name); static CommentInPrepass* locatePrepassComment(int from, int to); static void updateVariablePrepassComment(int from, int to); static void newLine(); +static void initEntry(); //----------------------------------------------------------------------------- #undef YY_INPUT @@ -263,7 +265,7 @@ NUM_TYPE (complex|integer|logical|real) LOG_OPER (\.and\.|\.eq\.|\.eqv\.|\.ge\.|\.gt\.|\.le\.|\.lt\.|\.ne\.|\.neqv\.|\.or\.|\.not\.) KIND {ARGS} 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{ARGS}|CLASS{ARGS}|PROCEDURE{ARGS}?) +TYPE_SPEC (({NUM_TYPE}({BS}"*"{BS}[0-9]+)?)|({NUM_TYPE}{KIND})|DOUBLE{BS}COMPLEX|DOUBLE{BS}PRECISION|ENUMERATOR|{CHAR}|TYPE{ARGS}|CLASS{ARGS}|PROCEDURE{ARGS}?) INTENT_SPEC intent{BS}"("{BS}(in|out|in{BS}out){BS}")" ATTR_SPEC (EXTERNAL|ALLOCATABLE|DIMENSION{ARGS}|{INTENT_SPEC}|INTRINSIC|OPTIONAL|PARAMETER|POINTER|PROTECTED|PRIVATE|PUBLIC|SAVE|TARGET|NOPASS|PASS{ARGS}?|DEFERRED|NON_OVERRIDABLE|CONTIGUOUS|VOLATILE|VALUE) @@ -300,6 +302,7 @@ SCOPENAME ({ID}{BS}"::"{BS})* %x Variable %x Initialization %x ArrayInitializer +%x Enum %x Typedef %x TypedefBody %x TypedefBodyContains @@ -726,8 +729,17 @@ private { {ID} { } } -<Start,ModuleBody,TypedefBody,SubprogBody>{ +<Start,ModuleBody,TypedefBody,SubprogBody,Enum>{ ^{BS}{TYPE_SPEC}/{SEPARATE} { + last_enum = 0; + if (YY_START == Enum) + { + argType = "@"; // enum marker + } + else + { + argType = QCString(yytext).simplifyWhiteSpace().lower(); + } current->bodyLine = yyLineNr + 1; current->endBodyLine = yyLineNr + lineCountPrepass; /* variable declaration starts */ @@ -736,7 +748,6 @@ private { addModule(NULL); yy_push_state(ModuleBody); //anon program } - argType = QCString(yytext).simplifyWhiteSpace().lower(); yy_push_state(AttributeList); } /* Dimitri: macro expansion should already be done during preprocessing not here! @@ -834,17 +845,30 @@ private { modifiers[current_root][name.lower()] |= currentModifiers; argName= name; - v_type= V_IGNORE; - if (!argType.isEmpty() && current_root->section!=Entry::FUNCTION_SEC) - { // new variable entry - v_type = V_VARIABLE; + v_type= V_IGNORE; + if (!argType.isEmpty() && current_root->section!=Entry::FUNCTION_SEC) + { // new variable entry + v_type = V_VARIABLE; current->section = Entry::VARIABLE_SEC; - current->name = argName; - current->type = argType; - current->fileName = yyFileName; - current->bodyLine = yyLineNr; // used for source reference + current->name = argName; + current->type = argType; + current->fileName = yyFileName; + current->bodyLine = yyLineNr; // used for source reference current->startLine = yyLineNr; - addCurrentEntry(1); + if (argType == "@") + { + current_root->addSubEntry(current); + current = new Entry(*current); + // add to the scope surrounding the enum (copy!) + current_root->parent()->addSubEntry(current); + last_enum = current; + current = new Entry ; + initEntry(); + } + else + { + addCurrentEntry(1); + } } else if (!argType.isEmpty()) { // declaration of parameter list: add type for corr. parameter @@ -980,19 +1004,72 @@ private { { updateVariablePrepassComment(yyColNr-(int)yyleng, yyColNr); yy_pop_state(); // end initialization - if (v_type == V_VARIABLE) last_entry->initializer= initializer; + if (last_enum) + { + last_enum->initializer= initializer; + } + else + { + if (v_type == V_VARIABLE) last_entry->initializer= initializer; + } } else initializer+=", "; } <Initialization>"\n"|"!" { //| yy_pop_state(); // end initialization - if (v_type == V_VARIABLE) last_entry->initializer= initializer; + if (last_enum) + { + last_enum->initializer= initializer; + } + else + { + if (v_type == V_VARIABLE) last_entry->initializer= initializer; + } yyColNr -= 1; unput(*yytext); } <Initialization>. { initializer+=yytext; } +<*>{BS}"enum"{BS}","{BS}"bind"{BS}"("{BS}"c"{BS}")"{BS} { + if(YY_START == Start) + { + addModule(NULL); + yy_push_state(ModuleBody); //anon program + } + + yy_push_state(Enum); + current->protection = defaultProtection; + typeProtection = defaultProtection; + typeMode = true; + + current->spec |= Entry::Struct; + current->name.resize(0); + current->args.resize(0); + current->name.sprintf("@%d",anonCount++); + + current->section = Entry::ENUM_SEC; + current->fileName = yyFileName; + current->startLine = yyLineNr; + current->bodyLine = yyLineNr; + if ((current_root) && + (current_root->section == Entry::CLASS_SEC + || current_root->section == Entry::NAMESPACE_SEC)) + { + current->name = current_root->name + "::" + current->name; + } + + addCurrentEntry(1); + startScope(last_entry); + BEGIN( Enum ) ; + } +<Enum>"end"{BS}"enum" { + last_entry->parent()->endBodyLine = yyLineNr; + if (!endScope(current_root)) + yyterminate(); + typeMode = false; + yy_pop_state(); + } /*------ fortran subroutine/function handling ------------------------------------------------------------*/ /* Start is initial condition */ @@ -1133,6 +1210,7 @@ private { { Entry *tmp_entry = current; current = last_entry; // temporarily switch to the previous entry + if (last_enum) current = last_enum; handleCommentBlock(docBlock,TRUE); current=tmp_entry; } @@ -1148,7 +1226,7 @@ private { docBlock.resize(0); } -<Start,SubprogBody,ModuleBody,TypedefBody,InterfaceBody,ModuleBodyContains,SubprogBodyContains,TypedefBodyContains>"!>" { +<Start,SubprogBody,ModuleBody,TypedefBody,InterfaceBody,ModuleBodyContains,SubprogBodyContains,TypedefBodyContains,Enum>"!>" { yy_push_state(YY_START); current->docLine = yyLineNr; docBlockJavaStyle = FALSE; diff --git a/src/markdown.cpp b/src/markdown.cpp index f7526dc..0ca95a4 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -844,7 +844,7 @@ static int processLink(GrowBuf &out,const char *data,int,int size) } if (isToc) // special case for [TOC] { - if (g_current) g_current->stat=TRUE; + out.addStr("@tableofcontents"); } else if (isImageLink) { @@ -1590,15 +1590,15 @@ static int writeTableBlock(GrowBuf &out,const char *data,int size) int columns,start,end,cc; i = findTableColumns(data,size,start,end,columns); - + + int headerStart = start; + int headerEnd = end; + #ifdef USE_ORIGINAL_TABLES out.addStr("<table>"); // write table header, in range [start..end] out.addStr("<tr>"); - - int headerStart = start; - int headerEnd = end; #endif // read cell alignments @@ -1712,9 +1712,6 @@ static int writeTableBlock(GrowBuf &out,const char *data,int size) QVector<QVector<TableCell> > tableContents; tableContents.setAutoDelete(TRUE); - int headerStart = start; - int headerEnd = end; - int m=headerStart; QVector<TableCell> *headerContents = new QVector<TableCell>(columns); headerContents->setAutoDelete(TRUE); diff --git a/src/pycode.l b/src/pycode.l index fe1eef5..1b176d6 100644 --- a/src/pycode.l +++ b/src/pycode.l @@ -884,7 +884,7 @@ SHORTSTRINGITEM ({SHORTSTRINGCHAR}|{ESCAPESEQ}) SHORTSTRINGCHAR [^\\\n"] STRINGLITERAL {STRINGPREFIX}?( {SHORTSTRING} | {LONGSTRING}) STRINGPREFIX ("r"|"u"|"ur"|"R"|"U"|"UR"|"Ur"|"uR") -KEYWORD ("lambda"|"import"|"class"|"assert"|"as"|"from"|"global"|"def"|"True"|"False") +KEYWORD ("lambda"|"import"|"class"|"assert"|"with"|"as"|"from"|"global"|"def"|"True"|"False") FLOWKW ("or"|"and"|"is"|"not"|"print"|"for"|"in"|"if"|"try"|"except"|"yield"|"raise"|"break"|"continue"|"pass"|"if"|"return"|"while"|"elif"|"else"|"finally") QUOTES ("\""[^"]*"\"") SINGLEQUOTES ("'"[^']*"'") @@ -1382,21 +1382,43 @@ TARGET ({IDENTIFIER}|"("{TARGET_LIST}")"|"["{TARGET_LIST}"]"|{ATTRIBUT } */ -<*>{STRINGPREFIX}?{TRISINGLEQUOTE} | +<*>{STRINGPREFIX}?{TRISINGLEQUOTE} { + if (YY_START==SingleQuoteString) REJECT; + startFontClass("stringliteral"); + g_stringContext=YY_START; + g_doubleQuote=yytext[yyleng-1]=='"'; + codify(yytext); + BEGIN(TripleString); + } <*>{STRINGPREFIX}?{TRIDOUBLEQUOTE} { - startFontClass("stringliteral"); + if (YY_START==DoubleQuoteString) REJECT; + startFontClass("stringliteral"); g_stringContext=YY_START; g_doubleQuote=yytext[yyleng-1]=='"'; - codify(yytext); + codify(yytext); BEGIN(TripleString); } <*>{STRINGPREFIX}?"'" { // single quoted string + if (YY_START==SingleQuoteString || + YY_START==DoubleQuoteString || + YY_START==TripleString + ) + { + REJECT; + } startFontClass("stringliteral"); g_stringContext=YY_START; codify(yytext); BEGIN(SingleQuoteString); } <*>{STRINGPREFIX}?"\"" { // double quoted string + if (YY_START==SingleQuoteString || + YY_START==DoubleQuoteString || + YY_START==TripleString + ) + { + REJECT; + } startFontClass("stringliteral"); g_stringContext=YY_START; codify(yytext); diff --git a/src/pyscanner.l b/src/pyscanner.l index 5c9aef5..4718e3b 100644 --- a/src/pyscanner.l +++ b/src/pyscanner.l @@ -487,7 +487,6 @@ SHORTSTRINGITEM ({SHORTSTRINGCHAR}|{ESCAPESEQ}) SHORTSTRINGCHAR [^\\\n"] STRINGLITERAL {STRINGPREFIX}?( {SHORTSTRING} | {LONGSTRING}) STRINGPREFIX ("r"|"u"|"ur"|"R"|"U"|"UR"|"Ur"|"uR") -KEYWORD ("lambda"|"import"|"class"|"assert"|"as"|"from"|"global"|"def"|"True"|"False") FLOWKW ("or"|"and"|"is"|"not"|"print"|"for"|"in"|"if"|"try"|"except"|"yield"|"raise"|"break"|"continue"|"pass"|"if"|"return"|"while"|"elif"|"else"|"finally") POUNDCOMMENT "#"[^#\n][^\n]* SCRIPTCOMMENT "#!".* diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp index c85b638..7e3f104 100644 --- a/src/rtfdocvisitor.cpp +++ b/src/rtfdocvisitor.cpp @@ -526,9 +526,21 @@ void RTFDocVisitor::visit(DocIncOperator *op) void RTFDocVisitor::visit(DocFormula *f) { if (m_hide) return; - // TODO: do something sensible here, like including a bitmap DBG_RTF("{\\comment RTFDocVisitor::visit(DocFormula)}\n"); - m_t << f->text(); + bool bDisplay = !f->isInline(); + if (bDisplay) + { + m_t << "\\par"; + m_t << "{"; + m_t << "\\pard\\plain"; + m_t << "\\pard"; + m_t << "\\qc"; + } + m_t << "{ \\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"" << f->relPath() << f->name() << ".png\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt Image}}"; + if (bDisplay) + { + m_t << "\\par}"; + } m_lastIsPara=FALSE; } diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index e41700b..64da929 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -244,7 +244,22 @@ void RTFGenerator::beginRTFDocument() t <<"\\red128\\green0\\blue0;"; t <<"\\red128\\green128\\blue0;"; t <<"\\red128\\green128\\blue128;"; - t <<"\\red192\\green192\\blue192;}" << endl; + t <<"\\red192\\green192\\blue192;"; + + // code highlighting colors. Note order is important see also RTFGenerator::startFontClass + t <<"\\red0\\green128\\blue0;"; // keyword = index 17 + t <<"\\red96\\green64\\blue32;"; // keywordtype + t <<"\\rede0\\green128\\blue0;"; // keywordflow + t <<"\\red128\\green0\\blue0;"; // comment + t <<"\\red128\\green96\\blue32;"; // preprocessor + t <<"\\red0\\green32\\blue128;"; // stringliteral + t <<"\\red0\\green128\\blue128;"; // charliteral + t <<"\\red255\\green0\\blue255;"; // vhdldigit + t <<"\\red0\\green0\\blue0;"; // vhdlchar + t <<"\\red112\\green0\\blue112;"; // vhdlkeyword + t <<"\\red255\\green0\\blue0;"; // vhdllogic + + t <<"}\n"; DBG_RTF(t <<"{\\comment Beginning style list}\n") t <<"{\\stylesheet\n"; @@ -575,7 +590,7 @@ void RTFGenerator::endIndexSection(IndexSections is) break; case isTitlePageAuthor: { - t << "Doxgyen. }\n"; + t << " doxygen.}\n"; t << "{\\creatim " << dateToRTFDateString() << "}\n}"; DBG_RTF(t << "{\\comment end of infoblock}\n"); // setup for this section @@ -602,7 +617,7 @@ void RTFGenerator::endIndexSection(IndexSections is) t << rtf_Style_Reset << rtf_Style["Title"]->reference << endl; // set to title style if (rtf_title) // User has overridden document title in extensions file - t << "{\\field\\fldedit {\\*\\fldinst " << rtf_title << " \\\\*MERGEFORMAT}{\\fldrslt " << rtf_title << "}}\\par" << endl; + t << "{\\field\\fldedit {\\*\\fldinst TITLE \\\\*MERGEFORMAT}{\\fldrslt " << rtf_title << "}}\\par" << endl; else { DocText *root = validatingParseText(projectName); @@ -1639,11 +1654,11 @@ void RTFGenerator::endMemberDescription() { DBG_RTF(t << "{\\comment (endMemberDescription)}" << endl) endEmphasis(); - newParagraph(); + //newParagraph(); decrementIndentLevel(); - //t << "\\par"; + t << "\\par"; t << "}" << endl; - //m_omitParagraph = TRUE; + m_omitParagraph = TRUE; } void RTFGenerator::startDescList(SectionTypes) @@ -3041,5 +3056,25 @@ void RTFGenerator::endLabels() { } +void RTFGenerator::startFontClass(const char *name) +{ + int cod = 2; + QCString qname(name); + if (qname == "keyword") cod = 17; + else if (qname == "keywordtype") cod = 18; + else if (qname == "keywordflow") cod = 19; + else if (qname == "comment") cod = 20; + else if (qname == "preprocessor") cod = 21; + else if (qname == "stringliteral") cod = 22; + else if (qname == "charliteral") cod = 23; + else if (qname == "vhdldigit") cod = 24; + else if (qname == "vhdlchar") cod = 25; + else if (qname == "vhdlkeyword") cod = 26; + else if (qname == "vhdllogic") cod = 27; + t << "{\\cf" << cod << " "; +} - +void RTFGenerator::endFontClass() +{ + t << "}"; +} diff --git a/src/rtfgen.h b/src/rtfgen.h index 1eb7db0..bb3146a 100644 --- a/src/rtfgen.h +++ b/src/rtfgen.h @@ -258,8 +258,8 @@ class RTFGenerator : public OutputGenerator void writeLabel(const char *l,bool isLast); void endLabels(); - void startFontClass(const char *) {} - void endFontClass() {} + void startFontClass(const char *); + void endFontClass(); void writeCodeAnchor(const char *) {} void setCurrentDoc(Definition *,const char *,bool) {} diff --git a/src/translator_cz.h b/src/translator_cz.h index 7c61f58..9d6c489 100644 --- a/src/translator_cz.h +++ b/src/translator_cz.h @@ -96,7 +96,13 @@ class TranslatorCzech : public TranslatorAdapter_1_8_15 virtual QCString latexLanguageSupportCommand() { return "\\usepackage[T2A]{fontenc}\n" - "\\usepackage[czech]{babel}\n"; + "\\usepackage[czech]{babel}\n" + "\\usepackage{regexpatch}\n" + "\\makeatletter\n" + "% Change the `-` delimiter to an active character\n" + "\\xpatchparametertext\\@@@cmidrule{-}{\\cA-}{}{}\n" + "\\xpatchparametertext\\@cline{-}{\\cA-}{}{}\n" + "\\makeatother\n"; } // --- Language translation methods ------------------- diff --git a/src/translator_sk.h b/src/translator_sk.h index ec8af4b..9ee8252 100644 --- a/src/translator_sk.h +++ b/src/translator_sk.h @@ -41,8 +41,14 @@ class TranslatorSlovak : public TranslatorAdapter_1_8_15 { return "slovak"; } virtual QCString latexLanguageSupportCommand() - { return "\\usepackage[slovak]{babel}\n"; } - + { return "\\usepackage[slovak]{babel}\n" + "\\usepackage{regexpatch}\n" + "\\makeatletter\n" + "% Change the `-` delimiter to an active character\n" + "\\xpatchparametertext\\@@@cmidrule{-}{\\cA-}{}{}\n" + "\\xpatchparametertext\\@cline{-}{\\cA-}{}{}\n" + "\\makeatother\n"; + } // --- Language translation methods ------------------- /*! used in the compound documentation before a list of related functions. */ diff --git a/src/util.cpp b/src/util.cpp index ff0d0c6..352cb87 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1781,7 +1781,7 @@ QCString removeRedundantWhiteSpace(const QCString &s) pc = c; i++; c = src[i]; - *dst+=c; + *dst++=c; } else if (c=='"') { |