DSMSourceField

class dsviper.DSMSourceField

Bases: object

A struct field and its source spans (name, type, whole declaration, doc).

Note: Not directly instantiable.

declaration_span() DSMSourceSpan | None

Return the DSMSourceSpan of the whole field declaration, or None.

default_span() DSMSourceSpan | None

Return the DSMSourceSpan of the field’s default clause — the ‘=’ through the literal — or None when the field declares no default.

documentation_span() DSMSourceSpan | None

Return the DSMSourceSpan of the field docstring, or None.

name() str

Return the field name.

name_span() DSMSourceSpan | None

Return the DSMSourceSpan of the field name, or None.

structure() TypeName

Return the TypeName of the enclosing structure.

type_span() DSMSourceSpan | None

Return the DSMSourceSpan of the field type expression, or None.