Skip to content

Commit d5a6cec

Browse files
authored
Correct misspelling in DSL renderer (#627)
vertial -> vertical rdar://104602317
1 parent 2a78475 commit d5a6cec

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

Sources/_StringProcessing/PrintAsPattern.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ extension DSLTree.Atom.CharacterClass {
778778
case .verticalWhitespace:
779779
return ".verticalWhitespace"
780780
case .notVerticalWhitespace:
781-
return ".vertialWhitespace.inverted"
781+
return ".verticalWhitespace.inverted"
782782
case .whitespace:
783783
return ".whitespace"
784784
case .notWhitespace:

Tests/RegexTests/RenderDSLTests.swift

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,32 @@ extension RenderDSLTests {
135135
}
136136
}
137137
"""#)
138+
139+
try testConversion(#"a(?:\w|\W)b(?:\d|\D)c(?:\v|\V)d(?:\h|\H)e"#, #"""
140+
Regex {
141+
"a"
142+
ChoiceOf {
143+
One(.word)
144+
One(.word.inverted)
145+
}
146+
"b"
147+
ChoiceOf {
148+
One(.digit)
149+
One(.digit.inverted)
150+
}
151+
"c"
152+
ChoiceOf {
153+
One(.verticalWhitespace)
154+
One(.verticalWhitespace.inverted)
155+
}
156+
"d"
157+
ChoiceOf {
158+
One(.horizontalWhitespace)
159+
One(.horizontalWhitespace.inverted)
160+
}
161+
"e"
162+
}
163+
"""#)
138164
}
139165

140166
func testOptions() throws {

0 commit comments

Comments
 (0)