(self)
| 353 | return self.parse_import() |
| 354 | |
| 355 | def parse_import(self) -> Result: |
| 356 | if self.code.rstrip().endswith('import') and self.code.endswith(' '): |
| 357 | return Result(name='') |
| 358 | if self.tokens.peek_string(','): |
| 359 | name = '' |
| 360 | else: |
| 361 | if self.code.endswith(' '): |
| 362 | raise ParseError('parse_import') |
| 363 | name = self.parse_dotted_name() |
| 364 | if name.startswith('.'): |
| 365 | raise ParseError('parse_import') |
| 366 | while self.tokens.peek_string(','): |
| 367 | self.tokens.pop() |
| 368 | self.parse_dotted_as_name() |
| 369 | if self.tokens.peek_string('import'): |
| 370 | return Result(name=name) |
| 371 | raise ParseError('parse_import') |
| 372 | |
| 373 | def parse_from_import(self) -> Result: |
| 374 | stripped = self.code.rstrip() |
no test coverage detected