mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
test: Improve regex in Swift feature usage verification script
* Account for variable number of spaces. * Match strings like '-enable-upcoming-feature\'. We want to complain about these because the script cannot get the job done when the option and argument are on different lines. The capture group will match '' in these cases.
This commit is contained in:
@@ -28,7 +28,7 @@ EXCEPTIONAL_FILES = [
|
||||
]
|
||||
|
||||
ENABLE_FEATURE_RE = re.compile(
|
||||
r"-enable-(?:experimental|upcoming)-feature (?:-Xfrontend )?([A-Za-z0-9]*)"
|
||||
r"-enable-(?:experimental|upcoming)-feature(?:\s+-Xfrontend)?\s*([A-Za-z0-9]*)"
|
||||
)
|
||||
FEATURE_LIT_MARKER_RE = re.compile(r"swift_feature_([A-Za-z0-9]*)")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user