default of no arguments at an execution changed to a parsing.Array

This commit is contained in:
David Halter
2012-07-05 18:22:56 +02:00
parent e88c11605b
commit 28ad77406f
5 changed files with 18 additions and 10 deletions

View File

@@ -110,7 +110,9 @@ class CachedMetaClass(type):
class Executable(object): class Executable(object):
""" An instance is also an executable - because __init__ is called """ """ An instance is also an executable - because __init__ is called """
def __init__(self, base, var_args=[]): def __init__(self, base, var_args=parsing.Array(None, None)):
#if var_args == []:
# raise NotImplementedError()
self.base = base self.base = base
# the param input array # the param input array
self.var_args = var_args self.var_args = var_args
@@ -428,13 +430,13 @@ class Execution(Executable):
""" """
Create a param with the original scope (of varargs) as parent. Create a param with the original scope (of varargs) as parent.
""" """
calls = parsing.Array(parsing.Array.NOARRAY, parent_stmt = self.var_args.parent_stmt
self.var_args.parent_stmt) calls = parsing.Array(parsing.Array.NOARRAY, parent_stmt)
calls.values = values calls.values = values
calls.keys = keys calls.keys = keys
calls.type = array_type calls.type = array_type
new_param = copy.copy(param) new_param = copy.copy(param)
new_param.parent = self.var_args.parent_stmt new_param.parent = parent_stmt
new_param._assignment_calls_calculated = True new_param._assignment_calls_calculated = True
new_param._assignment_calls = calls new_param._assignment_calls = calls
name = copy.copy(param.get_name()) name = copy.copy(param.get_name())

View File

@@ -8,7 +8,7 @@ functions.debug.ignored_modules = ['parsing', 'builtin']
functions.modules.builtin.module_find_path.insert(0, '.') functions.modules.builtin.module_find_path.insert(0, '.')
f_name = 'functions.py' f_name = 'functions.py'
f_name = 'parsetest.py' #f_name = 'parsetest.py'
#f_name = 'test/completion/classes.py' #f_name = 'test/completion/classes.py'
import os import os
path = os.path.join(os.getcwd(), f_name) path = os.path.join(os.getcwd(), f_name)
@@ -16,8 +16,8 @@ path = os.path.join(os.getcwd(), f_name)
f = open(path) f = open(path)
code = f.read() code = f.read()
for i in range(1): for i in range(1):
completions = functions.complete(code, 15, 200, path) #completions = functions.complete(code, 15, 200, path)
#completions = functions.complete(code, 163, 200, path) completions = functions.complete(code, 164, 200, path)
#completions = functions.get_definitions(code, 181, 2, path) #completions = functions.get_definitions(code, 181, 2, path)
#completions = functions.complete(code, 42, 200, path) #completions = functions.complete(code, 42, 200, path)

View File

@@ -6,7 +6,8 @@ import evaluate
import modules import modules
import debug import debug
__all__ = ['complete', 'goto', 'get_completion_parts', 'set_debug_function'] __all__ = ['complete', 'get_completion_parts', 'get_definitions',
'set_debug_function']
class NotFoundError(Exception): class NotFoundError(Exception):

View File

@@ -86,6 +86,8 @@ exe[1]
#? int() #? int()
func()[0] func()[0]
#? str()
func()[1]
#? float() #? float()
func(1.0)[0] func(1.0)[0]
#? str() #? str()

View File

@@ -1,5 +1,5 @@
from jedi import functions from jedi import functions, evaluate
el = functions.complete()[0] el = functions.complete()[0]
#? ['description'] #? ['description']
@@ -14,5 +14,8 @@ scopes, path, dot, like = \
source_path, True) source_path, True)
# has problems with that (sometimes) very deep nesting. # has problems with that (sometimes) very deep nesting.
#? str() #? set()
el = scopes. el = scopes.
##? str() <--- recursion
el = evaluate.get_names_for_scope()[0].