Skip to content

Commit 6fb9d52

Browse files
committed
remove debugging diagnostics and clean up a couple of old comments.
1 parent bb00a76 commit 6fb9d52

File tree

1 file changed

+1
-29
lines changed

1 file changed

+1
-29
lines changed

Sources/GraphQL/Language/Lexer.swift

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -748,19 +748,13 @@ func readRawString(source: Source, start: Int, line: Int, col: Int, prev: Token)
748748
*/
749749

750750
func blockStringValue(rawValue: String) -> String {
751-
752-
print("inputString: \n>>>\(rawValue)<<<\n") // debug
753-
754751
var commonIndent: Int = 0
755752
var lines = rawValue.utf8.split { (code) -> Bool in
756753
return code == 0x000A || code == 0x000D
757754
}
758755

759-
for line in lines { print(String(line)) } // debug
760-
761756
for idx in lines.indices {
762757
let line = lines[idx]
763-
// we already drop this before we get here..
764758
if idx == lines.startIndex { continue }
765759
if let indentIndex = line.firstIndex(where: { $0 != 0x0009 && $0 != 0x0020 }) {
766760
let indent = line.distance(from: line.startIndex, to: indentIndex)
@@ -769,25 +763,17 @@ func blockStringValue(rawValue: String) -> String {
769763
}
770764
}
771765
}
772-
773-
print("\ncommonIndent: \(commonIndent)\n") // debug
774766

775767
var newLines: [String.UTF8View.SubSequence] = []
776768
if commonIndent != 0 {
777769
for idx in lines.indices {
778770
let line = lines[idx]
779-
// pretty sure they are dropping thinking about """\n which we already drop
780771
if idx == lines.startIndex {
781772
newLines.append(line)
782773
continue
783774
}
784775
newLines.append(line.dropFirst(commonIndent))
785776
}
786-
787-
for line in lines { print(String(line)) } // debug
788-
print()
789-
for line in newLines { print(String(line)) } // debug
790-
791777
lines = newLines
792778
newLines.removeAll()
793779
}
@@ -800,14 +786,9 @@ func blockStringValue(rawValue: String) -> String {
800786
}
801787
newLines.append(line)
802788
}
803-
804-
for line in newLines { print(String(line)) } // debug
805-
806789
lines = newLines
790+
807791
newLines.removeAll()
808-
print()
809-
for line in lines { print(String(line)) } // debug
810-
811792
for idx in lines.indices.reversed() {
812793
let line = lines[idx]
813794
if newLines.count == 0,
@@ -816,16 +797,9 @@ func blockStringValue(rawValue: String) -> String {
816797
}
817798
newLines.insert(line, at: newLines.startIndex)
818799
}
819-
820-
for line in newLines { print(String(line)) } // debug
821-
822800
lines = newLines
823-
newLines.removeAll()
824-
print()
825-
for line in lines { print(String(line)) } // debug
826801

827802
var result: Substring = Substring()
828-
829803
for idx in lines.indices {
830804
if idx == lines.startIndex {
831805
result.append(contentsOf: Substring(lines[idx]))
@@ -835,8 +809,6 @@ func blockStringValue(rawValue: String) -> String {
835809
}
836810
}
837811

838-
print( "\n>>>\(result)<<<\n" ) // debug
839-
840812
return String(result)
841813
}
842814

0 commit comments

Comments
 (0)