(self, stream, indent)
| 349 | return cls.CHECK.match(stream.peek(4)) is not None |
| 350 | |
| 351 | def _parse(self, stream, indent): |
| 352 | for _ in range(3): |
| 353 | next(stream) # `!p |
| 354 | if stream.peek() in "\t ": |
| 355 | next(stream) |
| 356 | |
| 357 | code = _parse_till_unescaped_char(stream, "`")[0] |
| 358 | |
| 359 | # Strip the indent if any |
| 360 | if len(indent): |
| 361 | lines = code.splitlines() |
| 362 | self.code = lines[0] + "\n" |
| 363 | self.code += "\n".join([l[len(indent) :] for l in lines[1:]]) |
| 364 | else: |
| 365 | self.code = code |
| 366 | self.indent = indent |
| 367 | |
| 368 | def __repr__(self): |
| 369 | return f"PythonCodeToken({self.start!r},{self.end!r},{self.code!r})" |
nothing calls this directly
no test coverage detected