We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 678bba6 commit 11b886aCopy full SHA for 11b886a
Sources/_StringProcessing/Regex/DSLList.swift
@@ -16,7 +16,10 @@ struct DSLList {
16
17
// experimental
18
var hasCapture: Bool = false
19
- var hasChildren: Bool = false
+ var hasChildren: Bool {
20
+ (nodes.first?.directChildren ?? 0) > 0
21
+ }
22
+
23
var captureList: CaptureList {
24
.Builder.build(self)
25
}
Tests/RegexTests/CaptureTests.swift
@@ -157,7 +157,7 @@ func captureTest(
157
158
159
// Ensure DSLTree preserves literal captures
160
- var dslCapList = ast.dslTree.captureList
+ var dslCapList = DSLList(ast: ast).captureList
161
// Peel off the whole match element.
162
dslCapList.captures.removeFirst()
163
guard dslCapList == capList else {
0 commit comments