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 {
30
30
}
31
31
32
32
func isAtStartOfLine( _ payload: AssertionPayload ) -> Bool {
33
+ // TODO: needs benchmark coverage
33
34
if currentPosition == subjectBounds. lowerBound { return true }
34
35
switch payload. semanticLevel {
35
36
case . graphemeCluster:
@@ -40,6 +41,7 @@ extension Processor {
40
41
}
41
42
42
43
func isAtEndOfLine( _ payload: AssertionPayload ) -> Bool {
44
+ // TODO: needs benchmark coverage
43
45
if currentPosition == subjectBounds. upperBound { return true }
44
46
switch payload. semanticLevel {
45
47
case . graphemeCluster:
@@ -50,6 +52,8 @@ extension Processor {
50
52
}
51
53
52
54
mutating func builtinAssert( by payload: AssertionPayload ) throws -> Bool {
55
+ // TODO: needs benchmark coverage
56
+
53
57
// Future work: Optimize layout and dispatch
54
58
switch payload. kind {
55
59
case . startOfSubject: return currentPosition == subjectBounds. lowerBound
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ extension Processor {
20
20
isStrictASCII: payload. builtinIsStrict,
21
21
isScalarSemantics: false )
22
22
case . any:
23
+ // TODO: call out to existing code with quick check
23
24
let matched = currentPosition != input. endIndex
24
25
&& ( !input[ currentPosition] . isNewline || payload. anyMatchesNewline)
25
26
next = matched ? input. index ( after: currentPosition) : nil
Original file line number Diff line number Diff line change @@ -686,22 +686,8 @@ extension Processor {
686
686
controller. step ( )
687
687
}
688
688
}
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
- }
700
689
}
701
690
702
- @inline ( never)
703
- func blackHole< T> ( _ t: T ) { _ = t }
704
-
705
691
extension String {
706
692
707
693
func match(
@@ -740,10 +726,6 @@ extension String {
740
726
return cur
741
727
}
742
728
743
- // func consumeScalar(_ n: Distance) -> Bool {
744
-
745
- // }
746
-
747
729
func matchScalar(
748
730
_ scalar: Unicode . Scalar ,
749
731
at pos: Index ,
You can’t perform that action at this time.
0 commit comments