equal
deleted
inserted
replaced
310 raise |
310 raise |
311 yield (b'end', None, pos) |
311 yield (b'end', None, pos) |
312 |
312 |
313 |
313 |
314 def _addparseerrorhint(inst, tmpl): |
314 def _addparseerrorhint(inst, tmpl): |
315 if len(inst.args) <= 1: |
315 if inst.location is None: |
316 return # no location |
316 return |
317 loc = inst.args[1] |
317 loc = inst.location |
318 # Offset the caret location by the number of newlines before the |
318 # Offset the caret location by the number of newlines before the |
319 # location of the error, since we will replace one-char newlines |
319 # location of the error, since we will replace one-char newlines |
320 # with the two-char literal r'\n'. |
320 # with the two-char literal r'\n'. |
321 offset = tmpl[:loc].count(b'\n') |
321 offset = tmpl[:loc].count(b'\n') |
322 tmpl = tmpl.replace(b'\n', br'\n') |
322 tmpl = tmpl.replace(b'\n', br'\n') |