From 1f8b296a9ceec720b11970320a5e446841ad73fa Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Mon, 23 Sep 2024 21:13:55 -0700 Subject: [PATCH] Use new StringDictionary name. --- Modules/Parser/Package.swift | 5 ++++- Modules/Parser/Sources/SAX/SAXHTMLParser.swift | 5 ++--- Modules/Parser/Sources/SAX/SAXParser.swift | 5 ++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Modules/Parser/Package.swift b/Modules/Parser/Package.swift index 390026a3f..d475aca85 100644 --- a/Modules/Parser/Package.swift +++ b/Modules/Parser/Package.swift @@ -46,6 +46,7 @@ let package = Package( .target( name: "HTMLParser", dependencies: [ + "FoundationExtras", "SAX" ], swiftSettings: [ @@ -63,7 +64,9 @@ let package = Package( ]), .target( name: "SAX", - dependencies: [], + dependencies: [ + "FoundationExtras" + ], swiftSettings: [ .enableExperimentalFeature("StrictConcurrency") ]), diff --git a/Modules/Parser/Sources/SAX/SAXHTMLParser.swift b/Modules/Parser/Sources/SAX/SAXHTMLParser.swift index d37701b18..7d5c2ed77 100644 --- a/Modules/Parser/Sources/SAX/SAXHTMLParser.swift +++ b/Modules/Parser/Sources/SAX/SAXHTMLParser.swift @@ -6,6 +6,7 @@ // import Foundation +import FoundationExtras import libxml2 public protocol SAXHTMLParserDelegate: AnyObject { @@ -94,9 +95,7 @@ public final class SAXHTMLParser { characters.count = 0 } - public typealias HTMLAttributesDictionary = [String: String] - - public func attributesDictionary(_ attributes: UnsafePointer?) -> HTMLAttributesDictionary? { + public func attributesDictionary(_ attributes: UnsafePointer?) -> StringDictionary? { guard let attributes else { return nil diff --git a/Modules/Parser/Sources/SAX/SAXParser.swift b/Modules/Parser/Sources/SAX/SAXParser.swift index a9e93bd9f..ace5a04a6 100644 --- a/Modules/Parser/Sources/SAX/SAXParser.swift +++ b/Modules/Parser/Sources/SAX/SAXParser.swift @@ -6,6 +6,7 @@ // import Foundation +import FoundationExtras import libxml2 public typealias XMLPointer = UnsafePointer @@ -91,9 +92,7 @@ public final class SAXParser { characters.count = 0 } - public typealias XMLAttributesDictionary = [String: String] - - public func attributesDictionary(_ attributes: UnsafePointer?, attributeCount: Int) -> XMLAttributesDictionary? { + public func attributesDictionary(_ attributes: UnsafePointer?, attributeCount: Int) -> StringDictionary? { guard attributeCount > 0, let attributes else { return nil