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

PrecedenceGroup

Mattt edited this page Aug 2, 2020 · 5 revisions

PrecedenceGroup

An operator precedence group declaration.

public struct PrecedenceGroup:​ Declaration, Hashable, Codable

Inheritance

Codable, Declaration, ExpressibleBySyntax, Hashable

Initializers

init(_:​)

Creates an instance initialized with the given syntax node.

public init(_ node:​ PrecedenceGroupDeclSyntax)

Properties

attributes

The declaration attributes.

let attributes:[Attribute]

modifiers

The declaration modifiers.

let modifiers:[Modifier]

keyword

The declaration keyword ("precedencegroup")

let keyword:​ String

name

The precedence group name.

let name:​ String

assignment

Whether operators in the precedence group are folded into optional chains.

let assignment:​ Bool?

For example, if assignment is true, the expression entry?.count += 1 has the effect of entry?(.count += 1); otherwise, the same expression is interpreted as (entry?.count) += 1 and fails to type-check.

associativity

The associativity of operators in the precedence group.

let associativity:​ Associativity?

relations

The relation of operators to operators in other precedence groups.

let relations:[Relation]
Clone this wiki locally