DILocation

class hugr.debug_info.DILocation(column: int, line_no: int)[source]

Bases: DebugRecord

Debug information for a location, corresponds to call or extension operation node.

Methods

from_json

Decode a debug record from json.

to_json

Encodes the record as a dictionary of native types that can be serialized by json.dump.

Attributes

KIND

column

line_no

classmethod from_json(value: str | int | float | bool | None | Mapping[str, str | int | float | bool | None | Mapping[str, JsonType] | list[JsonType]] | list[str | int | float | bool | None | Mapping[str, JsonType] | list[JsonType]]) DILocation[source]

Decode a debug record from json. This is not an abstract method because when decoding from json by calling DebugRecord.from_json we do not have concrete subtype information, so we decode from the explicit variant tag stored in kind instead.

to_json() dict[str, str | int | float | bool | None | Mapping[str, str | int | float | bool | None | Mapping[str, JsonType] | list[JsonType]] | list[str | int | float | bool | None | Mapping[str, JsonType] | list[JsonType]]][source]

Encodes the record as a dictionary of native types that can be serialized by json.dump.