Skip to content

Commit 6b95d83

Browse files
committed
Mark '\O' unsupported
We have decided not to support this for now.
1 parent be98b28 commit 6b95d83

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

Sources/_RegexParser/Regex/Parse/Sema.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,14 +220,14 @@ extension RegexValidator {
220220
_ esc: AST.Atom.EscapedBuiltin, at loc: SourceLocation
221221
) {
222222
switch esc {
223-
case .resetStartOfMatch, .singleDataUnit,
223+
case .resetStartOfMatch, .singleDataUnit, .trueAnychar,
224224
// '\N' needs to be emitted using 'emitAny'.
225225
.notNewline:
226226
error(.unsupported("'\\\(esc.character)'"), at: loc)
227227

228228
// Character classes.
229229
case .decimalDigit, .notDecimalDigit, .whitespace, .notWhitespace,
230-
.wordCharacter, .notWordCharacter, .graphemeCluster, .trueAnychar,
230+
.wordCharacter, .notWordCharacter, .graphemeCluster,
231231
.horizontalWhitespace, .notHorizontalWhitespace,
232232
.verticalTab, .notVerticalTab:
233233
break

Tests/RegexTests/MatchTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1786,7 +1786,7 @@ extension RegexTests {
17861786
match: eDecomposed,
17871787
xfail: true
17881788
)
1789-
firstMatchTest(#"\O"#, input: eComposed, match: eComposed)
1789+
firstMatchTest(#"\O"#, input: eComposed, match: eComposed, xfail: true)
17901790
firstMatchTest(#"\O"#, input: eDecomposed, match: nil,
17911791
xfail: true)
17921792

Tests/RegexTests/ParseTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -806,6 +806,8 @@ extension RegexTests {
806806
parseTest(#"\M-\C--"#, atom(.keyboardMetaControl("-")), unsupported: true)
807807
parseTest(#"\M-a"#, atom(.keyboardMeta("a")), unsupported: true)
808808

809+
parseTest(#"\O"#, escaped(.trueAnychar), unsupported: true)
810+
809811
// MARK: Comments
810812

811813
parseTest(

0 commit comments

Comments
 (0)