Skip to content

Commit ad4966c

Browse files
authored
Merge pull request swiftlang#183 from rxwei/delete-grouptransform
Delete `groupTransform` from AST.
2 parents bd1c4fc + 4f00cab commit ad4966c

File tree

5 files changed

+3
-25
lines changed

5 files changed

+3
-25
lines changed

Sources/_MatchingEngine/Regex/AST/AST.swift

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,6 @@ extension AST {
6565
case absentFunction(AbsentFunction)
6666

6767
case empty(Empty)
68-
69-
// FIXME: Move off the regex literal AST
70-
case groupTransform(
71-
Group, transform: CaptureTransform)
7268
}
7369
}
7470

@@ -91,9 +87,6 @@ extension AST.Node {
9187
case let .customCharacterClass(v): return v
9288
case let .empty(v): return v
9389
case let .absentFunction(v): return v
94-
95-
case let .groupTransform(g, _):
96-
return g // FIXME: get this out of here
9790
}
9891
}
9992

@@ -121,8 +114,7 @@ extension AST.Node {
121114
/// Whether this node has nested somewhere inside it a capture
122115
public var hasCapture: Bool {
123116
switch self {
124-
case .group(let g) where g.kind.value.isCapturing,
125-
.groupTransform(let g, _) where g.kind.value.isCapturing:
117+
case .group(let g) where g.kind.value.isCapturing:
126118
return true
127119
default:
128120
break
@@ -139,7 +131,7 @@ extension AST.Node {
139131
case .group, .conditional, .customCharacterClass, .absentFunction:
140132
return true
141133
case .alternation, .concatenation, .quantification, .quote, .trivia,
142-
.empty, .groupTransform:
134+
.empty:
143135
return false
144136
}
145137
}

Sources/_MatchingEngine/Regex/AST/Atom.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ extension AST.Node {
697697
case .alternation, .concatenation, .group,
698698
.conditional, .quantification, .quote,
699699
.trivia, .customCharacterClass, .empty,
700-
.groupTransform, .absentFunction:
700+
.absentFunction:
701701
return nil
702702
}
703703
}

Sources/_MatchingEngine/Regex/Parse/CaptureStructure.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,6 @@ extension AST.Node {
176176
case let .group(g):
177177
return constructor.grouping(g.child, as: g.kind.value)
178178

179-
case .groupTransform(let g, let transform):
180-
return constructor.grouping(
181-
g.child,
182-
as: g.kind.value,
183-
withTransform: transform)
184-
185179
case .conditional(let c):
186180
return constructor.condition(
187181
c.condition.kind,

Sources/_MatchingEngine/Regex/Printing/PrintAsCanonical.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,6 @@ extension PrettyPrinter {
104104

105105
case .empty:
106106
output("")
107-
108-
case .groupTransform:
109-
output("/* TODO: get groupTransform out of AST */")
110107
}
111108
}
112109

Sources/_StringProcessing/RegexDSL/ASTConversion.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,6 @@ extension AST.Node {
131131
case .empty(_):
132132
return .empty
133133

134-
case let .groupTransform(v, transform):
135-
let child = v.child.dslTreeNode
136-
return .groupTransform(
137-
v.kind.value, child, transform)
138-
139134
case let .absentFunction(a):
140135
// TODO: What should this map to?
141136
return .absentFunction(a)

0 commit comments

Comments
 (0)