arx.parser.imports

arx.parser.imports

Source: packages/arx/src/arx/parser/imports.py

title: Import parser mixin.
summary: >-
  Parse import statements and grouped import syntax while reusing the shared
  parser core helpers.

Classes

ImportParserMixin(ParserMixinBase)

title: Import parser mixin.

Methods

parse_import_stmt(self) -> astx.ImportStmt | astx.ImportFromStmt
title: Parse one import statement.
returns:
  type: astx.ImportStmt | astx.ImportFromStmt
parse_grouped_import_names(self) -> list[astx.AliasExpr]
title: Parse grouped named imports.
returns:
  type: list[astx.AliasExpr]
parse_import_alias(self) -> str
title: Parse one optional import alias.
returns:
  type: str
parse_module_path(self, prefix: str | None=None) -> str
title: Parse one dotted module path.
parameters:
  prefix:
    type: str | None
returns:
  type: str
parse_import_from_module_path(self) -> tuple[int, str]
title: Parse one absolute or relative module path for from-imports.
returns:
  type: tuple[int, str]