Skip to content

Commit 73de196

Browse files
authored
[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.
1 parent e94abbc commit 73de196

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/Frontend/ParseableInterfaceSupport.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ llvm::Regex swift::getSwiftInterfaceFormatVersionRegex() {
562562
}
563563

564564
llvm::Regex swift::getSwiftInterfaceModuleFlagsRegex() {
565-
return llvm::Regex("^// " SWIFT_MODULE_FLAGS_KEY ": (.*)$",
565+
return llvm::Regex("^// " SWIFT_MODULE_FLAGS_KEY ":(.*)$",
566566
llvm::Regex::Newline);
567567
}
568568

test/ParseableInterface/SmokeTest.swiftinterface

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
// The "flags" line in this test deliberately has no flags and no space after
2+
// the colon, just to make sure that works (even though it'll never be printed
3+
// that way).
4+
5+
// swift-module-flags:
16
// swift-interface-format-version: 1.0
2-
// swift-module-flags:
37

48
// Make sure parse-only works...
59
// RUN: %target-swift-frontend -parse %s

0 commit comments

Comments
 (0)