1
0
forked from VimPlug/jedi

first version of statement parser

This commit is contained in:
David Halter
2012-02-26 04:27:00 +01:00
parent 166004565a
commit e83079d563
3 changed files with 100 additions and 39 deletions

View File

@@ -41,7 +41,7 @@ class Completer(object):
sc = self.parser.parse(text)
self.sc = sc # TODO rm
src = sc.get_code()
dbg("source: %s" % src)
#dbg("source: %s" % src)
#try: exec(src) in self.compldict
#except: dbg("parser: %s, %s" % (sys.exc_info()[0], sys.exc_info()[1]))
#for l in sc.locals:
@@ -197,14 +197,14 @@ def showdbg():
text = cStringIO.StringIO(open('test.py').read())
cmpl = Completer()
cmpl.evalsource(text, 51)
print cmpl.sc.get_code()
all = cmpl.get_completions("cdef.", '')
#print cmpl.sc.get_code()
#all = cmpl.get_completions("cdef.", '')
print "Completions:", len(all)
for c in all:
print c['word'],
print ',',
print ''
#print "Completions:", len(all)
#for c in all:
# print c['word'],
# print ',',
#print ''
showdbg()
print cmpl.parser.top.get_code()