mirror of
https://github.com/apple/swift.git
synced 2026-02-27 18:26:24 +01:00
Regex literal runtime plumbing.
- Frontend: Implicitly import `_StringProcessing` when frontend flag `-enable-experimental-string-processing` is set. - Type checker: Set a regex literal expression's type as `_StringProcessing.Regex<(Substring, DynamicCaptures)>`. `(Substring, DynamicCaptures)` is a temporary `Match` type that will help get us to an end-to-end working system. This will be replaced by actual type inference based a regex's pattern in a follow-up patch (soon). - SILGen: Lower a regex literal expression to a call to `_StringProcessing.Regex.init(_regexString:)`. - String processing runtime: Add `Regex`, `DynamicCaptures` (matching actual APIs in apple/swift-experimental-string-processing), and `Regex(_regexString:)`. Upcoming: - Build `_MatchingEngine` and `_StringProcessing` modules with sources from apple/swift-experimental-string-processing. - Replace `DynamicCaptures` with inferred capture types.
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
// RUN: %target-swift-frontend -enable-experimental-string-processing -parse-as-library -emit-sil -verify %s
|
||||
|
||||
// REQUIRES: string_processing
|
||||
// REQUIRES: libswift,string_processing
|
||||
|
||||
import _MatchingEngine
|
||||
import _StringProcessing
|
||||
|
||||
func foo() {
|
||||
_ = DummyMatchingEngine()
|
||||
_ = DummyRegex<Substring>()
|
||||
let _: Regex<(Substring, DynamicCaptures)> = ''
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user