Skip to content
This repository was archived by the owner on Oct 17, 2021. It is now read-only.

Enumeration_Case

mattt edited this page Mar 28, 2020 · 6 revisions

Enumeration.Case

An enumeration case.

public struct Case: Declaration, Hashable, Codable

Inheritance

Codable, Hashable, Declaration

Initializers

init?(_:)

Creates an instance initialized with the given syntax node.

public init?(_ node: EnumCaseElementSyntax)

init(_:)

Creates an instance initialized with the given syntax node.

public init(_ node: EnumDeclSyntax)

Properties

description

var description: String

description

var description: String

rawValue

The raw value of the enumeration case, if any.

let rawValue: String?

associatedValue

The associated values of the enumeration case, if any.

let associatedValue: [Function.Parameter]?

name

The enumeration case name.

let name: String

modifiers

The declaration modifiers.

let modifiers: [Modifier]

keyword

The declaration keyword ("case").

let keyword: String

attributes

The declaration attributes.

let attributes: [Attribute]

Methods

cases(from:)

Creates and returns enumeration cases from an enumeration case declaration.

public static func cases(from node: EnumCaseDeclSyntax) -> [Enumeration.Case]