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

Variable

mattt edited this page Jan 26, 2020 · 9 revisions

Variable

A declaration for a property or a top-level variable or constant.

public struct Variable: Declaration, Hashable, Codable

Inheritance

Declaration, Hashable, Codable, ExpressibleBySyntax, CustomStringConvertible

Nested Types

Initializers

init(_:)

Creates an instance initialized with the given syntax node.

@available(swift, introduced: 0.0.1, deprecated: 0.0.1, message: "Use Variable.variables(from:) instead") public init(_ node: VariableDeclSyntax)

Properties

context

let context: String?

attributes

The declaration attributes.

let attributes: [Attribute]

modifiers

The declaration modifiers.

let modifiers: [Modifier]

keyword

The declaration keyword ("let" or "var").

let keyword: String

name

The name of the property or top-level variable or constant.

let name: String

typeAnnotation

The type annotation for the declaration, if any.

let typeAnnotation: String?

initializedValue

The initialized value for the declaration, if any.

let initializedValue: String?

accessors

The variable or property accessors.

let accessors: [Accessor]

description

var description: String

Methods

variables(from:)

public static func variables(from node: VariableDeclSyntax) -> [Variable]