mirror of
https://github.com/michaelrsweet/mxml.git
synced 2024-11-24 11:25:30 +00:00
Fixes for enum typedefs (still working on comments...)
This commit is contained in:
parent
2b270e9072
commit
a57b72a556
8
CHANGES
8
CHANGES
@ -1,6 +1,12 @@
|
|||||||
CHANGES - 2008-01-28
|
CHANGES - 2008-03-18
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
|
CHANGES IN Mini-XML 2.5.1
|
||||||
|
|
||||||
|
- The mxmldoc program now handles "typedef enum name {} name"
|
||||||
|
correctly.
|
||||||
|
|
||||||
|
|
||||||
CHANGES IN Mini-XML 2.5
|
CHANGES IN Mini-XML 2.5
|
||||||
|
|
||||||
- The mxmldoc program now makes greater use of CSS and
|
- The mxmldoc program now makes greater use of CSS and
|
||||||
|
92
mxmldoc.c
92
mxmldoc.c
@ -1,3 +1,4 @@
|
|||||||
|
/*#define DEBUG 1*/
|
||||||
/*
|
/*
|
||||||
* "$Id$"
|
* "$Id$"
|
||||||
*
|
*
|
||||||
@ -1206,7 +1207,9 @@ scan_file(const char *filename, /* I - Filename */
|
|||||||
if (structclass)
|
if (structclass)
|
||||||
scope = NULL;
|
scope = NULL;
|
||||||
|
|
||||||
enumeration = NULL;
|
if (!typedefnode)
|
||||||
|
enumeration = NULL;
|
||||||
|
|
||||||
constant = NULL;
|
constant = NULL;
|
||||||
structclass = NULL;
|
structclass = NULL;
|
||||||
|
|
||||||
@ -1261,10 +1264,11 @@ scan_file(const char *filename, /* I - Filename */
|
|||||||
case ';' :
|
case ';' :
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fputs("Identifier: <<<< ; >>>\n", stderr);
|
fputs("Identifier: <<<< ; >>>\n", stderr);
|
||||||
fprintf(stderr, " function=%p, type=%p\n", function, type);
|
fprintf(stderr, " enumeration=%p, function=%p, type=%p, type->child=%p, typedefnode=%p\n",
|
||||||
|
enumeration, function, type, type ? type->child : NULL, typedefnode);
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
|
|
||||||
if (function)
|
if (function)
|
||||||
{
|
{
|
||||||
if (!strcmp(tree->value.element.name, "class"))
|
if (!strcmp(tree->value.element.name, "class"))
|
||||||
{
|
{
|
||||||
@ -1283,7 +1287,7 @@ scan_file(const char *filename, /* I - Filename */
|
|||||||
if (type)
|
if (type)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* See if we have a function typedef...
|
* See if we have a typedef...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (type->child &&
|
if (type->child &&
|
||||||
@ -1306,23 +1310,56 @@ scan_file(const char *filename, /* I - Filename */
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (node)
|
if (!node)
|
||||||
{
|
node = type->last_child;
|
||||||
mxmlElementSetAttr(typedefnode, "name",
|
|
||||||
node->value.text.string);
|
|
||||||
sort_node(tree, typedefnode);
|
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
fprintf(stderr, " ADDING TYPEDEF FOR %p(%s)...\n",
|
||||||
|
node, node->value.text.string);
|
||||||
|
#endif /* DEBUG */
|
||||||
|
|
||||||
|
mxmlElementSetAttr(typedefnode, "name",
|
||||||
|
node->value.text.string);
|
||||||
|
sort_node(tree, typedefnode);
|
||||||
|
|
||||||
|
if (type->child != node)
|
||||||
mxmlDelete(type->child);
|
mxmlDelete(type->child);
|
||||||
mxmlDelete(node);
|
|
||||||
|
|
||||||
if (type->child)
|
mxmlDelete(node);
|
||||||
type->child->value.text.whitespace = 0;
|
|
||||||
|
|
||||||
mxmlAdd(typedefnode, MXML_ADD_AFTER, MXML_ADD_TO_PARENT,
|
if (type->child)
|
||||||
type);
|
type->child->value.text.whitespace = 0;
|
||||||
type = NULL;
|
|
||||||
break;
|
mxmlAdd(typedefnode, MXML_ADD_AFTER, MXML_ADD_TO_PARENT,
|
||||||
}
|
type);
|
||||||
|
type = NULL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (typedefnode && enumeration)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Add enum typedef...
|
||||||
|
*/
|
||||||
|
|
||||||
|
node = type->child;
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
fprintf(stderr, " ADDING TYPEDEF FOR %p(%s)...\n",
|
||||||
|
node, node->value.text.string);
|
||||||
|
#endif /* DEBUG */
|
||||||
|
|
||||||
|
mxmlElementSetAttr(typedefnode, "name",
|
||||||
|
node->value.text.string);
|
||||||
|
sort_node(tree, typedefnode);
|
||||||
|
mxmlDelete(type);
|
||||||
|
|
||||||
|
type = mxmlNewElement(typedefnode, "type");
|
||||||
|
mxmlNewText(type, 0, "enum");
|
||||||
|
mxmlNewText(type, 1,
|
||||||
|
mxmlElementGetAttr(enumeration, "name"));
|
||||||
|
enumeration = NULL;
|
||||||
|
type = NULL;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
mxmlDelete(type);
|
mxmlDelete(type);
|
||||||
@ -1438,8 +1475,11 @@ scan_file(const char *filename, /* I - Filename */
|
|||||||
if (comment->child != comment->last_child)
|
if (comment->child != comment->last_child)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, " removing comment %p, last comment %p...\n",
|
fprintf(stderr, " removing comment %p(%20.20s), last comment %p(%20.20s)...\n",
|
||||||
comment->child, comment->last_child);
|
comment->child,
|
||||||
|
comment->child ? comment->child->value.text.string : "",
|
||||||
|
comment->last_child,
|
||||||
|
comment->last_child ? comment->last_child->value.text.string : "");
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
mxmlDelete(comment->child);
|
mxmlDelete(comment->child);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
@ -1605,8 +1645,11 @@ scan_file(const char *filename, /* I - Filename */
|
|||||||
if (comment->child != comment->last_child)
|
if (comment->child != comment->last_child)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, " removing comment %p, last comment %p...\n",
|
fprintf(stderr, " removing comment %p(%20.20s), last comment %p(%20.20s)...\n",
|
||||||
comment->child, comment->last_child);
|
comment->child,
|
||||||
|
comment->child ? comment->child->value.text.string : "",
|
||||||
|
comment->last_child,
|
||||||
|
comment->last_child ? comment->last_child->value.text.string : "");
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
mxmlDelete(comment->child);
|
mxmlDelete(comment->child);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
@ -1756,8 +1799,11 @@ scan_file(const char *filename, /* I - Filename */
|
|||||||
if (comment->child != comment->last_child)
|
if (comment->child != comment->last_child)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, " removing comment %p, last comment %p...\n",
|
fprintf(stderr, " removing comment %p(%20.20s), last comment %p(%20.20s)...\n",
|
||||||
comment->child, comment->last_child);
|
comment->child,
|
||||||
|
comment->child ? comment->child->value.text.string : "",
|
||||||
|
comment->last_child,
|
||||||
|
comment->last_child ? comment->last_child->value.text.string : "");
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
mxmlDelete(comment->child);
|
mxmlDelete(comment->child);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
@ -14,7 +14,7 @@ while test $# -gt 0; do
|
|||||||
-v) mode="valgrind" ;;
|
-v) mode="valgrind" ;;
|
||||||
*.h | *.c | *.cxx) files="$files $arg" ;;
|
*.h | *.c | *.cxx) files="$files $arg" ;;
|
||||||
*)
|
*)
|
||||||
echo "Usage: ./dotest.sh [-g] [-v] [files]"
|
echo "Usage: ./dotest.sh [-f] [-g] [-v] [files]"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@ -28,7 +28,9 @@ rm -f test.xml
|
|||||||
|
|
||||||
case "$mode" in
|
case "$mode" in
|
||||||
gdb)
|
gdb)
|
||||||
echo "run $framed test.xml $files >test.html 2>test.log" >.gdbcmds
|
echo "break malloc_error_break" >.gdbcmds
|
||||||
|
echo "set env DYLD_INSERT_LIBRARIES /usr/lib/libgmalloc.dylib" >>.gdbcmds
|
||||||
|
echo "run $framed test.xml $files >test.html 2>test.log" >>.gdbcmds
|
||||||
gdb -x .gdbcmds ../mxmldoc-static
|
gdb -x .gdbcmds ../mxmldoc-static
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user