@@ -20,7 +20,7 @@ extension MEProgram {
2020 var enableMetrics = false
2121
2222 var elements = TypedSetVector < Input . Element , _ElementRegister > ( )
23- var sequences = TypedSetVector < [ Input . Element ] , _SequenceRegister > ( )
23+ var utf8Contents = TypedSetVector < [ UInt8 ] , _UTF8Register > ( )
2424
2525 var asciiBitsets : [ DSLTree . CustomCharacterClass . AsciiBitset ] = [ ]
2626 var consumeFunctions : [ ConsumeFunction ] = [ ]
@@ -198,6 +198,11 @@ extension MEProgram.Builder {
198198 . match, . init( element: elements. store ( e) , isCaseInsensitive: isCaseInsensitive) ) )
199199 }
200200
201+ mutating func buildMatchUTF8( _ utf8: Array < UInt8 > , boundaryCheck: Bool ) {
202+ instructions. append ( . init( . matchUTF8, . init(
203+ utf8: utf8Contents. store ( utf8) , boundaryCheck: boundaryCheck) ) )
204+ }
205+
201206 mutating func buildMatchScalar( _ s: Unicode . Scalar , boundaryCheck: Bool ) {
202207 instructions. append ( . init( . matchScalar, . init( scalar: s, caseInsensitive: false , boundaryCheck: boundaryCheck) ) )
203208 }
@@ -416,7 +421,7 @@ extension MEProgram.Builder {
416421
417422 var regInfo = MEProgram . RegisterInfo ( )
418423 regInfo. elements = elements. count
419- regInfo. sequences = sequences . count
424+ regInfo. utf8Contents = utf8Contents . count
420425 regInfo. ints = nextIntRegister. rawValue
421426 regInfo. values = nextValueRegister. rawValue
422427 regInfo. positions = nextPositionRegister. rawValue
@@ -430,7 +435,7 @@ extension MEProgram.Builder {
430435 return MEProgram (
431436 instructions: InstructionList ( instructions) ,
432437 staticElements: elements. stored,
433- staticSequences : sequences . stored,
438+ staticUTF8Contents : utf8Contents . stored,
434439 staticBitsets: asciiBitsets,
435440 staticConsumeFunctions: consumeFunctions,
436441 staticTransformFunctions: transformFunctions,
0 commit comments