[ParseableInterface] Accept no space after "swift-module-flags:" (#21334)

I lost about a minute or so to this with a manually-written
swiftinterface, so may as well avoid that problem in the future.
This commit is contained in:
Jordan Rose
2018-12-17 13:20:24 -08:00
committed by GitHub
parent e94abbca4b
commit 73de196fb5
2 changed files with 6 additions and 2 deletions

View File

@@ -562,7 +562,7 @@ llvm::Regex swift::getSwiftInterfaceFormatVersionRegex() {
}
llvm::Regex swift::getSwiftInterfaceModuleFlagsRegex() {
return llvm::Regex("^// " SWIFT_MODULE_FLAGS_KEY ": (.*)$",
return llvm::Regex("^// " SWIFT_MODULE_FLAGS_KEY ":(.*)$",
llvm::Regex::Newline);
}

View File

@@ -1,5 +1,9 @@
// swift-interface-format-version: 1.0
// The "flags" line in this test deliberately has no flags and no space after
// the colon, just to make sure that works (even though it'll never be printed
// that way).
// swift-module-flags:
// swift-interface-format-version: 1.0
// Make sure parse-only works...
// RUN: %target-swift-frontend -parse %s