common, compiler: Upgrade to SystemPackage
Continuous Integration / Grammar Tests (push) Successful in 35s
Continuous Integration / Library Format Tests (push) Successful in 1m16s
Continuous Integration / Library Tests (push) Successful in 4m11s

For cross-platform support.

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
Will Hawkins
2026-05-07 23:43:27 -04:00
parent 355e62d61d
commit d28ccd79e4
4 changed files with 21 additions and 10 deletions
+3 -7
View File
@@ -16,7 +16,7 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import Foundation
import System
import SystemPackage
/// Represent a location in a post-preprocessed piece of P4 source code.
public struct SourceLocation: Equatable, CustomStringConvertible {
@@ -145,9 +145,7 @@ func do_preprocess(
}
// Try to make a url from the configured file.
guard let included_url = URL.init(filePath: included_path) else {
return .Error(Error(withMessage: "Could not convert \(included_path) into a URL"))
}
let included_url = URL.init(filePath: included_path.string)
// By calling ourselves recursively, the include being processed will
// be _completely_ expanded (including any nested includes).
@@ -203,9 +201,7 @@ public struct SourceCodePreprocessor {
return .Error(Error(withMessage: "Could not open \(file) for preprocessing"))
}
guard let url = URL.init(filePath: file_to_open) else {
return .Error(Error(withMessage: "Could not convert \(file_to_open) into a URL"))
}
let url = URL.init(filePath: file_to_open.string)
switch do_preprocess(url, self.manager) {
case .Ok((let location, let contents)):