From 2aa4a1cf8c4cb62f7cd81f39520753d318b17807 Mon Sep 17 00:00:00 2001 From: David Halter Date: Tue, 15 May 2012 10:36:45 +0200 Subject: [PATCH] another problem with the ouput of vim (parent returned NotImplemented) --- evaluate.py | 7 +++++-- parsetest.py | 9 ++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/evaluate.py b/evaluate.py index d5bc1407..2c9fe72c 100644 --- a/evaluate.py +++ b/evaluate.py @@ -544,7 +544,10 @@ class Array(object): return follow_call_list(scope, values) def get_defined_names(self): - """ This method generates all ArrayElements for one parsing.Array. """ + """ + This method generates all ArrayElements for one parsing.Array. + It returns e.g. for a list: append, pop, ... + """ # array.type is a string with the type, e.g. 'list' scope = get_scopes_for_name(builtin.Builtin.scope, self._array.type)[0] names = scope.get_defined_names() @@ -564,7 +567,7 @@ class ArrayElement(object): @property def parent(self): - raise NotImplementedError("This shouldn't happen") + return self.name.parent @property def names(self): diff --git a/parsetest.py b/parsetest.py index d71248e6..41817808 100644 --- a/parsetest.py +++ b/parsetest.py @@ -2,7 +2,7 @@ # test comment -import datetime, os, sys, tokenize +import datetime, os, sys, tokenize, re #from token import * from time import sleep from token import OP as OP_TEST, INDENT as INDENT_TEST @@ -172,10 +172,9 @@ def nexti(iterator, default=list): #return default -#from temp import * - - #exe[0]. #exe[4]['d'] a = next(gen_exe) -a +def ret(): + r = [] + return r.