- print('module_1', list(p))
- params = p[7]
- clsname = [Leaf(token.NAME, 'class'),
- Leaf(token.NAME, p[4], prefix=' '),
- Leaf(token.COLON, ':')]
- pass_stmt = Node(syms.pass_stmt, [Leaf(token.NAME, "pass"),])
- if params:
- params = [Leaf(token.LPAR, '(')] + params + [Leaf(token.RPAR, ')')]
- fn = [Leaf(token.NAME, 'def'),
- Leaf(token.NAME, '__init__', prefix=' '),
- Node(syms.parameters, params),
- Leaf(token.COLON, ':')]
- fndef = Node(syms.funcdef, fn)
- stmts = Node(syms.stmt, [fndef])
- else:
- stmts = Node(syms.small_stmt, [pass_stmt, Leaf(token.NEWLINE, '\n')])
- stmts = Node(syms.stmt, [stmts])
- suite = Node(syms.suite, [Leaf(token.NEWLINE, '\n'),
- Leaf(token.INDENT, ' '),
- stmts,
- Leaf(token.DEDENT, '')
- ])
- clsdecl = Node(syms.classdef, clsname + [suite],
- prefix='', fixers_applied=[])
- clsdecl = Node(syms.compound_stmt, [clsdecl])
- print ("clsdecl", repr(clsdecl))
- print ("clsstr:")
- print (str(clsdecl))