@@ -156,6 +156,9 @@ pub enum ErrorKind {
156
156
/// `(?i)*`. It is, however, possible to create a repetition operating on
157
157
/// an empty sub-expression. For example, `()*` is still considered valid.
158
158
RepetitionMissing ,
159
+ /// The Unicode class is not valid. This typically occurs when a `\p` is
160
+ /// followed by something other than a `{`.
161
+ UnicodeClassInvalid ,
159
162
/// When octal support is disabled, this error is produced when an octal
160
163
/// escape is used. The octal escape is assumed to be an invocation of
161
164
/// a backreference, which is the common case.
@@ -208,6 +211,7 @@ impl error::Error for Error {
208
211
RepetitionCountInvalid => "invalid repetition count range" ,
209
212
RepetitionCountUnclosed => "unclosed counted repetition" ,
210
213
RepetitionMissing => "repetition operator missing expression" ,
214
+ UnicodeClassInvalid => "invalid Unicode character class" ,
211
215
UnsupportedBackreference => "backreferences are not supported" ,
212
216
UnsupportedLookAround => "look-around is not supported" ,
213
217
_ => unreachable ! ( ) ,
@@ -295,6 +299,9 @@ impl fmt::Display for ErrorKind {
295
299
RepetitionMissing => {
296
300
write ! ( f, "repetition operator missing expression" )
297
301
}
302
+ UnicodeClassInvalid => {
303
+ write ! ( f, "invalid Unicode character class" )
304
+ }
298
305
UnsupportedBackreference => {
299
306
write ! ( f, "backreferences are not supported" )
300
307
}
0 commit comments