Skip to content

Commit b4ec5e1

Browse files
committed
doxyparse bugfixes and minor improvements
- removing double quotes from function arguments list - fix doxyparse segfault for python source files - documenting install instructions from source - documenting build dependencies - updating email address Signed-off-by: Igor Ribeiro Barbosa Duarte <igor.ribeiro.duarte@gmail.com> Signed-off-by: Jonathan Moraes <arkyebr@gmail.com> Signed-off-by: Kleber <kleberbritomoreira10@gmail.com> Signed-off-by: leonardork <leodegolim@yahoo.com.br> Signed-off-by: Marcelo Ferreira <marcelohpf@gmail.com> Signed-off-by: Matheus Miranda <matheusmirandalacerda@gmail.com> Signed-off-by: Sabryna de Sousa <sabryna.sousa1323@gmail.com> Signed-off-by: VinyPinheiro <viny-pinheiro@hotmail.com>
1 parent 2f4139d commit b4ec5e1

File tree

2 files changed

+37
-8
lines changed

2 files changed

+37
-8
lines changed

addon/doxyparse/README

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,24 @@ This directory contains an "source parsing engine" based on doxyapp code.
55

66
More info and source code repository: https://github.com/analizo/doxygen
77

8+
## build dependencies
9+
10+
apt-get install flex bison cmake build-essential python
11+
812
## build
913

1014
cmake -G "Unix Makefiles" -Dbuild_parse=ON
1115
make
1216

17+
## install
18+
19+
sudo make install
20+
1321
AUTHORS
1422
=======
1523

1624
Antonio Terceiro <terceiro@softwarelivre.org>
1725
João M. Miranda <joaomm88@gmail.com>
18-
Joenio Costa <joenio@colivre.coop.br>
26+
Joenio Costa <joenio@joenio.me>
1927
Paulo Meirelles <paulo@softwarelivre.org>
2028
Vinicius Daros <vkdaros@mercurio.eclipse.ime.usp.br>

addon/doxyparse/doxyparse.cpp

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ static void printDefines() {
138138
modules[current_module] = true;
139139
}
140140
static void printDefinition(std::string type, std::string signature, int line) {
141-
printf(" - %s:\n", signature.c_str());
141+
printf(" - \"%s\":\n", signature.c_str());
142142
printf(" type: %s\n", type.c_str());
143143
printf(" line: %d\n", line);
144144
}
@@ -155,7 +155,7 @@ static void printUses() {
155155
printf(" uses:\n");
156156
}
157157
static void printReferenceTo(std::string type, std::string signature, std::string defined_in) {
158-
printf(" - %s:\n", signature.c_str());
158+
printf(" - \"%s\":\n", signature.c_str());
159159
printf(" type: %s\n", type.c_str());
160160
printf(" defined_in: %s\n", defined_in.c_str());
161161
}
@@ -167,6 +167,24 @@ static int isPartOfCStruct(MemberDef * md) {
167167
return is_c_code && md->getClassDef() != NULL;
168168
}
169169

170+
std::string removeDoubleQuotes(std::string data) {
171+
// remove surrounding double quotes
172+
if (data.front() == '"' && data.back() == '"') {
173+
data.erase(0, 1); // first double quote
174+
data.erase(data.size() - 1); // last double quote
175+
}
176+
return data;
177+
}
178+
179+
std::string argumentData(Argument *argument) {
180+
std::string data = "";
181+
if (argument->type != NULL)
182+
data = removeDoubleQuotes(argument->type.data());
183+
else if (argument->name != NULL)
184+
data = removeDoubleQuotes(argument->name.data());
185+
return data;
186+
}
187+
170188
std::string functionSignature(MemberDef* md) {
171189
std::string signature = md->name().data();
172190
if(md->isFunction()){
@@ -175,9 +193,9 @@ std::string functionSignature(MemberDef* md) {
175193
signature += "(";
176194
Argument * argument = iterator.toFirst();
177195
if(argument != NULL) {
178-
signature += argument->type.data();
179-
for(++iterator; (argument = iterator.current()) ;++iterator){
180-
signature += std::string(",") + argument->type.data();
196+
signature += argumentData(argument);
197+
for(++iterator; (argument = iterator.current()); ++iterator){
198+
signature += std::string(",") + argumentData(argument);
181199
}
182200
}
183201
signature += ")";
@@ -245,7 +263,7 @@ static void lookupSymbol(Definition *d) {
245263
std::string signature = functionSignature(md);
246264
printDefinition(type, signature, md->getDefLine());
247265
if (md->protection() == Public) {
248-
printProtection("protection public");
266+
printProtection("public");
249267
}
250268
if (md->isFunction()) {
251269
functionInformation(md);
@@ -311,7 +329,10 @@ static void detectProgrammingLanguage(FileNameListIterator& fnli) {
311329
checkLanguage(filename, ".cc") ||
312330
checkLanguage(filename, ".cxx") ||
313331
checkLanguage(filename, ".cpp") ||
314-
checkLanguage(filename, ".java")
332+
checkLanguage(filename, ".java") ||
333+
checkLanguage(filename, ".py") ||
334+
checkLanguage(filename, ".pyw") ||
335+
checkLanguage(filename, ".cs")
315336
) {
316337
is_c_code = false;
317338
}

0 commit comments

Comments
 (0)