pyarx.diagnostics

pyarx.diagnostics

Source: packages/pyarx/src/pyarx/diagnostics.py

title: Structured diagnostic records for the PyArx public API.
summary: >-
  Define the stable, frozen Diagnostic record and the DiagnosticSeverity enum
  that PyArx exposes to callers, plus the duck-typed helpers that translate
  upstream irx structured diagnostics and arx parser exceptions into it. The
  Diagnostic type strips the astx.AST node reference that irx records carry, so
  external callers never see raw compiler internals. These modules never import
  arx or irx at module load time, so importing pyarx.diagnostics stays free of
  the LLVM toolchain.

Classes

DiagnosticSeverity(Enum)

title: Severity level of a diagnostic.

Diagnostic

title: One structured diagnostic exposed by the PyArx API.
attributes:
  severity:
    type: DiagnosticSeverity
    description: The severity level of the diagnostic.
  message:
    type: str
    description: The human-readable diagnostic message.
  filename:
    type: str
    description: Source attribution, or "<string>" / "<unknown>".
  line:
    type: int | None
    description: One-based source line, when known.
  column:
    type: int | None
    description: One-based source column, when known.
  code:
    type: str | None
    description: Stable diagnostic code, e.g. "S001", when known.