Open dabrahams opened 6 days ago
I should note this isn't really specific to regex literals, e.g you also get the behavior with:
/*
let x = "*/"
*/
That's just a (very nice) reduction of my example, which didn't contain any regex literals either.
Right, I just wanted to clarify that the issue isn't the fact the compiler supports parsing regex literals, this would have been an issue before they were added
Oh. Arguably not a bug at all then. It was never reliable if you had the wrong characters in the code.
Yeah, I don't think we'd want to change the way we lex comments to avoid this, I think we'd want some custom delimiter version of a multiline comment; i.e a comment equivalent of #"
where you can add characters to the starting delimiter that needs to then be matched in the ending delimiter
Description
/ ... / bracketing is no longer a reliable way to comment out code.
Reproduction
I get
Expected behavior
Compiles as a no-op.
Environment
swift-driver version: 1.115 Apple Swift version 6.0 (swiftlang-6.0.0.9.10 clang-1600.0.26.2) Target: arm64-apple-macosx15.0
Additional information
No response