Skip to content

Commit 4211cff

Browse files
authored
Merge pull request #6584 from hamishknight/enable-regex-for-real-5.9
[5.9] [lldb] Update for full enablement of experimental string processing
2 parents a34ab3c + 7fd8eb6 commit 4211cff

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

lldb/source/Plugins/ExpressionParser/Swift/SwiftExpressionParser.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,8 +1343,6 @@ static llvm::Expected<ParsedExpression> ParseAndImport(
13431343
sc.target_sp->GetSwiftEnableBareSlashRegex();
13441344
invocation.getLangOptions().EnableBareSlashRegexLiterals =
13451345
enable_bare_slash_regex_literals;
1346-
invocation.getLangOptions().EnableExperimentalStringProcessing =
1347-
enable_bare_slash_regex_literals;
13481346
invocation.getLangOptions().Features.insert(swift::Feature::VariadicGenerics);
13491347

13501348
auto should_use_prestable_abi = [&]() {

lldb/test/API/lang/swift/regex/TestSwiftRegex.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ def test_swift_regex_in_exp(self):
5050
self.build()
5151
lldbutil.run_to_source_breakpoint(
5252
self, 'Set breakpoint here', self.main_source_spec)
53+
54+
# Make sure we can use the extended syntax without enabling anything.
55+
self.expect('e -- #/Order from <(.*)>, type: (.*), count in dozen: ([0-9]+)/#',
56+
substrs=['_StringProcessing.Regex<(Substring, Substring, Substring, Substring)>'])
57+
5358
self.runCmd(
5459
"settings set target.experimental.swift-enable-bare-slash-regex true")
5560
self.expect('e -- /Order from <(.*)>, type: (.*), count in dozen: ([0-9]+)/',

lldb/test/Shell/SwiftREPL/Regex.test

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@
33

44
// RUN: %lldb --repl < %s | FileCheck %s
55

6+
// Make sure we can use an extended literal without enabling anything.
7+
let regex1 = #/Order from <(.*)>, type: (.*), count in dozen: ([0-9]+)/#
8+
// CHECK: _StringProcessing.Regex<(Substring, Substring, Substring, Substring)> =
9+
610
:settings set target.experimental.swift-enable-bare-slash-regex true
7-
let regex = /Order from <(.*)>, type: (.*), count in dozen: ([0-9]+)/
11+
12+
let regex2 = /Order from <(.*)>, type: (.*), count in dozen: ([0-9]+)/
813
// CHECK: _StringProcessing.Regex<(Substring, Substring, Substring, Substring)> =
914

1015
import RegexBuilder
@@ -17,5 +22,6 @@ if #unavailable(macOS 13, iOS 16, watchOS 9, tvOS 16) {
1722
// Work around the fact that the REPL doesn't print results for
1823
// variables declared inside of a conditional.
1924
print("_StringProcessing.Regex<(Substring, Substring, Substring, Substring)> =")
25+
print("_StringProcessing.Regex<(Substring, Substring, Substring, Substring)> =")
2026
print("_StringProcessing.Regex<Substring> = ")
2127
}

0 commit comments

Comments
 (0)