mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-31 01:04:20 +08:00
removed old stuff
This commit is contained in:
180
parsetest.py
180
parsetest.py
@@ -1,180 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# test comment
|
||||
|
||||
import datetime, os, sys, tokenize, re
|
||||
#from token import *
|
||||
from time import sleep
|
||||
from token import OP as OP_TEST, INDENT as INDENT_TEST
|
||||
|
||||
aaa = 6; bbb = 13
|
||||
ccc = bbb; d = open("test.py");
|
||||
a
|
||||
|
||||
def func(a,b,c=3):
|
||||
#def test:
|
||||
# return 2
|
||||
cdef = A()
|
||||
return test
|
||||
|
||||
|
||||
class Intro(object):
|
||||
def testing(self, string):
|
||||
return string+","
|
||||
|
||||
class Supi(A, datetime.datetime):
|
||||
r""" test123 """
|
||||
class 2
|
||||
|
||||
static_var = 0
|
||||
def __init__(self):
|
||||
self.b = A()
|
||||
def test(self):
|
||||
import time
|
||||
print 1
|
||||
|
||||
self.b = (1,
|
||||
2,[3,2
|
||||
]);self.a = 1
|
||||
self.c = {1:3,
|
||||
a = self.a
|
||||
4:2,5:9}
|
||||
return A()
|
||||
|
||||
class A():
|
||||
class B():
|
||||
def test(self):
|
||||
return 8 + a.test()
|
||||
class init:
|
||||
def __init__(self, a, b=3, c = A):
|
||||
a=0;self.a = a.i
|
||||
|
||||
aclass = A()
|
||||
|
||||
b = aclass.test()
|
||||
c = aclass or b
|
||||
c = aclass or c
|
||||
|
||||
class Empty():
|
||||
pass
|
||||
def blub():
|
||||
|
||||
cdef = 5
|
||||
cdef cdef
|
||||
for i in range(3):
|
||||
if 1:if 2:for a in range(3): exec a
|
||||
asdf = aaa
|
||||
print 'blub'
|
||||
else:
|
||||
a = 0
|
||||
|
||||
def ass_test(a):
|
||||
"""docstring for assignment test"""
|
||||
a -= 1
|
||||
# (comment without indent)
|
||||
(b, c, d) = (1,2,3)
|
||||
del b
|
||||
f = {}
|
||||
exec 'a = 999' in f
|
||||
# test strange statements
|
||||
[a,c] ; {1: a}; (1,); `a`
|
||||
result = int((a+b)*2)
|
||||
result = s.a(
|
||||
adsfa ) [].3.\
|
||||
a()
|
||||
global global_test
|
||||
return result
|
||||
|
||||
matrix = [[1,2,3], [4,5,6], [7,8,9]]
|
||||
@property
|
||||
def flow_test(a):
|
||||
global matrix
|
||||
for i in matrix:
|
||||
print a
|
||||
else:
|
||||
pass
|
||||
while 1:
|
||||
del a
|
||||
print a
|
||||
else:
|
||||
pass
|
||||
try:
|
||||
if True or a:
|
||||
m = 1
|
||||
for i,j in enumerate(range(3)):
|
||||
print i,j
|
||||
for a in test(t):
|
||||
p
|
||||
else:
|
||||
while 1:
|
||||
m = 2
|
||||
break
|
||||
except IndexError as e:
|
||||
raise e
|
||||
yield e
|
||||
except TypeError, e2:
|
||||
pass
|
||||
except:
|
||||
pass
|
||||
finally:
|
||||
pass
|
||||
with open('test.py') as f, open('narf.py' as g), m as cm:
|
||||
print f
|
||||
return matrix[0,m]
|
||||
|
||||
if True or a:
|
||||
print a
|
||||
# completion
|
||||
import time
|
||||
class c1():
|
||||
c2,c5 = c1(), c1().c3()
|
||||
def __init__(self, athefirst):
|
||||
self.acp = athefirst; self.bcp = 3
|
||||
def c3(self, daeparam):
|
||||
import os as c4 #from parsing import Scope as c4
|
||||
c5 = 1
|
||||
c5 = c4()
|
||||
if 1:
|
||||
print 1
|
||||
#return c5+'asdf'
|
||||
return self.acp # self.bcp +
|
||||
(c1().c2.\
|
||||
c, 1, c3()) [0].pop()
|
||||
c = u"asdf".join([1,2]); c1(1).c3(r"")
|
||||
matrix_test = [[1,2], [1,3]]
|
||||
c = c1().c3().sleep()
|
||||
asdf = c1; asdf2 = asdf b= asdf2
|
||||
with open('') as fi: pass
|
||||
c = b().c3(); abc = datetime; return [abc][0]. ;pylab.; add(1+2,2).; for fi in [1,2]: fi.
|
||||
1.0.fromhex(); import flask ; flsk = flask.Flask + flask.Request;
|
||||
abc = [1,2+3]; abc[0].
|
||||
import pylab; def add(a1,b1): nana = 1; return a1+b1
|
||||
flow_test.; a12, (b12, c12) = (1,(list, "")); b12.
|
||||
|
||||
def globalfunc():
|
||||
global globalvar, globalvar2
|
||||
globalvar = 3
|
||||
a = 3; b = ""
|
||||
b,a=a,b
|
||||
a.
|
||||
|
||||
|
||||
|
||||
class Ar():
|
||||
def __init__(self, asd):
|
||||
self.a = asd
|
||||
|
||||
def rename(self):
|
||||
self.a2 = self.a
|
||||
return self.a2
|
||||
st = str
|
||||
st = 1
|
||||
asfd = sasdf
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Ar(1).
|
||||
Ar(1).rename()
|
||||
@@ -1,51 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# python >= 2.4 working with readmodule_ex
|
||||
import parsing
|
||||
import functions
|
||||
|
||||
functions.debug.debug_function = functions.debug.print_to_stdout
|
||||
|
||||
text = open('test.py').read()
|
||||
p = parsing.PyFuzzyParser(text)
|
||||
|
||||
|
||||
print p.top.get_code()
|
||||
#print cmpl.parser.top.subscopes[1].subscopes[0].get_code()
|
||||
|
||||
def handle_names(names):
|
||||
#print names
|
||||
for n in names:
|
||||
try:
|
||||
print n.names
|
||||
except AttributeError:
|
||||
print 'star!', n.from_ns
|
||||
|
||||
"""
|
||||
print 'global names:'
|
||||
names = p.top.get_set_vars()
|
||||
handle_names(names)
|
||||
|
||||
print
|
||||
print 'func names:'
|
||||
names = p.top.subscopes[7].get_set_vars()
|
||||
handle_names(names)
|
||||
|
||||
print
|
||||
print 'class names:'
|
||||
names = p.top.subscopes[2].get_set_vars()
|
||||
handle_names(names)
|
||||
for s in p.top.subscopes[2].subscopes:
|
||||
print 'method names:'
|
||||
names = s.get_set_vars()
|
||||
handle_names(names)
|
||||
|
||||
print
|
||||
print 'start/end'
|
||||
for s in p.top.subscopes:
|
||||
print repr(s)
|
||||
"""
|
||||
|
||||
s = p.top
|
||||
import code
|
||||
sh = code.InteractiveConsole(locals=locals())
|
||||
sh.interact("InteractiveConsole")
|
||||
Reference in New Issue
Block a user