@@ -20,7 +20,7 @@ extension MEProgram {
20
20
var enableMetrics = false
21
21
22
22
var elements = TypedSetVector < Input . Element , _ElementRegister > ( )
23
- var sequences = TypedSetVector < [ Input . Element ] , _SequenceRegister > ( )
23
+ var utf8Contents = TypedSetVector < [ UInt8 ] , _UTF8Register > ( )
24
24
25
25
var asciiBitsets : [ DSLTree . CustomCharacterClass . AsciiBitset ] = [ ]
26
26
var consumeFunctions : [ ConsumeFunction ] = [ ]
@@ -198,6 +198,11 @@ extension MEProgram.Builder {
198
198
. match, . init( element: elements. store ( e) , isCaseInsensitive: isCaseInsensitive) ) )
199
199
}
200
200
201
+ mutating func buildMatchUTF8( _ utf8: Array < UInt8 > , boundaryCheck: Bool ) {
202
+ instructions. append ( . init( . matchUTF8, . init(
203
+ utf8: utf8Contents. store ( utf8) , boundaryCheck: boundaryCheck) ) )
204
+ }
205
+
201
206
mutating func buildMatchScalar( _ s: Unicode . Scalar , boundaryCheck: Bool ) {
202
207
instructions. append ( . init( . matchScalar, . init( scalar: s, caseInsensitive: false , boundaryCheck: boundaryCheck) ) )
203
208
}
@@ -416,7 +421,7 @@ extension MEProgram.Builder {
416
421
417
422
var regInfo = MEProgram . RegisterInfo ( )
418
423
regInfo. elements = elements. count
419
- regInfo. sequences = sequences . count
424
+ regInfo. utf8Contents = utf8Contents . count
420
425
regInfo. ints = nextIntRegister. rawValue
421
426
regInfo. values = nextValueRegister. rawValue
422
427
regInfo. positions = nextPositionRegister. rawValue
@@ -430,7 +435,7 @@ extension MEProgram.Builder {
430
435
return MEProgram (
431
436
instructions: InstructionList ( instructions) ,
432
437
staticElements: elements. stored,
433
- staticSequences : sequences . stored,
438
+ staticUTF8Contents : utf8Contents . stored,
434
439
staticBitsets: asciiBitsets,
435
440
staticConsumeFunctions: consumeFunctions,
436
441
staticTransformFunctions: transformFunctions,
0 commit comments