in Sources/_StringProcessing/MatchingOptions.swift [125:167]
init?(_ astKind: AST.MatchingOption.Kind) {
switch astKind {
case .caseInsensitive:
self = .caseInsensitive
case .allowDuplicateGroupNames:
self = .allowDuplicateGroupNames
case .multiline:
self = .multiline
case .noAutoCapture:
self = .noAutoCapture
case .singleLine:
self = .singleLine
case .reluctantByDefault:
self = .reluctantByDefault
case .unicodeWordBoundaries:
self = .unicodeWordBoundaries
case .asciiOnlyDigit:
self = .asciiOnlyDigit
case .asciiOnlyPOSIXProps:
self = .asciiOnlyPOSIXProps
case .asciiOnlySpace:
self = .asciiOnlySpace
case .asciiOnlyWord:
self = .asciiOnlyWord
case .textSegmentGraphemeMode:
self = .textSegmentGraphemeMode
case .textSegmentWordMode:
self = .textSegmentWordMode
case .graphemeClusterSemantics:
self = .graphemeClusterSemantics
case .unicodeScalarSemantics:
self = .unicodeScalarSemantics
case .byteSemantics:
self = .byteSemantics
// Whitespace options are only relevant during parsing, not compilation.
case .extended, .extraExtended:
return nil
@unknown default:
// Ignore unknown
return nil
}
}