@@ -18,7 +18,7 @@ extension DSLTree.Node {
18
18
/// the front of an input range
19
19
func generateConsumer(
20
20
_ opts: MatchingOptions
21
- ) throws -> MEProgram < String > . ConsumeFunction ? {
21
+ ) throws -> MEProgram . ConsumeFunction ? {
22
22
switch self {
23
23
case . atom( let a) :
24
24
return try a. generateConsumer ( opts)
@@ -56,7 +56,7 @@ extension DSLTree.Atom {
56
56
// top-level nodes, but it's also invoked for `.atom` members of a custom CC
57
57
func generateConsumer(
58
58
_ opts: MatchingOptions
59
- ) throws -> MEProgram < String > . ConsumeFunction ? {
59
+ ) throws -> MEProgram . ConsumeFunction ? {
60
60
let isCaseInsensitive = opts. isCaseInsensitive
61
61
62
62
switch self {
@@ -142,7 +142,7 @@ extension String {
142
142
}
143
143
}
144
144
145
- func consumeName( _ name: String , opts: MatchingOptions ) -> MEProgram < String > . ConsumeFunction {
145
+ func consumeName( _ name: String , opts: MatchingOptions ) -> MEProgram . ConsumeFunction {
146
146
let consume = consumeFunction ( for: opts)
147
147
return consume ( propertyScalarPredicate {
148
148
// FIXME: name aliases not covered by $0.nameAlias are missed
@@ -180,7 +180,7 @@ extension AST.Atom {
180
180
181
181
func generateConsumer(
182
182
_ opts: MatchingOptions
183
- ) throws -> MEProgram < String > . ConsumeFunction ? {
183
+ ) throws -> MEProgram . ConsumeFunction ? {
184
184
// TODO: Wean ourselves off of this type...
185
185
if let cc = self . characterClass? . withMatchLevel (
186
186
opts. matchLevel
@@ -237,7 +237,7 @@ extension AST.Atom {
237
237
extension DSLTree . CustomCharacterClass . Member {
238
238
func generateConsumer(
239
239
_ opts: MatchingOptions
240
- ) throws -> MEProgram < String > . ConsumeFunction {
240
+ ) throws -> MEProgram . ConsumeFunction {
241
241
switch self {
242
242
case let . atom( a) :
243
243
guard let c = try a. generateConsumer ( opts) else {
@@ -344,7 +344,7 @@ extension DSLTree.CustomCharacterClass.Member {
344
344
extension DSLTree . CustomCharacterClass {
345
345
func generateConsumer(
346
346
_ opts: MatchingOptions
347
- ) throws -> MEProgram < String > . ConsumeFunction {
347
+ ) throws -> MEProgram . ConsumeFunction {
348
348
// NOTE: Easy way to implement, obviously not performant
349
349
let consumers = try members. map {
350
350
try $0. generateConsumer ( opts)
@@ -386,7 +386,7 @@ private func propertyScalarPredicate(_ p: @escaping (Unicode.Scalar.Properties)
386
386
387
387
func consumeScalar(
388
388
_ p: @escaping ScalarPredicate
389
- ) -> MEProgram < String > . ConsumeFunction {
389
+ ) -> MEProgram . ConsumeFunction {
390
390
{ input, bounds in
391
391
// TODO: bounds check?
392
392
let curIdx = bounds. lowerBound
@@ -399,7 +399,7 @@ func consumeScalar(
399
399
}
400
400
func consumeCharacterWithLeadingScalar(
401
401
_ p: @escaping ScalarPredicate
402
- ) -> MEProgram < String > . ConsumeFunction {
402
+ ) -> MEProgram . ConsumeFunction {
403
403
{ input, bounds in
404
404
let curIdx = bounds. lowerBound
405
405
if p ( input [ curIdx] . unicodeScalars. first!) {
@@ -410,7 +410,7 @@ func consumeCharacterWithLeadingScalar(
410
410
}
411
411
func consumeCharacterWithSingleScalar(
412
412
_ p: @escaping ScalarPredicate
413
- ) -> MEProgram < String > . ConsumeFunction {
413
+ ) -> MEProgram . ConsumeFunction {
414
414
{ input, bounds in
415
415
let curIdx = bounds. lowerBound
416
416
@@ -423,7 +423,7 @@ func consumeCharacterWithSingleScalar(
423
423
424
424
func consumeFunction(
425
425
for opts: MatchingOptions
426
- ) -> ( @escaping ScalarPredicate ) -> MEProgram < String > . ConsumeFunction {
426
+ ) -> ( @escaping ScalarPredicate ) -> MEProgram . ConsumeFunction {
427
427
opts. semanticLevel == . graphemeCluster
428
428
? consumeCharacterWithLeadingScalar
429
429
: consumeScalar
@@ -432,11 +432,11 @@ func consumeFunction(
432
432
extension AST . Atom . CharacterProperty {
433
433
func generateConsumer(
434
434
_ opts: MatchingOptions
435
- ) throws -> MEProgram < String > . ConsumeFunction {
435
+ ) throws -> MEProgram . ConsumeFunction {
436
436
// Handle inversion for us, albeit not efficiently
437
437
func invert(
438
- _ p: @escaping MEProgram < String > . ConsumeFunction
439
- ) -> MEProgram < String > . ConsumeFunction {
438
+ _ p: @escaping MEProgram . ConsumeFunction
439
+ ) -> MEProgram . ConsumeFunction {
440
440
return { input, bounds in
441
441
if p ( input, bounds) != nil { return nil }
442
442
@@ -448,7 +448,7 @@ extension AST.Atom.CharacterProperty {
448
448
}
449
449
450
450
let consume = consumeFunction ( for: opts)
451
- let preInversion : MEProgram < String > . ConsumeFunction =
451
+ let preInversion : MEProgram . ConsumeFunction =
452
452
try {
453
453
switch kind {
454
454
// TODO: is this modeled differently?
@@ -533,7 +533,7 @@ extension Unicode.BinaryProperty {
533
533
// FIXME: Semantic level, vet for precise defs
534
534
func generateConsumer(
535
535
_ opts: MatchingOptions
536
- ) throws -> MEProgram < String > . ConsumeFunction {
536
+ ) throws -> MEProgram . ConsumeFunction {
537
537
let consume = consumeFunction ( for: opts)
538
538
539
539
// Note if you implement support for any of the below, you need to adjust
@@ -701,7 +701,7 @@ extension Unicode.POSIXProperty {
701
701
// FIXME: Semantic level, vet for precise defs
702
702
func generateConsumer(
703
703
_ opts: MatchingOptions
704
- ) -> MEProgram < String > . ConsumeFunction {
704
+ ) -> MEProgram . ConsumeFunction {
705
705
let consume = consumeFunction ( for: opts)
706
706
707
707
// FIXME: modes, etc
@@ -749,7 +749,7 @@ extension Unicode.ExtendedGeneralCategory {
749
749
// FIXME: Semantic level
750
750
func generateConsumer(
751
751
_ opts: MatchingOptions
752
- ) throws -> MEProgram < String > . ConsumeFunction {
752
+ ) throws -> MEProgram . ConsumeFunction {
753
753
let consume = consumeFunction ( for: opts)
754
754
755
755
switch self {
0 commit comments