Skip to content

Commit

Permalink
Document the Introduced struct
Browse files Browse the repository at this point in the history
Co-authored-by: Dimi Racordon <[email protected]>
  • Loading branch information
koliyo and kyouko-taiga authored Oct 2, 2023
1 parent 7567482 commit 58b8279
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Sources/Core/AST/Introduced.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
/// A node and the site of its introducer in program sources.
public struct Introduced<T: NodeIDProtocol>: Codable {

/// The site of `value`'s introducer.
public let introducerSite: SourceRange

/// A node introduced in program sources at `introducerSite`.
public let value: T

public init(introducerSite: SourceRange, value: T) {
/// Creates an instance bundling `n` with the site from which its introducer was parsed.
public init(_ n: T, at introducerSite: SourceRange) {
self.introducerSite = introducerSite
self.value = value
self.value = n
}

}

0 comments on commit 58b8279

Please sign in to comment.