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

Variable

Mattt edited this page Aug 2, 2020 · 9 revisions

Variable

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

public struct Variable:​ Declaration, Hashable, Codable

Inheritance

Codable, CustomStringConvertible, Declaration, ExpressibleBySyntax, Hashable

Initializers

init?(_:​)

Creates an instance initialized with the given syntax node.

public init?(_ node:​ PatternBindingSyntax)

Properties

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:​)

Creates and returns variables from a variable declaration, which may contain one or more pattern bindings, such as let x:​ Int = 1, y:​ Int = 2.

public static func variables(from node:​ VariableDeclSyntax) -> [Variable]
Clone this wiki locally