1
0
forked from VimPlug/jedi

added recursion decorator / fast_parent_copy fix

This commit is contained in:
David Halter
2012-08-29 22:53:51 +02:00
parent 21db1c26c6
commit 73f341866c
8 changed files with 125 additions and 49 deletions

View File

@@ -1,3 +1,27 @@
# -----------------
# if/else/elif
# -----------------
if 1:
1
elif(3):
a = 3
else:
a = ''
#? int() str()
a
def func():
if 1:
1
elif(3):
a = 3
else:
a = ''
#? int() str()
return a
#? int() str()
func()
# -----------------
# for loops
# -----------------

View File

@@ -31,12 +31,19 @@ el = list(evaluate.get_names_for_scope(1))[0][1]
#? list()
el = list(evaluate.get_names_for_scope())[0][1]
# TODO here should stand evaluate.Instance() and so on.
# need to understand list comprehensions
##?
el = list(evaluate.get_names_for_scope())[0][1][0]
#? list()
parsing.Scope((0,0)).get_set_vars()
#?
#? parsing.Import() parsing.Name()
parsing.Scope((0,0)).get_set_vars()[0]
# TODO access parent is not possible, because that is not set in the class
## parsing.Class()
parsing.Scope((0,0)).get_set_vars()[0].parent
#? parsing.Import() parsing.Name()
el = list(evaluate.get_names_for_scope())[0][1][0]
#? evaluate.Array() evaluate.Class() evaluate.Function() evaluate.Instance()
list(evaluate.follow_call())[0]
#? evaluate.Array() evaluate.Class() evaluate.Function() evaluate.Instance()
evaluate.get_scopes_for_name()[0]

View File

@@ -27,8 +27,8 @@ def run_completion_test(correct, source, line_nr, line, path):
#profile.run('functions.complete("""%s""", %i, %i, "%s")'
# % (source, line_nr, len(line), path))
except Exception:
print('test @%s: %s' % (line_nr - 1, line))
print(traceback.format_exc())
print('test @%s: %s' % (line_nr - 1, line))
return 1
else:
# TODO remove set! duplicates should not be normal
@@ -63,8 +63,8 @@ def run_definition_test(correct, source, line_nr, line, correct_start, path):
try:
should_be |= defs(line_nr - 1, start + correct_start)
except Exception:
print('could not resolve %s indent %s' % (line_nr - 1, start))
print(traceback.format_exc())
print('could not resolve %s indent %s' % (line_nr - 1, start))
return 1
# because the objects have different ids, `repr` it, then compare it.
should_str = sorted(str(r) for r in should_be)
@@ -102,8 +102,8 @@ def run_goto_test(correct, source, line_nr, line, path):
try:
result = functions.goto(source, line_nr, index, path)
except Exception:
print('test @%s: %s' % (line_nr - 1, line))
print(traceback.format_exc())
print('test @%s: %s' % (line_nr - 1, line))
return 1
else:
comp_str = str(sorted(r.description for r in result))