NP_PINOUT = 'PINOUT'
NP_PREF = 'PREF'
-def indent(s, i=4):
- st = ''
- for x in s:
- st += str(x)
- res = []
- for p in st.split('\n'):
- res.append(' ' * i + "#"+p)
- return '\n'.join(res)
+indent = ' '
class DataType:
stmts = Node(syms.small_stmt, [pass_stmt, Leaf(token.NEWLINE, '\n')])
stmts = Node(syms.stmt, [stmts])
- # XXX TODO ports as py nodes
ports = p[8]
- stmts.children.append(Leaf(token.STRING, '\n' + indent(ports, 8)))
+ for port in ports:
+ stmts.children.append(Leaf(token.INDENT, indent*2))
+ stmts.children.append(Leaf(token.STRING, port))
+
suite = Node(syms.suite, [Leaf(token.NEWLINE, '\n'),
Leaf(token.INDENT, ' '),
stmts,