File tree Expand file tree Collapse file tree 3 files changed +5
-18
lines changed
Sources/_StringProcessing/Engine Expand file tree Collapse file tree 3 files changed +5
-18
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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-
705691extension 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 ,
You can’t perform that action at this time.
0 commit comments