Skip to content

Conversation

@chiragramani
Copy link
Contributor

This PR adds support for passing the -enable-bare-slash-regex flag by default to all the swiftc actions for Swift 5.7 and above.

Context

The following fails to compile on Xcode 14 toolchain:

func regexTest() {
    let testString = "04/07/2022"
    let digits = /\d+/
    print(testString.ranges(of: digits))
}

Analysis

Swift evolution proposal: Regex Literals

As per the proposal, it explicitly needs the -enable-bare-slash-regex flag to successfully compile the above code. Xcode 14 passes the same by default.

Formatted as per Buildifier

Typo
@brentleyjones brentleyjones merged commit 377c9bf into bazelbuild:master Aug 31, 2022
@brentleyjones
Copy link
Collaborator

Thanks @chiragramani!

dierksen pushed a commit to dierksen/rules_swift that referenced this pull request Sep 6, 2022
dierksen added a commit to dierksen/rules_swift that referenced this pull request Sep 6, 2022
* master:
  Update README with new URL (bazelbuild#893)
  Don't error if worker runfiles aren't present (bazelbuild#892)
  Supporting Swift 5.7 Bare Slash Regex Literal (bazelbuild#886)
  Use runfiles for `index-import` path (bazelbuild#889)
  Add additional outputs to the swift module in `SwiftInfo` (bazelbuild#888)
  Add missing swift_import params to objc_provider (bazelbuild#885)
  Fix typo in docs (bazelbuild#887)
  Update README with new URLs (bazelbuild#883)
  Add `apple.swizzle_absolute_xcttestsourcelocation` feature (bazelbuild#878)
  Require cacheable swiftmodules for -no-clang-module-breadcrumbs
  Update apple_support (bazelbuild#880)
  Add basic sanitizer support for swift_test (bazelbuild#877)
  Remove compatibility readme section
  Moves compile_outputs.symbol_graph_directory under all_derived_outputs
keith referenced this pull request Apr 5, 2023
PiperOrigin-RevId: 522158894
tymurmustafaiev pushed a commit to tymurmustafaiev/rules_swift that referenced this pull request Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants