Usages on syntax should not return anything.

This commit is contained in:
Dave Halter committed 2015-04-28 17:35:26 +02:00
1 parent 126f490f1e
commit c2a287c25a
2 files changed
+12 -1

No files matched your search

+5 -1
View File
@@ -466,7 +466,11 @@ class Script(object):
# For not defined imports (goto doesn't find something, we take
# the name as a definition. This is enough, because every name
# points to it.
definitions = [user_stmt.name_for_position(self._pos)]
name = user_stmt.name_for_position(self._pos)
if name is None:
# Must be syntax
return []
definitions = [name]
if not definitions:
# Without a definition for a name we cannot find references.