ReferencePrinter

class ReferencePrinter

An opaque reference print function that will be called only for synthetic references.

Members defined in ReferencePrinter (1 member)

__init__

Construct a default reference printer

Methods

__init__() None

Construct a default reference printer

__init__(preference: syside.NamePreference) None

Construct a reference printer that will select identifiers for printing using the given preference.

__init__(callback: Callable[[syside.Element, syside.Element], Sequence[str] | syside.NamePreference]) None

Construct a reference printer with a custom path callback. The signature is (target: Element, referent: Element) -> Sequence[str] | NamePreference, where:

  • target is the element that is referenced. Callback should return the path to it.

  • referent is the referent element, e.g. Membership.

Callback may also choose to return a name preference which will be used to print the reference instead.

Used in