@@ -378,9 +378,10 @@ struct VariadicsGenerator: ParsableCommand {
378378 \( params. disfavored) \
379379 public init< \( params. genericParams) >(
380380 _ component: Component,
381- _ behavior: QuantificationBehavior = .eagerly
381+ _ behavior: QuantificationBehavior? = nil
382382 ) \( params. whereClauseForInit) {
383- self.init(node: .quantification(. \( kind. astQuantifierAmount) , behavior.astKind, component.regex.root))
383+ let kind: DSLTree.QuantificationKind = behavior.map { .explicit($0.astKind) } ?? .default
384+ self.init(node: .quantification(. \( kind. astQuantifierAmount) , kind, component.regex.root))
384385 }
385386 }
386387
@@ -389,10 +390,11 @@ struct VariadicsGenerator: ParsableCommand {
389390 \( defaultAvailableAttr)
390391 \( params. disfavored) \
391392 public init< \( params. genericParams) >(
392- _ behavior: QuantificationBehavior = .eagerly ,
393+ _ behavior: QuantificationBehavior? = nil ,
393394 @ \( concatBuilderName) _ component: () -> Component
394395 ) \( params. whereClauseForInit) {
395- self.init(node: .quantification(. \( kind. astQuantifierAmount) , behavior.astKind, component().regex.root))
396+ let kind: DSLTree.QuantificationKind = behavior.map { .explicit($0.astKind) } ?? .default
397+ self.init(node: .quantification(. \( kind. astQuantifierAmount) , kind, component().regex.root))
396398 }
397399 }
398400
@@ -404,7 +406,7 @@ struct VariadicsGenerator: ParsableCommand {
404406 public static func buildLimitedAvailability< \( params. genericParams) >(
405407 _ component: Component
406408 ) -> \( regexTypeName) < \( params. matchType) > \( params. whereClause) {
407- .init(node: .quantification(. \( kind. astQuantifierAmount) , .eager , component.regex.root))
409+ .init(node: .quantification(. \( kind. astQuantifierAmount) , .default , component.regex.root))
408410 }
409411 }
410412 """ : " " )
@@ -488,7 +490,7 @@ struct VariadicsGenerator: ParsableCommand {
488490 ) \( params. whereClauseForInit) {
489491 assert(count > 0, " Must specify a positive count " )
490492 // TODO: Emit a warning about `repeatMatch(count: 0)` or `repeatMatch(count: 1)`
491- self.init(node: .quantification(.exactly(.init(faking: count)), .eager , component.regex.root))
493+ self.init(node: .quantification(.exactly(.init(faking: count)), .default , component.regex.root))
492494 }
493495
494496 \( defaultAvailableAttr)
@@ -499,15 +501,15 @@ struct VariadicsGenerator: ParsableCommand {
499501 ) \( params. whereClauseForInit) {
500502 assert(count > 0, " Must specify a positive count " )
501503 // TODO: Emit a warning about `repeatMatch(count: 0)` or `repeatMatch(count: 1)`
502- self.init(node: .quantification(.exactly(.init(faking: count)), .eager , component().regex.root))
504+ self.init(node: .quantification(.exactly(.init(faking: count)), .default , component().regex.root))
503505 }
504506
505507 \( defaultAvailableAttr)
506508 \( params. disfavored) \
507509 public init< \( params. genericParams) , R: RangeExpression>(
508510 _ component: Component,
509511 _ expression: R,
510- _ behavior: QuantificationBehavior = .eagerly
512+ _ behavior: QuantificationBehavior? = nil
511513 ) \( params. repeatingWhereClause) {
512514 self.init(node: .repeating(expression.relative(to: 0..<Int.max), behavior, component.regex.root))
513515 }
@@ -516,7 +518,7 @@ struct VariadicsGenerator: ParsableCommand {
516518 \( params. disfavored) \
517519 public init< \( params. genericParams) , R: RangeExpression>(
518520 _ expression: R,
519- _ behavior: QuantificationBehavior = .eagerly ,
521+ _ behavior: QuantificationBehavior? = nil ,
520522 @ \( concatBuilderName) _ component: () -> Component
521523 ) \( params. repeatingWhereClause) {
522524 self.init(node: .repeating(expression.relative(to: 0..<Int.max), behavior, component().regex.root))
0 commit comments