Skip to content

Commit 89fa6c7

Browse files
committed
cleanup
1 parent 1a4cde7 commit 89fa6c7

File tree

3 files changed

+5
-18
lines changed

3 files changed

+5
-18
lines changed

Sources/_StringProcessing/Engine/MEBuiltins.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ extension Processor {
3030
}
3131

3232
func isAtStartOfLine(_ payload: AssertionPayload) -> Bool {
33+
// TODO: needs benchmark coverage
3334
if currentPosition == subjectBounds.lowerBound { return true }
3435
switch payload.semanticLevel {
3536
case .graphemeCluster:
@@ -40,6 +41,7 @@ extension Processor {
4041
}
4142

4243
func isAtEndOfLine(_ payload: AssertionPayload) -> Bool {
44+
// TODO: needs benchmark coverage
4345
if currentPosition == subjectBounds.upperBound { return true }
4446
switch payload.semanticLevel {
4547
case .graphemeCluster:
@@ -50,6 +52,8 @@ extension Processor {
5052
}
5153

5254
mutating func builtinAssert(by payload: AssertionPayload) throws -> Bool {
55+
// TODO: needs benchmark coverage
56+
5357
// Future work: Optimize layout and dispatch
5458
switch payload.kind {
5559
case .startOfSubject: return currentPosition == subjectBounds.lowerBound

Sources/_StringProcessing/Engine/MEQuantify.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ extension Processor {
2020
isStrictASCII: payload.builtinIsStrict,
2121
isScalarSemantics: false)
2222
case .any:
23+
// TODO: call out to existing code with quick check
2324
let matched = currentPosition != input.endIndex
2425
&& (!input[currentPosition].isNewline || payload.anyMatchesNewline)
2526
next = matched ? input.index(after: currentPosition) : nil

Sources/_StringProcessing/Engine/Processor.swift

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -686,22 +686,8 @@ extension Processor {
686686
controller.step()
687687
}
688688
}
689-
690-
func sleep() {
691-
var i = 0
692-
for c in input {
693-
if i > 20 { break }
694-
i += 1
695-
if c == "C" {
696-
blackHole(c)
697-
}
698-
}
699-
}
700689
}
701690

702-
@inline(never)
703-
func blackHole<T>(_ t: T) { _ = t }
704-
705691
extension String {
706692

707693
func match(
@@ -740,10 +726,6 @@ extension String {
740726
return cur
741727
}
742728

743-
// func consumeScalar(_ n: Distance) -> Bool {
744-
745-
// }
746-
747729
func matchScalar(
748730
_ scalar: Unicode.Scalar,
749731
at pos: Index,

0 commit comments

Comments
 (0)