@@ -381,7 +381,7 @@ struct QuantifyPayload: RawRepresentable {
381381 case asciiBitset = 0
382382 case asciiChar = 1
383383 case any = 2
384- case builtin = 4
384+ case builtinCC = 4
385385 }
386386
387387 // TODO: figure out how to better organize this...
@@ -408,6 +408,14 @@ struct QuantifyPayload: RawRepresentable {
408408 var typeMask : UInt64 { 7 }
409409 var payloadMask : UInt64 { 0xFF_FF }
410410
411+ // Calculate the maximum number of trips, else UInt64.max if unbounded
412+ var maxTrips : UInt64 {
413+ guard let maxExtraTrips else {
414+ return UInt64 . max
415+ }
416+ return minTrips + maxExtraTrips
417+ }
418+
411419 static func packInfoValues(
412420 _ kind: AST . Quantification . Kind ,
413421 _ minTrips: Int ,
@@ -489,7 +497,7 @@ struct QuantifyPayload: RawRepresentable {
489497 + ( model. isInverted ? 1 << 9 : 0 )
490498 + ( model. isStrictASCII ? 1 << 10 : 0 )
491499 self . rawValue = packedModel
492- + QuantifyPayload. packInfoValues ( kind, minTrips, maxExtraTrips, . builtin , isScalarSemantics: isScalarSemantics)
500+ + QuantifyPayload. packInfoValues ( kind, minTrips, maxExtraTrips, . builtinCC , isScalarSemantics: isScalarSemantics)
493501 }
494502
495503 var type : PayloadType {
@@ -535,7 +543,7 @@ struct QuantifyPayload: RawRepresentable {
535543 ( self . rawValue & 1 ) == 1
536544 }
537545
538- var builtin : _CharacterClassModel . Representation {
546+ var builtinCC : _CharacterClassModel . Representation {
539547 _CharacterClassModel. Representation ( rawValue: self . rawValue & 0xFF ) !
540548 }
541549 var builtinIsInverted : Bool {
0 commit comments