Code formatting fixes in doxygen code
This commit is contained in:
parent
0483caaed5
commit
73c585b994
4 changed files with 109 additions and 111 deletions
|
|
@ -82,8 +82,10 @@ int isStructuralDoxygen(String *s){
|
||||||
unsigned n;
|
unsigned n;
|
||||||
char *slashPointer = Strchr(s, '\\');
|
char *slashPointer = Strchr(s, '\\');
|
||||||
char *atPointer = Strchr(s,'@');
|
char *atPointer = Strchr(s,'@');
|
||||||
if (slashPointer == NULL && atPointer == NULL) return 0;
|
if (slashPointer == NULL && atPointer == NULL)
|
||||||
else if( slashPointer == NULL) slashPointer = atPointer;
|
return 0;
|
||||||
|
else if(slashPointer == NULL)
|
||||||
|
slashPointer = atPointer;
|
||||||
|
|
||||||
slashPointer++; /* skip backslash or at sign */
|
slashPointer++; /* skip backslash or at sign */
|
||||||
|
|
||||||
|
|
@ -437,9 +439,7 @@ static int yylook(void) {
|
||||||
if (Len(cmt) > 3 && loc[0] == '/' &&
|
if (Len(cmt) > 3 && loc[0] == '/' &&
|
||||||
((loc[1] == '/' && ((loc[2] == '/' && loc[3] != '/') || loc[2] == '!')) ||
|
((loc[1] == '/' && ((loc[2] == '/' && loc[3] != '/') || loc[2] == '!')) ||
|
||||||
(loc[1] == '*' && ((loc[2] == '*' && loc[3] != '*') || loc[2] == '!')))) {
|
(loc[1] == '*' && ((loc[2] == '*' && loc[3] != '*') || loc[2] == '!')))) {
|
||||||
comment_kind_t this_comment = loc[3] == '<' ? DOX_COMMENT_POST
|
comment_kind_t this_comment = loc[3] == '<' ? DOX_COMMENT_POST : DOX_COMMENT_PRE;
|
||||||
: DOX_COMMENT_PRE;
|
|
||||||
|
|
||||||
if (existing_comment != DOX_COMMENT_NONE && this_comment != existing_comment) {
|
if (existing_comment != DOX_COMMENT_NONE && this_comment != existing_comment) {
|
||||||
/* We can't concatenate together Doxygen pre- and post-comments. */
|
/* We can't concatenate together Doxygen pre- and post-comments. */
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -5048,7 +5048,11 @@ rawparms : parm ptail {
|
||||||
set_nextSibling($1,$2);
|
set_nextSibling($1,$2);
|
||||||
$$ = $1;
|
$$ = $1;
|
||||||
}
|
}
|
||||||
| empty { $$ = 0; previousNode = currentNode; currentNode=0; }
|
| empty {
|
||||||
|
$$ = 0;
|
||||||
|
previousNode = currentNode;
|
||||||
|
currentNode=0;
|
||||||
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
ptail : COMMA parm ptail {
|
ptail : COMMA parm ptail {
|
||||||
|
|
|
||||||
|
|
@ -1283,7 +1283,6 @@ public:
|
||||||
Delete(doxygen_comments);
|
Delete(doxygen_comments);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ((enum_feature != SimpleEnum) && symname && typemap_lookup_type) {
|
if ((enum_feature != SimpleEnum) && symname && typemap_lookup_type) {
|
||||||
// Wrap (non-anonymous) C/C++ enum within a typesafe, typeunsafe or proper Java enum
|
// Wrap (non-anonymous) C/C++ enum within a typesafe, typeunsafe or proper Java enum
|
||||||
|
|
||||||
|
|
@ -1306,18 +1305,16 @@ public:
|
||||||
Replaceall(enum_code, "$static ", "");
|
Replaceall(enum_code, "$static ", "");
|
||||||
Delete(scope);
|
Delete(scope);
|
||||||
} else {
|
} else {
|
||||||
//translate and write javadoc comment for the enum itself if flagged
|
// Translate and write javadoc comment for the enum itself if flagged
|
||||||
if (doxygen && doxygenTranslator->hasDocumentation(n)) {
|
if (doxygen && doxygenTranslator->hasDocumentation(n)) {
|
||||||
String *doxygen_comments = doxygenTranslator->getDocumentation(n);
|
String *doxygen_comments = doxygenTranslator->getDocumentation(n);
|
||||||
if (comment_creation_chatter)
|
if (comment_creation_chatter)
|
||||||
Printf(constants_code, "/* This was generated from enumDeclaration() */");
|
Printf(constants_code, "/* This was generated from enumDeclaration() */");
|
||||||
Printf(constants_code, "/* Comment for enum %s */\n",
|
Printf(constants_code, "/* Comment for enum %s */\n", Getattr(n, "unnamedinstance") ? "" : symname);
|
||||||
Getattr(n, "unnamedinstance") ? "" : symname);
|
|
||||||
Printf(constants_code, Char(doxygen_comments));
|
Printf(constants_code, Char(doxygen_comments));
|
||||||
Printf(constants_code, "\n");
|
Printf(constants_code, "\n");
|
||||||
Delete(doxygen_comments);
|
Delete(doxygen_comments);
|
||||||
}
|
} else if (symname && !Getattr(n, "unnamedinstance"))
|
||||||
else if (symname && !Getattr(n, "unnamedinstance"))
|
|
||||||
Printf(constants_code, " // %s \n", symname);
|
Printf(constants_code, " // %s \n", symname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1472,7 +1469,7 @@ public:
|
||||||
if (!addSymbol(symname, n, scope))
|
if (!addSymbol(symname, n, scope))
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
|
|
||||||
//translate and write javadoc comment if flagged
|
// Translate and write javadoc comment if flagged
|
||||||
if (doxygen && doxygenTranslator->hasDocumentation(n)) {
|
if (doxygen && doxygenTranslator->hasDocumentation(n)) {
|
||||||
String *doxygen_comments = doxygenTranslator->getDocumentation(n);
|
String *doxygen_comments = doxygenTranslator->getDocumentation(n);
|
||||||
if (comment_creation_chatter)
|
if (comment_creation_chatter)
|
||||||
|
|
@ -1557,10 +1554,9 @@ public:
|
||||||
String *tm;
|
String *tm;
|
||||||
String *return_type = NewString("");
|
String *return_type = NewString("");
|
||||||
String *constants_code = NewString("");
|
String *constants_code = NewString("");
|
||||||
|
|
||||||
Swig_save("constantWrapper", n, "value", NIL);
|
Swig_save("constantWrapper", n, "value", NIL);
|
||||||
|
|
||||||
//translate and write javadoc comment if flagged
|
// Translate and write javadoc comment if flagged
|
||||||
if (doxygen && doxygenTranslator->hasDocumentation(n)) {
|
if (doxygen && doxygenTranslator->hasDocumentation(n)) {
|
||||||
String *doxygen_comments = doxygenTranslator->getDocumentation(n);
|
String *doxygen_comments = doxygenTranslator->getDocumentation(n);
|
||||||
if (comment_creation_chatter)
|
if (comment_creation_chatter)
|
||||||
|
|
@ -2009,7 +2005,7 @@ public:
|
||||||
// Pure Java interfaces
|
// Pure Java interfaces
|
||||||
const String *pure_interfaces = typemapLookup(n, "javainterfaces", typemap_lookup_type, WARN_NONE);
|
const String *pure_interfaces = typemapLookup(n, "javainterfaces", typemap_lookup_type, WARN_NONE);
|
||||||
|
|
||||||
//translate and write javadoc comment if flagged
|
// Translate and write javadoc comment if flagged
|
||||||
if (doxygen && doxygenTranslator->hasDocumentation(n)) {
|
if (doxygen && doxygenTranslator->hasDocumentation(n)) {
|
||||||
String *doxygen_comments = doxygenTranslator->getDocumentation(n);
|
String *doxygen_comments = doxygenTranslator->getDocumentation(n);
|
||||||
if (comment_creation_chatter)
|
if (comment_creation_chatter)
|
||||||
|
|
@ -2021,7 +2017,6 @@ public:
|
||||||
if (*Char(interface_list) && *Char(pure_interfaces))
|
if (*Char(interface_list) && *Char(pure_interfaces))
|
||||||
Append(interface_list, ", ");
|
Append(interface_list, ", ");
|
||||||
Append(interface_list, pure_interfaces);
|
Append(interface_list, pure_interfaces);
|
||||||
|
|
||||||
// Start writing the proxy class
|
// Start writing the proxy class
|
||||||
if (!has_outerclass) // Import statements
|
if (!has_outerclass) // Import statements
|
||||||
Printv(proxy_class_def, typemapLookup(n, "javaimports", typemap_lookup_type, WARN_NONE),"\n", NIL);
|
Printv(proxy_class_def, typemapLookup(n, "javaimports", typemap_lookup_type, WARN_NONE),"\n", NIL);
|
||||||
|
|
@ -2507,7 +2502,7 @@ public:
|
||||||
setter_flag = (Cmp(Getattr(n, "sym:name"), Swig_name_set(getNSpace(), Swig_name_member(0, getClassPrefix(), variable_name))) == 0);
|
setter_flag = (Cmp(Getattr(n, "sym:name"), Swig_name_set(getNSpace(), Swig_name_member(0, getClassPrefix(), variable_name))) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//translate and write javadoc comment if flagged
|
// Translate and write javadoc comment if flagged
|
||||||
if (doxygen && doxygenTranslator->hasDocumentation(n)) {
|
if (doxygen && doxygenTranslator->hasDocumentation(n)) {
|
||||||
String *doxygen_comments = doxygenTranslator->getDocumentation(n);
|
String *doxygen_comments = doxygenTranslator->getDocumentation(n);
|
||||||
if (comment_creation_chatter)
|
if (comment_creation_chatter)
|
||||||
|
|
@ -2751,7 +2746,7 @@ public:
|
||||||
tm = Getattr(n, "tmap:jtype"); // typemaps were attached earlier to the node
|
tm = Getattr(n, "tmap:jtype"); // typemaps were attached earlier to the node
|
||||||
Printf(im_return_type, "%s", tm);
|
Printf(im_return_type, "%s", tm);
|
||||||
|
|
||||||
//translate and write javadoc comment if flagged
|
// Translate and write javadoc comment if flagged
|
||||||
if (doxygen && doxygenTranslator->hasDocumentation(n)) {
|
if (doxygen && doxygenTranslator->hasDocumentation(n)) {
|
||||||
String *doxygen_comments = doxygenTranslator->getDocumentation(n);
|
String *doxygen_comments = doxygenTranslator->getDocumentation(n);
|
||||||
if (comment_creation_chatter)
|
if (comment_creation_chatter)
|
||||||
|
|
@ -3025,7 +3020,7 @@ public:
|
||||||
String *pre_code = NewString("");
|
String *pre_code = NewString("");
|
||||||
String *post_code = NewString("");
|
String *post_code = NewString("");
|
||||||
|
|
||||||
// translate and write javadoc comment if flagged
|
// Translate and write javadoc comment if flagged
|
||||||
if (doxygen && doxygenTranslator->hasDocumentation(n)) {
|
if (doxygen && doxygenTranslator->hasDocumentation(n)) {
|
||||||
String *doxygen_comments = doxygenTranslator->getDocumentation(n);
|
String *doxygen_comments = doxygenTranslator->getDocumentation(n);
|
||||||
if (comment_creation_chatter)
|
if (comment_creation_chatter)
|
||||||
|
|
@ -3514,7 +3509,6 @@ public:
|
||||||
const String *pure_baseclass = typemapLookup(n, "javabase", type, WARN_NONE);
|
const String *pure_baseclass = typemapLookup(n, "javabase", type, WARN_NONE);
|
||||||
const String *pure_interfaces = typemapLookup(n, "javainterfaces", type, WARN_NONE);
|
const String *pure_interfaces = typemapLookup(n, "javainterfaces", type, WARN_NONE);
|
||||||
|
|
||||||
|
|
||||||
// Emit the class
|
// Emit the class
|
||||||
Printv(swigtype, typemapLookup(n, "javaimports", type, WARN_NONE), // Import statements
|
Printv(swigtype, typemapLookup(n, "javaimports", type, WARN_NONE), // Import statements
|
||||||
"\n", typemapLookup(n, "javaclassmodifiers", type, WARN_JAVA_TYPEMAP_CLASSMOD_UNDEF), // Class modifiers
|
"\n", typemapLookup(n, "javaclassmodifiers", type, WARN_JAVA_TYPEMAP_CLASSMOD_UNDEF), // Class modifiers
|
||||||
|
|
@ -4993,4 +4987,3 @@ Java Options (available with -java)\n\
|
||||||
-oldvarnames - Old intermediary method names for variable wrappers\n\
|
-oldvarnames - Old intermediary method names for variable wrappers\n\
|
||||||
-package <name> - Set name of the Java package to <name>\n\
|
-package <name> - Set name of the Java package to <name>\n\
|
||||||
\n";
|
\n";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1688,6 +1688,7 @@ public:
|
||||||
|
|
||||||
/* ------------------------------------------------------------
|
/* ------------------------------------------------------------
|
||||||
* build_combined_docstring()
|
* build_combined_docstring()
|
||||||
|
*
|
||||||
* Build the full docstring which may be a combination of the
|
* Build the full docstring which may be a combination of the
|
||||||
* explicit docstring and autodoc string or, if none of them
|
* explicit docstring and autodoc string or, if none of them
|
||||||
* is specified, obtained by translating Doxygen comment to
|
* is specified, obtained by translating Doxygen comment to
|
||||||
|
|
@ -1696,6 +1697,7 @@ public:
|
||||||
* Return new string to be deleted by caller (never NIL but
|
* Return new string to be deleted by caller (never NIL but
|
||||||
* may be empty if there is no docstring).
|
* may be empty if there is no docstring).
|
||||||
* ------------------------------------------------------------ */
|
* ------------------------------------------------------------ */
|
||||||
|
|
||||||
String *build_combined_docstring(Node *n, autodoc_t ad_type, const String *indent = "") {
|
String *build_combined_docstring(Node *n, autodoc_t ad_type, const String *indent = "") {
|
||||||
String *docstr = Getattr(n, "feature:docstring");
|
String *docstr = Getattr(n, "feature:docstring");
|
||||||
if (docstr && Len(docstr)) {
|
if (docstr && Len(docstr)) {
|
||||||
|
|
@ -1751,8 +1753,7 @@ public:
|
||||||
// """
|
// """
|
||||||
//
|
//
|
||||||
// otherwise, put it all on a single line
|
// otherwise, put it all on a single line
|
||||||
if (Strchr(docstr, '\n'))
|
if (Strchr(docstr, '\n')) {
|
||||||
{
|
|
||||||
String *tmp = NewString("");
|
String *tmp = NewString("");
|
||||||
Append(tmp, "\n");
|
Append(tmp, "\n");
|
||||||
Append(tmp, indent_docstring(docstr, indent));
|
Append(tmp, indent_docstring(docstr, indent));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue