init(name:doc:annotation:value:)

Initializes the attribute’s definition.

Declaration

init(
    name: String,
    doc: String? = nil,
    annotation: (
        () throws -> (
            any Parsable
        )?
    )? = nil,
    value: (
        () throws -> (
            any Parsable
        )?
    )? = nil
)

Parameters

  • name: The name of the attribute.

  • doc: The doc string of the attribute.

  • annotation: A closure returning the attribute’s type annotation.

  • value: A closure returning the attribute’s initial value.