Browse Source

Fix bug in parser for Python classes.

tags/v1.0^2
Ben Kurtovic 10 years ago
parent
commit
05811c7c1b
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      bitshift/parser/python.py

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

@@ -134,7 +134,9 @@ class _CachedWalker(ast.NodeVisitor):
start_line, start_col, end_line, end_col = self.block_position(node) start_line, start_col, end_line, end_col = self.block_position(node)


pos = (start_line, start_col, end_line, end_col) pos = (start_line, start_col, end_line, end_col)
self.accum['classes'][node.name] = pos
if node.name not in self.accum['classes']:
self.accum['classes'][node.name] = {'assignments': [], 'uses': []}
self.accum['classes'][node.name]['assignments'].append(pos)


self.generic_visit(node) self.generic_visit(node)




Loading…
Cancel
Save