Removed the line_offset from tokenize, we have better ways to modify positions, now.

This commit is contained in:
Dave Halter
2015-02-05 14:00:58 +01:00
parent 59cf1bce5d
commit c689573b0b
3 changed files with 9 additions and 10 deletions

View File

@@ -288,7 +288,7 @@ class Script(object):
@memoize_default()
def _get_under_cursor_stmt(self, cursor_txt):
tokenizer = source_tokens(cursor_txt, line_offset=self._pos[0] - 1)
tokenizer = source_tokens(cursor_txt)
r = Parser(self._grammar, cursor_txt, tokenizer=tokenizer)
try:
# Take the last statement available.
@@ -304,7 +304,7 @@ class Script(object):
else:
pos = user_stmt.start_pos
stmt.move(0, pos[1])
stmt.move(pos[0] - 1, pos[1]) # Moving the offset.
stmt.parent = self._parser.user_scope()
return stmt