Lines Matching defs:check
201 def check(self, src, lineno, offset, end_lineno=None, end_offset=None, encoding='utf-8'):
219 check = self.check
220 check('"\\\n"(1 for c in I,\\\n\\', 2, 2)
223 check = self.check
224 check('def fact(x):\n\treturn x!\n', 2, 10)
225 check('1 +\n', 1, 4)
226 check('def spam():\n print(1)\n print(2)', 3, 10)
227 check('Python = "Python" +', 1, 20)
228 check('Python = "\u1e54\xfd\u0163\u0125\xf2\xf1" +', 1, 20)
229 check(b'# -*- coding: cp1251 -*-\nPython = "\xcf\xb3\xf2\xee\xed" +',
231 check(b'Python = "\xcf\xb3\xf2\xee\xed" +', 1, 18)
232 check('x = "a', 1, 5)
233 check('lambda x: x = 2', 1, 1)
234 check('f{a + b + c}', 1, 2)
235 check('[file for str(file) in []\n]', 1, 11)
236 check('a = « hello » « world »', 1, 5)
237 check('[\nfile\nfor str(file)\nin\n[]\n]', 3, 5)
238 check('[file for\n str(file) in []]', 2, 2)
239 check("ages = {'Alice'=22, 'Bob'=23}", 1, 9)
240 check('match ...:\n case {**rest, "key": value}:\n ...', 2, 19)
241 check("[a b c d e f]", 1, 2)
242 check("for x yfff:", 1, 7)
243 check("f(a for a in b, c)", 1, 3, 1, 15)
244 check("f(a for a in b if a, c)", 1, 3, 1, 20)
245 check("f(a, b for b in c)", 1, 6, 1, 18)
246 check("f(a, b for b in c, d)", 1, 6, 1, 18)
249 check('class foo:return 1', 1, 11)
250 check('def f():\n continue', 2, 3)
251 check('def f():\n break', 2, 3)
252 check('try:\n pass\nexcept:\n pass\nexcept ValueError:\n pass', 3, 1)
253 check('try:\n pass\nexcept*:\n pass', 3, 8)
254 check('try:\n pass\nexcept*:\n pass\nexcept* ValueError:\n pass', 3, 8)
257 check('(0x+1)', 1, 3)
258 check('x = 0xI', 1, 6)
259 check('0010 + 2', 1, 1)
260 check('x = 32e-+4', 1, 8)
261 check('x = 0o9', 1, 7)
262 check('\u03b1 = 0xI', 1, 6)
263 check(b'\xce\xb1 = 0xI', 1, 6)
264 check(b'# -*- coding: iso8859-7 -*-\n\xe1 = 0xI', 2, 6,
266 check(b"""if 1:
276 check("pass\npass\npass\n(1+)\npass\npass\npass", 4, 4)
277 check("(1+)", 1, 4)
278 check("[interesting\nfoo()\n", 1, 1)
279 check(b"\xef\xbb\xbf#coding: utf8\nprint('\xe6\x88\x91')\n", 0, -1)
280 check("""f'''
284 check("""f'''
292 check('''f"""
300 check('x = [(yield i) for i in range(3)]', 1, 7)
301 check('def f():\n from _ import *', 2, 17)
302 check('def f(x, x):\n pass', 1, 10)
303 check('{i for i in range(5) if (j := 0) for j in range(5)}', 1, 38)
304 check('def f(x):\n nonlocal x', 2, 3)
305 check('def f(x):\n x = 1\n global x', 3, 3)
306 check('nonlocal x', 1, 1)
307 check('def f():\n global x\n nonlocal x', 2, 3)
310 check('from __future__ import doesnt_exist', 1, 1)
311 check('from __future__ import braces', 1, 1)
312 check('x=1\nfrom __future__ import division', 2, 1)
313 check('foo(1=2)', 1, 5)
314 check('def f():\n x, y: int', 2, 3)
315 check('[*x for x in xs]', 1, 2)
316 check('foo(x for x in range(10), 100)', 1, 5)
317 check('for 1 in []: pass', 1, 5)
318 check('(yield i) = 2', 1, 2)
319 check('def f(*):\n pass', 1, 7)
926 # We can't check it immediately, but while next() returns
1324 # equal to recursion_limit in PyErr_NormalizeException() and check