• Home
  • Raw
  • Download

Lines Matching refs:escape

294 def _class_escape(source, escape):  argument
296 code = ESCAPES.get(escape)
299 code = CATEGORIES.get(escape)
303 c = escape[1:2]
306 escape += source.getwhile(2, HEXDIGITS)
307 if len(escape) != 4:
308 raise source.error("incomplete escape %s" % escape, len(escape))
309 return LITERAL, int(escape[2:], 16)
312 escape += source.getwhile(4, HEXDIGITS)
313 if len(escape) != 6:
314 raise source.error("incomplete escape %s" % escape, len(escape))
315 return LITERAL, int(escape[2:], 16)
318 escape += source.getwhile(8, HEXDIGITS)
319 if len(escape) != 10:
320 raise source.error("incomplete escape %s" % escape, len(escape))
321 c = int(escape[2:], 16)
326 escape += source.getwhile(2, OCTDIGITS)
327 c = int(escape[1:], 8)
330 'range 0-0o377' % escape, len(escape))
334 if len(escape) == 2:
336 raise source.error('bad escape %s' % escape, len(escape))
337 return LITERAL, ord(escape[1])
340 raise source.error("bad escape %s" % escape, len(escape))
342 def _escape(source, escape, state): argument
344 code = CATEGORIES.get(escape)
347 code = ESCAPES.get(escape)
351 c = escape[1:2]
354 escape += source.getwhile(2, HEXDIGITS)
355 if len(escape) != 4:
356 raise source.error("incomplete escape %s" % escape, len(escape))
357 return LITERAL, int(escape[2:], 16)
360 escape += source.getwhile(4, HEXDIGITS)
361 if len(escape) != 6:
362 raise source.error("incomplete escape %s" % escape, len(escape))
363 return LITERAL, int(escape[2:], 16)
366 escape += source.getwhile(8, HEXDIGITS)
367 if len(escape) != 10:
368 raise source.error("incomplete escape %s" % escape, len(escape))
369 c = int(escape[2:], 16)
374 escape += source.getwhile(2, OCTDIGITS)
375 return LITERAL, int(escape[1:], 8)
379 escape += source.get()
380 if (escape[1] in OCTDIGITS and escape[2] in OCTDIGITS and
383 escape += source.get()
384 c = int(escape[1:], 8)
387 'range 0-0o377' % escape,
388 len(escape))
391 group = int(escape[1:])
395 len(escape))
398 raise source.error("invalid group reference %d" % group, len(escape) - 1)
399 if len(escape) == 2:
401 raise source.error("bad escape %s" % escape, len(escape))
402 return LITERAL, ord(escape[1])
405 raise source.error("bad escape %s" % escape, len(escape))