Browse Source

Bugfixes for _serialize function in bitshift/parser/python.py

tags/v1.0^2
Benjamin Attal 10 years ago
parent
commit
5db273a773
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      bitshift/parser/python.py

+ 3
- 3
bitshift/parser/python.py View File

@@ -70,12 +70,12 @@ def _serialize(tree):
start_line, end_line = _start_n_end(cur_node) start_line, end_line = _start_n_end(cur_node)
accum['classes'][cur_node.name] = {'start_ln': start_line , 'end_ln': end_line} accum['classes'][cur_node.name] = {'start_ln': start_line , 'end_ln': end_line}


elif isinstance(cur_node, ast.AST):
if isinstance(cur_node, ast.AST):
for k in cur_node.__dict__.keys(): for k in cur_node.__dict__.keys():
node = node.__dict__[k]
node = cur_node.__dict__[k]
_helper(node, accum) _helper(node, accum)


accum = {}
accum = {'vars': {}, 'functions': {}, 'classes': {}}
_helper(tree, accum) _helper(tree, accum)
return accum return accum




Loading…
Cancel
Save