common, compiler: Upgrade to SystemPackage
For cross-platform support. Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
@@ -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)):
|
||||
|
||||
Reference in New Issue
Block a user