adding ability to Node.show to display each node's name (in its parent). Based on code contributed by Tomer Segal in Issue #51
diff --git a/z_test.py b/z_test.py
index 7abb671..cc12675 100644
--- a/z_test.py
+++ b/z_test.py
@@ -97,12 +97,20 @@
#--------------- Parsing
source_code = r'''#line 1 "..\..\test.h"
#line 2 "..\-\~\^\_\!\=\&test.h"
- int a;
+ int a;
+
+ int main(int joe, float mmm) {
+ k = 2;
+ c = 8;
+ }
'''
parser = CParser(lex_optimize=False, yacc_optimize=False, yacc_debug=True)
ast = parser.parse(source_code, filename='zz')
- ast.show(showcoord=False)
+ ast.show(showcoord=False, attrnames=True, nodenames=True)
#~ nv=NodeVisitor()
#~ nv.visit(ast)
+ print (
+ '' +
+ 'sdf')