bpo-29706: Test that IDLE colors async/await as keywords. (GH-6846) · python/cpython@389a48e (original) (raw)
`@@ -17,8 +17,6 @@ def make_pat():
`
17
17
`builtinlist = [str(name) for name in dir(builtins)
`
18
18
`if not name.startswith('_') and \
`
19
19
`name not in keyword.kwlist]
`
20
``
`-
self.file = open("file") :
`
21
``
`-
1st 'file' colorized normal, 2nd as builtin, 3rd as string
`
22
20
`builtin = r"([^.'"\#]\b|^)" + any("BUILTIN", builtinlist) + r"\b"
`
23
21
`comment = any("COMMENT", [r"#[^\n]*"])
`
24
22
`stringprefix = r"(?i:r|u|f|fr|rf|b|br|rb)?"
`
`@@ -268,13 +266,14 @@ def _color_delegator(parent): # htest #
`
268
266
`"else: float(None)\n"
`
269
267
`"if iF + If + IF: 'keyword matching must respect case'\n"
`
270
268
`"if'': x or'' # valid string-keyword no-space combinations\n"
`
``
269
`+
"async def f(): await g()\n"
`
271
270
`"# All valid prefixes for unicode and byte strings should be colored.\n"
`
272
271
`"'x', '''x''', "x", """x"""\n"
`
273
272
`"r'x', u'x', R'x', U'x', f'x', F'x'\n"
`
274
273
`"fr'x', Fr'x', fR'x', FR'x', rf'x', rF'x', Rf'x', RF'x'\n"
`
275
274
`"b'x',B'x', br'x',Br'x',bR'x',BR'x', rb'x'.rB'x',Rb'x',RB'x'\n"
`
276
275
`"# Invalid combinations of legal characters should be half colored.\n"
`
277
``
`-
"ur'x', ru'x', uf'x', fu'x', UR'x', ufr'x', rfu'x', xf'x', fx'x'"
`
``
276
`+
"ur'x', ru'x', uf'x', fu'x', UR'x', ufr'x', rfu'x', xf'x', fx'x'\n"
`
278
277
` )
`
279
278
`text = Text(top, background="white")
`
280
279
`text.pack(expand=1, fill="both")
`