blob: 65ba45dbdc33f4e7ec32d8fc3b0334f72222667e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
# Here's some random Python so that test_tokenize_myself will have some
# stressful stuff to try. This file is .tok instead of .py so pylint won't
# complain about it, check_eol won't look at it, etc.
# Some lines are here to reproduce fixed bugs in ast_dump also.
first_back = """\
hey there!
"""
other_back = """
hey \
there
"""
lots_of_back = """\
hey \
there
"""
# This next line is supposed to have trailing whitespace:
fake_back = """\
ouch
"""
# Lots of difficulty happens with code like:
#
# fake_back = """\
# ouch
# """
#
# Ugh, the edge cases...
# What about a comment like this\
"what's this string doing here?"
class C(object):
def there():
this = 5 + \
7
that = \
"a continued line"
cont1 = "one line of text" + \
"another line of text"
a_long_string = \
"part 1" \
"2" \
"3 is longer"
def hello():
global x # ast_dump bug
print("Hello world!")
hello()
# ast dump bugs:
weird = {
**d,
**{'c': 7},
'd': 8,
}
self.hash.update(b'.')
|