From 1db04bf322eb8f954d9b048d68e2b9f89c92f8fb Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Fri, 25 Mar 2022 23:31:43 +0000 Subject: [PATCH] Improvements to the -debug command line options The debug command line options that display parse tree nodes (-debug-module, -debug-top, -debug-symtabs) now display previously hidden linked list pointers which are useful for debugging parse trees. Added new command line option -debug-quiet. This suppresses the display of most linked list pointers and symbol table pointers in the parse tree nodes. The keys in the parse tree node are now shown in alphabetical order. --- CHANGES.current | 10 + Doc/Manual/Extending.html | 408 ++++++++++++++++++---------------- Doc/Manual/SWIG.html | 12 +- Source/Modules/javascript.cxx | 5 - Source/Modules/main.cxx | 4 + Source/Modules/overload.cxx | 2 - Source/Modules/r.cxx | 2 - Source/Swig/swigtree.h | 1 + Source/Swig/tree.c | 48 +++- 9 files changed, 277 insertions(+), 215 deletions(-) diff --git a/CHANGES.current b/CHANGES.current index dbb4ec9a7..937f9f871 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -7,6 +7,16 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/ Version 4.1.0 (in progress) =========================== +2022-03-25: wsfulton + The debug command line options that display parse tree nodes + (-debug-module, -debug-top, -debug-symtabs) now display previously hidden + linked list pointers which are useful for debugging parse trees. + + Added new command line option -debug-quiet. This suppresses the display + of most linked list pointers and symbol table pointers in the parse tree nodes. + + The keys in the parse tree node are now shown in alphabetical order. + 2022-03-24: wsfulton #2244 Fix using declaration in derived class bugs when all the base class's overloaded methods were overridden in the derived class - diff --git a/Doc/Manual/Extending.html b/Doc/Manual/Extending.html index ad90d7b63..e70f30183 100644 --- a/Doc/Manual/Extending.html +++ b/Doc/Manual/Extending.html @@ -462,187 +462,220 @@ the stage being processed. There are a number of other parse tree display options, for example, swig -debug-module <n> will avoid displaying system parse information and only display the parse tree pertaining to the user's module at stage n of processing. +Adding the -debug-quiet option is recommended as it removes some noise which is not usually needed, +that is, the display of many linked list pointers and symbol table pointers.

-$ swig -c++ -python -debug-module 4 example.i
-      +++ include ----------------------------------------
-      | name         - "example.i"
+$ swig -c++ -python -debug-module 1 -debug-quiet example.i
+debug-module stage 1
++++ module ----------------------------------------
+| name         - "example"
+| 
++++ insert ----------------------------------------
+| code         - "\n#include \"example.h\"\n"
+| 
++++ include ----------------------------------------
+| name         - "example.h"
 
-            +++ module ----------------------------------------
-            | name         - "example"
-            |
-            +++ insert ----------------------------------------
-            | code         - "\n#include \"example.h\"\n"
-            |
-            +++ include ----------------------------------------
-            | name         - "example.h"
+      +++ class ----------------------------------------
+      | abstracts    - 0x7f4f15182930
+      | allows_typedef - "1"
+      | kind         - "class"
+      | name         - "Shape"
+      | sym:name     - "Shape"
 
-                  +++ class ----------------------------------------
-                  | abstract     - "1"
-                  | sym:name     - "Shape"
-                  | name         - "Shape"
-                  | kind         - "class"
-                  | symtab       - 0x40194140
-                  | sym:symtab   - 0x40191078
+            +++ access ----------------------------------------
+            | kind         - "public"
+            | 
+            +++ constructor ----------------------------------------
+            | access       - "public"
+            | code         - "{\n    nshapes++;\n  }"
+            | decl         - "f()."
+            | feature:new  - "1"
+            | ismember     - "1"
+            | name         - "Shape"
+            | sym:name     - "Shape"
+            | 
+            +++ destructor ----------------------------------------
+            | access       - "public"
+            | code         - "{\n    nshapes--;\n  }"
+            | decl         - "f()."
+            | ismember     - "1"
+            | name         - "~Shape"
+            | storage      - "virtual"
+            | sym:name     - "~Shape"
+            | 
+            +++ cdecl ----------------------------------------
+            | access       - "public"
+            | decl         - ""
+            | ismember     - "1"
+            | kind         - "variable"
+            | name         - "x"
+            | sym:name     - "x"
+            | type         - "double"
+            | 
+            +++ cdecl ----------------------------------------
+            | access       - "public"
+            | decl         - ""
+            | ismember     - "1"
+            | kind         - "variable"
+            | name         - "y"
+            | sym:name     - "y"
+            | type         - "double"
+            | 
+            +++ cdecl ----------------------------------------
+            | access       - "public"
+            | decl         - "f(double,double)."
+            | ismember     - "1"
+            | kind         - "function"
+            | name         - "move"
+            | parms        - 'double dx,double dy'
+            | sym:name     - "move"
+            | type         - "void"
+            | 
+            +++ cdecl ----------------------------------------
+            | abstract     - "1"
+            | access       - "public"
+            | decl         - "f()."
+            | ismember     - "1"
+            | kind         - "function"
+            | name         - "area"
+            | storage      - "virtual"
+            | sym:name     - "area"
+            | type         - "double"
+            | value        - "0"
+            | valuetype    - "int"
+            | 
+            +++ cdecl ----------------------------------------
+            | abstract     - "1"
+            | access       - "public"
+            | decl         - "f()."
+            | ismember     - "1"
+            | kind         - "function"
+            | name         - "perimeter"
+            | storage      - "virtual"
+            | sym:name     - "perimeter"
+            | type         - "double"
+            | value        - "0"
+            | valuetype    - "int"
+            | 
+            +++ cdecl ----------------------------------------
+            | access       - "public"
+            | decl         - ""
+            | ismember     - "1"
+            | kind         - "variable"
+            | name         - "nshapes"
+            | storage      - "static"
+            | sym:name     - "nshapes"
+            | type         - "int"
+            | 
+      +++ class ----------------------------------------
+      | allows_typedef - "1"
+      | baselist     - 0x7f4f15182ad0
+      | kind         - "class"
+      | name         - "Circle"
+      | privatebaselist - 0x7f4f15182b10
+      | protectedbaselist - 0x7f4f15182af0
+      | sym:name     - "Circle"
 
-                        +++ access ----------------------------------------
-                        | kind         - "public"
-                        |
-                        +++ constructor ----------------------------------------
-                        | sym:name     - "Shape"
-                        | name         - "Shape"
-                        | decl         - "f()."
-                        | code         - "{\n    nshapes++;\n  }"
-                        | sym:symtab   - 0x40194140
-                        |
-                        +++ destructor ----------------------------------------
-                        | sym:name     - "~Shape"
-                        | name         - "~Shape"
-                        | storage      - "virtual"
-                        | code         - "{\n    nshapes--;\n  }"
-                        | sym:symtab   - 0x40194140
-                        |
-                        +++ cdecl ----------------------------------------
-                        | sym:name     - "x"
-                        | name         - "x"
-                        | decl         - ""
-                        | type         - "double"
-                        | sym:symtab   - 0x40194140
-                        |
-                        +++ cdecl ----------------------------------------
-                        | sym:name     - "y"
-                        | name         - "y"
-                        | decl         - ""
-                        | type         - "double"
-                        | sym:symtab   - 0x40194140
-                        |
-                        +++ cdecl ----------------------------------------
-                        | sym:name     - "move"
-                        | name         - "move"
-                        | decl         - "f(double, double)."
-                        | parms        - double, double
-                        | type         - "void"
-                        | sym:symtab   - 0x40194140
-                        |
-                        +++ cdecl ----------------------------------------
-                        | sym:name     - "area"
-                        | name         - "area"
-                        | decl         - "f(void)."
-                        | parms        - void
-                        | storage      - "virtual"
-                        | value        - "0"
-                        | type         - "double"
-                        | sym:symtab   - 0x40194140
-                        |
-                        +++ cdecl ----------------------------------------
-                        | sym:name     - "perimeter"
-                        | name         - "perimeter"
-                        | decl         - "f(void)."
-                        | parms        - void
-                        | storage      - "virtual"
-                        | value        - "0"
-                        | type         - "double"
-                        | sym:symtab   - 0x40194140
-                        |
-                        +++ cdecl ----------------------------------------
-                        | sym:name     - "nshapes"
-                        | name         - "nshapes"
-                        | decl         - ""
-                        | storage      - "static"
-                        | type         - "int"
-                        | sym:symtab   - 0x40194140
-                        |
-                  +++ class ----------------------------------------
-                  | sym:name     - "Circle"
-                  | name         - "Circle"
-                  | kind         - "class"
-                  | bases        - 0x40194510
-                  | symtab       - 0x40194538
-                  | sym:symtab   - 0x40191078
+            +++ access ----------------------------------------
+            | kind         - "private"
+            | 
+            +++ cdecl ----------------------------------------
+            | access       - "private"
+            | decl         - ""
+            | ismember     - "1"
+            | kind         - "variable"
+            | name         - "radius"
+            | type         - "double"
+            | 
+            +++ access ----------------------------------------
+            | kind         - "public"
+            | 
+            +++ constructor ----------------------------------------
+            | access       - "public"
+            | code         - "{ }"
+            | decl         - "f(double)."
+            | feature:new  - "1"
+            | ismember     - "1"
+            | name         - "Circle"
+            | parms        - 'double r'
+            | sym:name     - "Circle"
+            | 
+            +++ cdecl ----------------------------------------
+            | access       - "public"
+            | decl         - "f()."
+            | ismember     - "1"
+            | kind         - "function"
+            | name         - "area"
+            | storage      - "virtual"
+            | sym:name     - "area"
+            | type         - "double"
+            | 
+            +++ cdecl ----------------------------------------
+            | access       - "public"
+            | decl         - "f()."
+            | ismember     - "1"
+            | kind         - "function"
+            | name         - "perimeter"
+            | storage      - "virtual"
+            | sym:name     - "perimeter"
+            | type         - "double"
+            | 
+      +++ class ----------------------------------------
+      | allows_typedef - "1"
+      | baselist     - 0x7f4f15183830
+      | kind         - "class"
+      | name         - "Square"
+      | privatebaselist - 0x7f4f15183870
+      | protectedbaselist - 0x7f4f15183850
+      | sym:name     - "Square"
 
-                        +++ access ----------------------------------------
-                        | kind         - "private"
-                        |
-                        +++ cdecl ----------------------------------------
-                        | name         - "radius"
-                        | decl         - ""
-                        | type         - "double"
-                        |
-                        +++ access ----------------------------------------
-                        | kind         - "public"
-                        |
-                        +++ constructor ----------------------------------------
-                        | sym:name     - "Circle"
-                        | name         - "Circle"
-                        | parms        - double
-                        | decl         - "f(double)."
-                        | code         - "{ }"
-                        | sym:symtab   - 0x40194538
-                        |
-                        +++ cdecl ----------------------------------------
-                        | sym:name     - "area"
-                        | name         - "area"
-                        | decl         - "f(void)."
-                        | parms        - void
-                        | storage      - "virtual"
-                        | type         - "double"
-                        | sym:symtab   - 0x40194538
-                        |
-                        +++ cdecl ----------------------------------------
-                        | sym:name     - "perimeter"
-                        | name         - "perimeter"
-                        | decl         - "f(void)."
-                        | parms        - void
-                        | storage      - "virtual"
-                        | type         - "double"
-                        | sym:symtab   - 0x40194538
-                        |
-                  +++ class ----------------------------------------
-                  | sym:name     - "Square"
-                  | name         - "Square"
-                  | kind         - "class"
-                  | bases        - 0x40194760
-                  | symtab       - 0x40194788
-                  | sym:symtab   - 0x40191078
-
-                        +++ access ----------------------------------------
-                        | kind         - "private"
-                        |
-                        +++ cdecl ----------------------------------------
-                        | name         - "width"
-                        | decl         - ""
-                        | type         - "double"
-                        |
-                        +++ access ----------------------------------------
-                        | kind         - "public"
-                        |
-                        +++ constructor ----------------------------------------
-                        | sym:name     - "Square"
-                        | name         - "Square"
-                        | parms        - double
-                        | decl         - "f(double)."
-                        | code         - "{ }"
-                        | sym:symtab   - 0x40194788
-                        |
-                        +++ cdecl ----------------------------------------
-                        | sym:name     - "area"
-                        | name         - "area"
-                        | decl         - "f(void)."
-                        | parms        - void
-                        | storage      - "virtual"
-                        | type         - "double"
-                        | sym:symtab   - 0x40194788
-                        |
-                        +++ cdecl ----------------------------------------
-                        | sym:name     - "perimeter"
-                        | name         - "perimeter"
-                        | decl         - "f(void)."
-                        | parms        - void
-                        | storage      - "virtual"
-                        | type         - "double"
-                        | sym:symtab   - 0x40194788
+            +++ access ----------------------------------------
+            | kind         - "private"
+            | 
+            +++ cdecl ----------------------------------------
+            | access       - "private"
+            | decl         - ""
+            | ismember     - "1"
+            | kind         - "variable"
+            | name         - "width"
+            | type         - "double"
+            | 
+            +++ access ----------------------------------------
+            | kind         - "public"
+            | 
+            +++ constructor ----------------------------------------
+            | access       - "public"
+            | code         - "{ }"
+            | decl         - "f(double)."
+            | feature:new  - "1"
+            | ismember     - "1"
+            | name         - "Square"
+            | parms        - 'double w'
+            | sym:name     - "Square"
+            | 
+            +++ cdecl ----------------------------------------
+            | access       - "public"
+            | decl         - "f()."
+            | ismember     - "1"
+            | kind         - "function"
+            | name         - "area"
+            | storage      - "virtual"
+            | sym:name     - "area"
+            | type         - "double"
+            | 
+            +++ cdecl ----------------------------------------
+            | access       - "public"
+            | decl         - "f()."
+            | ismember     - "1"
+            | kind         - "function"
+            | name         - "perimeter"
+            | storage      - "virtual"
+            | sym:name     - "perimeter"
+            | type         - "double"
 
@@ -698,31 +731,28 @@ The parse tree can be viewed after the final stage of processing by running SWIG
-$ swig -debug-top 4 example.i
+$ swig -debug-top 1 -debug-quiet example.i
 ...
             +++ cdecl ----------------------------------------
-            | sym:name     - "foo_i"
-            | name         - "foo"
             | decl         - "f(int)."
+            | name         - "foo"
             | parms        - int
+            | sym:name     - "foo_i"
             | type         - "void"
-            | sym:symtab   - 0x40165078
             |
             +++ cdecl ----------------------------------------
-            | sym:name     - "foo_d"
-            | name         - "foo"
             | decl         - "f(double)."
+            | name         - "foo"
             | parms        - double
+            | sym:name     - "foo_d"
             | type         - "void"
-            | sym:symtab   - 0x40165078
             |
             +++ cdecl ----------------------------------------
-            | sym:name     - "foo"
-            | name         - "foo"
             | decl         - "f(p.Bar)."
+            | name         - "foo"
             | parms        - Bar *
+            | sym:name     - "foo"
             | type         - "void"
-            | sym:symtab   - 0x40165078
 
@@ -787,19 +817,18 @@ public: The behavior of %feature is very easy to describe--it simply attaches a new attribute to any parse tree node that matches the given prototype. When a feature is added, it shows up as an attribute in the feature: namespace. -You can see this when running with the -debug-top 4 option. For example: +You can see this when running with the -debug-top 4 -debug-quiet option. For example:

  +++ cdecl ----------------------------------------
- | sym:name     - "getitem"
- | name         - "getitem"
  | decl         - "f(int).p."
- | parms        - int
- | type         - "Object"
  | feature:except - "{\n    try {\n       $action\n    } catc..."
- | sym:symtab   - 0x40168ac8
+ | name         - "getitem"
+ | parms        - int
+ | sym:name     - "getitem"
+ | type         - "Object"
  |
 
@@ -3765,6 +3794,7 @@ There are various command line options which can aid debugging a SWIG interface -debug-symbols - Display target language symbols in the symbol tables -debug-csymbols - Display C symbols in the symbol tables -debug-lsymbols - Display target language layer symbols +-debug-quiet - Display less parse tree node debug info when using other -debug options -debug-tags - Display information about the tags found in the interface -debug-template - Display information for debugging templates -debug-top <n> - Display entire parse tree at stages 1-4, <n> is a csv list of stages diff --git a/Doc/Manual/SWIG.html b/Doc/Manual/SWIG.html index ea2e625ef..1d929ac71 100644 --- a/Doc/Manual/SWIG.html +++ b/Doc/Manual/SWIG.html @@ -155,6 +155,7 @@ General Options -debug-symbols - Display target language symbols in the symbol tables -debug-csymbols - Display C symbols in the symbol tables -debug-lsymbols - Display target language layer symbols + -debug-quiet - Display less parse tree node debug info when using other -debug options -debug-tags - Display information about the tags found in the interface -debug-template - Display information for debugging templates -debug-top <n> - Display entire parse tree at stages 1-4, <n> is a csv list of stages @@ -2186,18 +2187,19 @@ of the expression.

For a comprehensive understanding of how the matching works, the internal parse tree needs to be examined using the -command line option: -debug-module 1. +command line option: -debug-module 1 -debug-quiet. A snippet of the resulting output might be:

-            +++ destructor - 0x7fc10ea05af0 ----------------------------------------
-            | name         - "~Shape"
-            | ismember     - "1"
-            | sym:name     - "~Shape"
+            +++ destructor ----------------------------------------
             | access       - "public"
+            | decl         - "f()."
+            | ismember     - "1"
+            | name         - "~Shape"
             | storage      - "virtual"
+            | sym:name     - "~Shape"
 
diff --git a/Source/Modules/javascript.cxx b/Source/Modules/javascript.cxx index 604b43743..b17c5e503 100644 --- a/Source/Modules/javascript.cxx +++ b/Source/Modules/javascript.cxx @@ -760,13 +760,10 @@ int JSEmitter::emitWrapperFunction(Node *n) { ret = emitSetter(n, is_member, is_static); } else if (is_getter) { ret = emitGetter(n, is_member, is_static); - } else { - Swig_print_node(n); } } else { Printf(stderr, "Warning: unsupported wrapper function type\n"); - Swig_print_node(n); ret = SWIG_ERROR; } } else { @@ -778,7 +775,6 @@ int JSEmitter::emitWrapperFunction(Node *n) { ret = emitDtor(n); } else { Printf(stderr, "Warning: unsupported wrapper function type"); - Swig_print_node(n); ret = SWIG_ERROR; } } @@ -1409,7 +1405,6 @@ int JSEmitter::switchNamespace(Node *n) { String *_nspace = lang->getNSpace(); if (!Equal(nspace, _nspace)) { Printf(stdout, "##### Custom vs Language::getNSpace(): %s | %s\n", nspace, _nspace); - Swig_print_node(n); } #endif diff --git a/Source/Modules/main.cxx b/Source/Modules/main.cxx index 239deabeb..f412a3eeb 100644 --- a/Source/Modules/main.cxx +++ b/Source/Modules/main.cxx @@ -74,6 +74,7 @@ static const char *usage1 = (const char *) "\ -debug-symbols - Display target language symbols in the symbol tables\n\ -debug-csymbols - Display C symbols in the symbol tables\n\ -debug-lsymbols - Display target language layer symbols\n\ + -debug-quiet - Display less parse tree node debug info when using other -debug options\n\ -debug-tags - Display information about the tags found in the interface\n\ -debug-template - Display information for debugging templates\n\ -debug-top - Display entire parse tree at stages 1-4, is a csv list of stages\n\ @@ -778,6 +779,9 @@ static void getoptions(int argc, char *argv[]) { } else if (strncmp(argv[i], "-w", 2) == 0) { Swig_mark_arg(i); Swig_warnfilter(argv[i] + 2, 1); + } else if (strcmp(argv[i], "-debug-quiet") == 0) { + Swig_print_quiet(1); + Swig_mark_arg(i); } else if (strcmp(argv[i], "-debug-symtabs") == 0) { dump_symtabs = 1; Swig_mark_arg(i); diff --git a/Source/Modules/overload.cxx b/Source/Modules/overload.cxx index 8a4ce48f7..034e0e76f 100644 --- a/Source/Modules/overload.cxx +++ b/Source/Modules/overload.cxx @@ -339,7 +339,6 @@ List *Swig_overload_rank(Node *n, bool script_lang_wrapping) { Setattr(nodes[i].n, "overload:ignore", "1"); Append(result, nodes[i].n); // Printf(stdout,"[ %d ] %d %s\n", i, nodes[i].implicitconv_function, ParmList_errorstr(nodes[i].parms)); - // Swig_print_node(nodes[i].n); if (i == nnodes-1 || nodes[i].argc != nodes[i+1].argc) { if (argc_changed_index+2 < nnodes && (nodes[argc_changed_index+1].argc == nodes[argc_changed_index+2].argc)) { // Add additional implicitconv functions in same order as already ranked. @@ -351,7 +350,6 @@ List *Swig_overload_rank(Node *n, bool script_lang_wrapping) { SetFlag(nodes[j].n, "implicitconvtypecheckoff"); Append(result, nodes[j].n); // Printf(stdout,"[ %d ] %d + %s\n", j, nodes[j].implicitconv_function, ParmList_errorstr(nodes[j].parms)); - // Swig_print_node(nodes[j].n); } } } diff --git a/Source/Modules/r.cxx b/Source/Modules/r.cxx index 9d9204c0f..541e7e622 100644 --- a/Source/Modules/r.cxx +++ b/Source/Modules/r.cxx @@ -1542,8 +1542,6 @@ List * R::Swig_overload_rank(Node *n, if (nodes[i].error) Setattr(nodes[i].n, "overload:ignore", "1"); Append(result,nodes[i].n); - // Printf(stdout,"[ %d ] %s\n", i, ParmList_errorstr(nodes[i].parms)); - // Swig_print_node(nodes[i].n); } } return result; diff --git a/Source/Swig/swigtree.h b/Source/Swig/swigtree.h index acd0e5e90..8f70a2cde 100644 --- a/Source/Swig/swigtree.h +++ b/Source/Swig/swigtree.h @@ -51,3 +51,4 @@ extern void Swig_restore(Node *node); extern void Swig_print_tags(File *obj, Node *root); extern void Swig_print_tree(Node *obj); extern void Swig_print_node(Node *obj); +extern int Swig_print_quiet(int quiet); diff --git a/Source/Swig/tree.c b/Source/Swig/tree.c index 5b0e9e1e9..e5d3467e5 100644 --- a/Source/Swig/tree.c +++ b/Source/Swig/tree.c @@ -16,6 +16,20 @@ #include #include +static int debug_quiet = 0; + +/* ----------------------------------------------------------------------------- + * Swig_print_quiet() + * + * Set quiet mode when printing a parse tree node + * ----------------------------------------------------------------------------- */ + +int Swig_print_quiet(int quiet) { + int previous_quiet = debug_quiet; + debug_quiet = quiet; + return previous_quiet; +} + /* ----------------------------------------------------------------------------- * Swig_print_tags() * @@ -68,31 +82,40 @@ void Swig_print_node(Node *obj) { Node *cobj; print_indent(0); - Printf(stdout, "+++ %s - %p ----------------------------------------\n", nodeType(obj), obj); - ki = First(obj); - while (ki.key) { - String *k = ki.key; - if ((Cmp(k, "nodeType") == 0) || (Cmp(k, "firstChild") == 0) || (Cmp(k, "lastChild") == 0) || - (Cmp(k, "parentNode") == 0) || (Cmp(k, "nextSibling") == 0) || (Cmp(k, "previousSibling") == 0) || (*(Char(k)) == '$')) { + if (debug_quiet) + Printf(stdout, "+++ %s ----------------------------------------\n", nodeType(obj)); + else + Printf(stdout, "+++ %s - %p ----------------------------------------\n", nodeType(obj), obj); + + List *keys = Keys(obj); + SortList(keys, 0); + ki = First(keys); + while (ki.item) { + String *k = ki.item; + DOH *value = Getattr(obj, k); + if (Equal(k, "nodeType") || (*(Char(k)) == '$')) { /* Do nothing */ - } else if (Cmp(k, "kwargs") == 0 || Cmp(k, "parms") == 0 || Cmp(k, "wrap:parms") == 0 || - Cmp(k, "pattern") == 0 || Cmp(k, "templateparms") == 0 || Cmp(k, "throws") == 0) { + } else if (debug_quiet && (Equal(k, "nodeType") || Equal(k, "firstChild") || Equal(k, "lastChild") || Equal(k, "parentNode") || Equal(k, "nextSibling") || + Equal(k, "previousSibling") || Equal(k, "symtab") || Equal(k, "csymtab") || Equal(k, "sym:symtab") || Equal(k, "sym:nextSibling") || + Equal(k, "sym:previousSibling") || Equal(k, "csym:nextSibling") || Equal(k, "csym:previousSibling"))) { + /* Do nothing */ + } else if (Equal(k, "kwargs") || Equal(k, "parms") || Equal(k, "wrap:parms") || Equal(k, "pattern") || Equal(k, "templateparms") || Equal(k, "throws")) { print_indent(2); /* Differentiate parameter lists by displaying within single quotes */ - Printf(stdout, "%-12s - \'%s\'\n", k, ParmList_str_defaultargs(Getattr(obj, k))); + Printf(stdout, "%-12s - \'%s\'\n", k, ParmList_str_defaultargs(value)); } else { DOH *o; const char *trunc = ""; print_indent(2); - if (DohIsString(Getattr(obj, k))) { - o = Str(Getattr(obj, k)); + if (DohIsString(value)) { + o = Str(value); if (Len(o) > 80) { trunc = "..."; } Printf(stdout, "%-12s - \"%(escape)-0.80s%s\"\n", k, o, trunc); Delete(o); } else { - Printf(stdout, "%-12s - %p\n", k, Getattr(obj, k)); + Printf(stdout, "%-12s - %p\n", k, value); } } ki = Next(ki); @@ -107,6 +130,7 @@ void Swig_print_node(Node *obj) { print_indent(1); Printf(stdout, "\n"); } + Delete(keys); } /* -----------------------------------------------------------------------------