Skip to content

Commit 8b60325

Browse files
authored
Merge pull request #118 from egorzhdan/compiler-output
Parse compiler messages properly on Windows
2 parents 32a1836 + 40b149a commit 8b60325

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Sources/TSCUtility/JSONMessageStreamingParser.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ private extension JSONMessageStreamingParser {
101101

102102
/// Throwing implementation of the parse function.
103103
func parseImpl<C>(bytes: C) throws where C: Collection, C.Element == UInt8 {
104+
#if os(Windows)
105+
let carriageReturn = UInt8(ascii: "\r")
106+
let bytes = bytes.filter { $0 != carriageReturn }
107+
#endif
108+
104109
switch state {
105110
case .parsingMessageSize:
106111
if let newlineIndex = bytes.firstIndex(of: newline) {

0 commit comments

Comments
 (0)