Split the six files that declared multiple sibling types under one namespace extension so each file declares exactly one top-level type: the Tagged node component types (Node, NodeKind, Scalar, Sequence, Mapping, Pair), the validation report types (Report, Source, SourceReport, BatchReport), DiagnosticKind, TokenKind, ScannerFlowContext kind, and the event-stream composer helpers. Public type names are unchanged; the shared report-rendering helpers move from file-private to internal so the split report types still reach them. Make check-namespacing.sh namespace-aware: the previous column-anchored scan was blind to types declared inside indented extension blocks, so it passed while the rule was violated. It now counts direct members of a PureYAML namespace extension and ignores nested types and private helpers.
19 lines
416 B
Swift
19 lines
416 B
Swift
public extension PureYAML.Tagged {
|
|
struct Mapping: Equatable, Sendable {
|
|
public var pairs: [Pair]
|
|
public var tag: Tag?
|
|
|
|
public init(
|
|
pairs: [Pair],
|
|
tag: Tag? = nil,
|
|
) {
|
|
self.pairs = pairs
|
|
self.tag = tag
|
|
}
|
|
|
|
public subscript(_ key: String) -> Node? {
|
|
pairs.first { $0.key == key }?.value
|
|
}
|
|
}
|
|
}
|