@@ -118,12 +118,13 @@ fileprivate extension Compiler.ByteCodeGen {
118118 // need to supply both a slice bounds and a per-search bounds.
119119 switch kind {
120120 case . startOfSubject:
121- builder. buildAssert { ( input, pos, subjectBounds) in
121+ builder. buildAssert { ( _ , _ , input, pos, subjectBounds) in
122122 pos == subjectBounds. lowerBound
123123 }
124124
125125 case . endOfSubjectBeforeNewline:
126- builder. buildAssert { [ semanticLevel = options. semanticLevel] ( input, pos, subjectBounds) in
126+ builder. buildAssert { [ semanticLevel = options. semanticLevel]
127+ ( _, _, input, pos, subjectBounds) in
127128 if pos == subjectBounds. upperBound { return true }
128129 switch semanticLevel {
129130 case . graphemeCluster:
@@ -136,7 +137,7 @@ fileprivate extension Compiler.ByteCodeGen {
136137 }
137138
138139 case . endOfSubject:
139- builder. buildAssert { ( input, pos, subjectBounds) in
140+ builder. buildAssert { ( _ , _ , input, pos, subjectBounds) in
140141 pos == subjectBounds. upperBound
141142 }
142143
@@ -149,16 +150,16 @@ fileprivate extension Compiler.ByteCodeGen {
149150
150151 // FIXME: This needs to be based on `searchBounds`,
151152 // not the `subjectBounds` given as an argument here
152- builder. buildAssert { ( input, pos, subjectBounds) in false }
153+ builder. buildAssert { ( _ , _ , input, pos, subjectBounds) in false }
153154
154155 case . textSegment:
155- builder. buildAssert { ( input, pos, _) in
156+ builder. buildAssert { ( _ , _ , input, pos, _) in
156157 // FIXME: Grapheme or word based on options
157158 input. isOnGraphemeClusterBoundary ( pos)
158159 }
159160
160161 case . notTextSegment:
161- builder. buildAssert { ( input, pos, _) in
162+ builder. buildAssert { ( _ , _ , input, pos, _) in
162163 // FIXME: Grapheme or word based on options
163164 !input. isOnGraphemeClusterBoundary ( pos)
164165 }
@@ -169,7 +170,8 @@ fileprivate extension Compiler.ByteCodeGen {
169170 // the DSL-based `.startOfLine` anchor should always match the start
170171 // of a line. Right now we don't distinguish between those anchors.
171172 if options. anchorsMatchNewlines {
172- builder. buildAssert { [ semanticLevel = options. semanticLevel] ( input, pos, subjectBounds) in
173+ builder. buildAssert { [ semanticLevel = options. semanticLevel]
174+ ( _, _, input, pos, subjectBounds) in
173175 if pos == subjectBounds. lowerBound { return true }
174176 switch semanticLevel {
175177 case . graphemeCluster:
@@ -179,7 +181,7 @@ fileprivate extension Compiler.ByteCodeGen {
179181 }
180182 }
181183 } else {
182- builder. buildAssert { ( input, pos, subjectBounds) in
184+ builder. buildAssert { ( _ , _ , input, pos, subjectBounds) in
183185 pos == subjectBounds. lowerBound
184186 }
185187 }
@@ -190,7 +192,8 @@ fileprivate extension Compiler.ByteCodeGen {
190192 // the DSL-based `.endOfLine` anchor should always match the end
191193 // of a line. Right now we don't distinguish between those anchors.
192194 if options. anchorsMatchNewlines {
193- builder. buildAssert { [ semanticLevel = options. semanticLevel] ( input, pos, subjectBounds) in
195+ builder. buildAssert { [ semanticLevel = options. semanticLevel]
196+ ( _, _, input, pos, subjectBounds) in
194197 if pos == subjectBounds. upperBound { return true }
195198 switch semanticLevel {
196199 case . graphemeCluster:
@@ -200,13 +203,14 @@ fileprivate extension Compiler.ByteCodeGen {
200203 }
201204 }
202205 } else {
203- builder. buildAssert { ( input, pos, subjectBounds) in
206+ builder. buildAssert { ( _ , _ , input, pos, subjectBounds) in
204207 pos == subjectBounds. upperBound
205208 }
206209 }
207210
208211 case . wordBoundary:
209- builder. buildAssert { [ options] ( input, pos, subjectBounds) in
212+ builder. buildAssert { [ options]
213+ ( cache, maxIndex, input, pos, subjectBounds) in
210214 if options. usesSimpleUnicodeBoundaries {
211215 // TODO: How should we handle bounds?
212216 return _CharacterClassModel. word. isBoundary (
@@ -216,12 +220,13 @@ fileprivate extension Compiler.ByteCodeGen {
216220 with: options
217221 )
218222 } else {
219- return input. isOnWordBoundary ( at: pos)
223+ return input. isOnWordBoundary ( at: pos, using : & cache , & maxIndex )
220224 }
221225 }
222226
223227 case . notWordBoundary:
224- builder. buildAssert { [ options] ( input, pos, subjectBounds) in
228+ builder. buildAssert { [ options]
229+ ( cache, maxIndex, input, pos, subjectBounds) in
225230 if options. usesSimpleUnicodeBoundaries {
226231 // TODO: How should we handle bounds?
227232 return !_CharacterClassModel. word. isBoundary (
@@ -231,7 +236,7 @@ fileprivate extension Compiler.ByteCodeGen {
231236 with: options
232237 )
233238 } else {
234- return !input. isOnWordBoundary ( at: pos)
239+ return !input. isOnWordBoundary ( at: pos, using : & cache , & maxIndex )
235240 }
236241 }
237242 }
0 commit comments