Skip to content

Commit

Permalink
Merge branch 'master' of github.com:doxygen/doxygen
Browse files Browse the repository at this point in the history
  • Loading branch information
doxygen committed Sep 1, 2023
2 parents 719dbc3 + d47af2c commit d062df6
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 44 deletions.
7 changes: 1 addition & 6 deletions doc/CMakeLists.txt
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions doc_internal/CMakeLists.txt
Expand Up @@ -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}
Expand Down
12 changes: 2 additions & 10 deletions src/CMakeLists.txt
Expand Up @@ -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})
Expand Down Expand Up @@ -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(
Expand Down
7 changes: 6 additions & 1 deletion src/docparser.cpp
Expand Up @@ -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<DocParser*>(&parserIntf);
assert(parser!=0);
if (parser==0) return 0;
if (!srcFile.isEmpty())
{
parser->context.fileName = srcFile;
parser->tokenizer.setLineNr(srcLine);
}
return std::make_unique<DocNodeAST>(DocRef(parser,0,target,context));
}

Expand Down
2 changes: 1 addition & 1 deletion src/docparser.h
Expand Up @@ -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);

//--------------------------------------------------------------------------------

Expand Down
24 changes: 17 additions & 7 deletions src/msc.cpp
Expand Up @@ -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())
Expand Down Expand Up @@ -63,17 +63,22 @@ static bool convertMapFile(TextStream &t,const QCString &mapName,const QCString
if (y2<y1) { int temp=y2; y2=y1; y1=temp; }
if (x2<x1) { int temp=x2; x2=x1; x1=temp; }

t << "<area href=\"";

bool link = false;
if ( isRef )
{
// handle doxygen \ref tag URL reference

auto parser { createDocParser() };
auto dfAst { createRef( *parser.get(), url, context ) };
auto dfAst { createRef( *parser.get(), url, context, srcFile, srcLine) };
auto dfAstImpl = dynamic_cast<const DocNodeAST*>(dfAst.get());
const DocRef *df = std::get_if<DocRef>(&dfAstImpl->root);
t << externalRef(relPath,df->ref(),TRUE);
if (!df->file().isEmpty() || !df->anchor().isEmpty())
{
link = true;
t << "<area href=\"";
}
if (!df->file().isEmpty())
{
QCString fn = df->file();
Expand All @@ -87,11 +92,16 @@ static bool convertMapFile(TextStream &t,const QCString &mapName,const QCString
}
else
{
link = true;
t << "<area href=\"";
t << url;
}
t << "\" shape=\"rect\" coords=\""
<< x1 << "," << y1 << "," << x2 << "," << y2 << "\""
<< " alt=\"\"/>\n";
if (link)
{
t << "\" shape=\"rect\" coords=\""
<< x1 << "," << y1 << "," << x2 << "," << y2 << "\""
<< " alt=\"\"/>\n";
}
}
}

Expand Down Expand Up @@ -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());

Expand Down
18 changes: 9 additions & 9 deletions src/util.cpp
Expand Up @@ -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<A>' 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<A>' or 'Z::A' should return true, but 'AA::ZZ' or 'BAH' should not match
pp=ii+nameArg.length();
}
return false;
};
Expand All @@ -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())
Expand Down
6 changes: 1 addition & 5 deletions testing/CMakeLists.txt
Expand Up @@ -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
Expand Down

0 comments on commit d062df6

Please sign in to comment.