diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 63c3578e971..183991f9480 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -118,12 +118,7 @@ if (build_doc_chm) ) endif () -if (${CMAKE_VERSION} VERSION_EQUAL "3.11.0" OR ${CMAKE_VERSION} VERSION_GREATER "3.11.0") - file(GLOB LANG_FILES CONFIGURE_DEPENDS "${TOP}/src//translator_??.h") -else() - file(GLOB LANG_FILES "${TOP}/src//translator_??.h") -endif() - +file(GLOB LANG_FILES CONFIGURE_DEPENDS "${TOP}/src//translator_??.h") file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/man ${PROJECT_BINARY_DIR}/src diff --git a/doc_internal/CMakeLists.txt b/doc_internal/CMakeLists.txt index 4390b0aa7ed..06cbdef8636 100644 --- a/doc_internal/CMakeLists.txt +++ b/doc_internal/CMakeLists.txt @@ -27,11 +27,7 @@ set(DOC_FILES translator.py ) -if (${CMAKE_VERSION} VERSION_EQUAL "3.11.0" OR ${CMAKE_VERSION} VERSION_GREATER "3.11.0") - file(GLOB LANG_FILES CONFIGURE_DEPENDS "${TOP}/src//translator_??.h") -else() - file(GLOB LANG_FILES "${TOP}/src//translator_??.h") -endif() +file(GLOB LANG_FILES CONFIGURE_DEPENDS "${TOP}/src//translator_??.h") foreach (f ${DOC_FILES}) add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/doc_internal/${f} diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 02c52240e5b..69e3b312063 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -23,11 +23,7 @@ endif() file(MAKE_DIRECTORY ${GENERATED_SRC}) -if (${CMAKE_VERSION} VERSION_EQUAL "3.11.0" OR ${CMAKE_VERSION} VERSION_GREATER "3.11.0") - file(GLOB LANGUAGE_FILES CONFIGURE_DEPENDS "${CMAKE_CURRENT_LIST_DIR}/translator_??.h") -else() - file(GLOB LANGUAGE_FILES "${CMAKE_CURRENT_LIST_DIR}/translator_??.h") -endif() +file(GLOB LANGUAGE_FILES CONFIGURE_DEPENDS "${CMAKE_CURRENT_LIST_DIR}/translator_??.h") # instead of increasebuffer.py add_definitions(-DYY_BUF_SIZE=${enlarge_lex_buffers} -DYY_READ_BUF_SIZE=${enlarge_lex_buffers}) @@ -84,11 +80,7 @@ add_custom_command( set_source_files_properties(${GENERATED_SRC}/ce_parse.h PROPERTIES GENERATED 1) # all resource files -if (${CMAKE_VERSION} VERSION_EQUAL "3.11.0" OR ${CMAKE_VERSION} VERSION_GREATER "3.11.0") - file(GLOB RESOURCES CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/templates/*/*) -else() - file(GLOB RESOURCES ${PROJECT_SOURCE_DIR}/templates/*/*) -endif() +file(GLOB RESOURCES CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/templates/*/*) # resources.cpp add_custom_command( diff --git a/src/docparser.cpp b/src/docparser.cpp index dcdd9ef2f48..59f00e44255 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -2079,11 +2079,16 @@ IDocNodeASTPtr validatingParseText(IDocParser &parserIntf,const QCString &input) return ast; } -IDocNodeASTPtr createRef(IDocParser &parserIntf,const QCString &target,const QCString &context) +IDocNodeASTPtr createRef(IDocParser &parserIntf,const QCString &target,const QCString &context, const QCString &srcFile, int srcLine ) { DocParser *parser = dynamic_cast(&parserIntf); assert(parser!=0); if (parser==0) return 0; + if (!srcFile.isEmpty()) + { + parser->context.fileName = srcFile; + parser->tokenizer.setLineNr(srcLine); + } return std::make_unique(DocRef(parser,0,target,context)); } diff --git a/src/docparser.h b/src/docparser.h index 4fcb06cd0a9..3a15b6b183d 100644 --- a/src/docparser.h +++ b/src/docparser.h @@ -87,7 +87,7 @@ IDocNodeASTPtr validatingParseDoc(IDocParser &parserIntf,const QCString &fileNam */ IDocNodeASTPtr validatingParseText(IDocParser &parser,const QCString &input); -IDocNodeASTPtr createRef(IDocParser &parser,const QCString &target,const QCString &context); +IDocNodeASTPtr createRef(IDocParser &parser,const QCString &target,const QCString &context, const QCString &srcFile = "", int srcLine = -1); //-------------------------------------------------------------------------------- diff --git a/src/msc.cpp b/src/msc.cpp index 349d415e333..b377b70becd 100644 --- a/src/msc.cpp +++ b/src/msc.cpp @@ -29,7 +29,7 @@ static const int maxCmdLine = 40960; static bool convertMapFile(TextStream &t,const QCString &mapName,const QCString &relPath, - const QCString &context) + const QCString &context,const QCString &srcFile,int srcLine) { std::ifstream f = Portable::openInputStream(mapName); if (!f.is_open()) @@ -63,17 +63,22 @@ static bool convertMapFile(TextStream &t,const QCString &mapName,const QCString if (y2(dfAst.get()); const DocRef *df = std::get_if(&dfAstImpl->root); t << externalRef(relPath,df->ref(),TRUE); + if (!df->file().isEmpty() || !df->anchor().isEmpty()) + { + link = true; + t << "file().isEmpty()) { QCString fn = df->file(); @@ -87,11 +92,16 @@ static bool convertMapFile(TextStream &t,const QCString &mapName,const QCString } else { + link = true; + t << "\"\"/\n"; + if (link) + { + t << "\" shape=\"rect\" coords=\"" + << x1 << "," << y1 << "," << x2 << "," << y2 << "\"" + << " alt=\"\"/>\n"; + } } } @@ -204,7 +214,7 @@ static QCString getMscImageMapFromFile(const QCString& inFile, const QCString& / return ""; TextStream t; - convertMapFile(t, outFile, relPath, context); + convertMapFile(t, outFile, relPath, context, srcFile, srcLine); Dir().remove(outFile.str()); diff --git a/src/util.cpp b/src/util.cpp index 4da4b7a49e7..4ffe929b795 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -4573,16 +4573,16 @@ QCString substituteTemplateArgumentsInString( { if (formArg.name==n && actualArgs && actIt!=actualArgs->end() && !actArg.type.isEmpty()) // base class is a template argument { - static constexpr auto hasRecursion = [](const QCString &name,const QCString &subst) -> bool + static constexpr auto hasRecursion = [](const QCString &nameArg,const QCString &subst) -> bool { - int i; - int p=0; - while ((i=subst.find(name,p))!=-1) + int ii; + int pp=0; + while ((ii=subst.find(nameArg,pp))!=-1) { - bool beforeNonWord = i==0 || !isId(subst.at(i-1)); - bool afterNonWord = subst.length()==i+name.length() || !isId(subst.at(i+name.length())); - if (beforeNonWord && afterNonWord) return true; // if name=='A' then subst=='A::Z' or 'S' or 'Z::A' should return true, but 'AA::ZZ' or 'BAH' should not match - p=i+name.length(); + bool beforeNonWord = ii==0 || !isId(subst.at(ii-1)); + bool afterNonWord = subst.length()==ii+nameArg.length() || !isId(subst.at(ii+nameArg.length())); + if (beforeNonWord && afterNonWord) return true; // if nameArg=='A' then subst=='A::Z' or 'S' or 'Z::A' should return true, but 'AA::ZZ' or 'BAH' should not match + pp=ii+nameArg.length(); } return false; }; @@ -4594,7 +4594,7 @@ QCString substituteTemplateArgumentsInString( // since n==A and actArg->type==A::T // see bug595833 for an example // - // Also prevent recursive subtitution if n is part of actArg.type, i.e. + // Also prevent recursive substitution if n is part of actArg.type, i.e. // n='A' in argType='S< A >' would produce 'S< S< A > >' { if (actArg.name.isEmpty()) diff --git a/testing/CMakeLists.txt b/testing/CMakeLists.txt index f95ac422db2..0ef822cec28 100644 --- a/testing/CMakeLists.txt +++ b/testing/CMakeLists.txt @@ -6,11 +6,7 @@ add_custom_target(tests ) # get the files in the testing directory starting with 3 digits and an underscore -if (${CMAKE_VERSION} VERSION_EQUAL "3.11.0" OR ${CMAKE_VERSION} VERSION_GREATER "3.11.0") - file(GLOB TEST_FILES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/[0-9][0-9][0-9]_*.*") -else() - file(GLOB TEST_FILES "${CMAKE_CURRENT_SOURCE_DIR}/[0-9][0-9][0-9]_*.*") -endif() +file(GLOB TEST_FILES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/[0-9][0-9][0-9]_*.*") foreach(TEST_FILE ${TEST_FILES}) # extract the test name from the file name