@@ -193,65 +193,65 @@ def emit_general_category_module(f):
193
193
/// The most general classification of a character.
194
194
pub enum GeneralCategory {
195
195
/// `Lu`, an uppercase letter
196
- LetterUppercase ,
196
+ UppercaseLetter ,
197
197
/// `Ll`, a lowercase letter
198
- LetterLowercase ,
198
+ LowercaseLetter ,
199
199
/// `Lt`, a digraphic character, with first part uppercase
200
- LetterTitlecase ,
200
+ TitlecaseLetter ,
201
201
/// `Lm`, a modifier letter
202
- LetterModifier ,
202
+ ModifierLetter ,
203
203
/// `Lo`, other letters, including syllables and ideographs
204
- LetterOther ,
204
+ OtherLetter ,
205
205
/// `Mn`, a nonspacing combining mark (zero advance width)
206
- MarkNonspacing ,
206
+ NonspacingMark ,
207
207
/// `Mc`, a spacing combining mark (positive advance width)
208
- MarkSpacing ,
208
+ SpacingMark ,
209
209
/// `Me`, an enclosing combining mark
210
- MarkEnclosing ,
210
+ EnclosingMark ,
211
211
/// `Nd`, a decimal digit
212
- NumberDecimal ,
212
+ DecimalNumber ,
213
213
/// `Nl`, a letterlike numeric character
214
- NumberLetter ,
214
+ LetterNumber ,
215
215
/// `No`, a numeric character of other type
216
- NumberOther ,
216
+ OtherNumber ,
217
217
/// `Pc`, a connecting punctuation mark, like a tie
218
- PunctuationConnector ,
218
+ ConnectorPunctuation ,
219
219
/// `Pd`, a dash or hyphen punctuation mark
220
- PunctuationDash ,
220
+ DashPunctuation ,
221
221
/// `Ps`, an opening punctuation mark (of a pair)
222
- PunctuationOpen ,
222
+ OpenPunctuation ,
223
223
/// `Pe`, a closing punctuation mark (of a pair)
224
- PunctuationClose ,
224
+ ClosePunctuation ,
225
225
/// `Pi`, an initial quotation mark
226
- PunctuationInitial ,
226
+ InitialPunctuation ,
227
227
/// `Pf`, a final quotation mark
228
- PunctuationFinal ,
228
+ FinalPunctuation ,
229
229
/// `Po`, a punctuation mark of other type
230
- PunctuationOther ,
230
+ OtherPunctuation ,
231
231
/// `Sm`, a symbol of mathematical use
232
- SymbolMath ,
232
+ MathSymbol ,
233
233
/// `Sc`, a currency sign
234
- SymbolCurrency ,
234
+ CurrencySymbol ,
235
235
/// `Sk`, a non-letterlike modifier symbol
236
- SymbolModifier ,
236
+ ModifierSymbol ,
237
237
/// `So`, a symbol of other type
238
- SymbolOther ,
238
+ OtherSymbol ,
239
239
/// `Zs`, a space character (of various non-zero widths)
240
- SeparatorSpace ,
240
+ SpaceSeparator ,
241
241
/// `Zl`, U+2028 LINE SEPARATOR only
242
- SeparatorLine ,
242
+ LineSeparator ,
243
243
/// `Zp`, U+2029 PARAGRAPH SEPARATOR only
244
- SeparatorParagraph ,
244
+ ParagraphSeparator ,
245
245
/// `Cc`, a C0 or C1 control code
246
- OtherControl ,
246
+ Control ,
247
247
/// `Cf`, a format control character
248
- OtherFormat ,
248
+ Format ,
249
249
/// `Cs`, a surrogate code point
250
- OtherSurrogate ,
250
+ Surrogate ,
251
251
/// `Co`, a private-use character
252
- OtherPrivateUse ,
252
+ PrivateUse ,
253
253
/// `Cn`, a reserved unassigned code point or a noncharacter
254
- OtherUnassigned ,
254
+ Unassigned ,
255
255
}
256
256
257
257
#[derive(Copy, Clone, Hash, Eq, PartialEq, Ord, PartialOrd, Debug)]
@@ -276,82 +276,82 @@ def emit_general_category_module(f):
276
276
#[inline]
277
277
pub(crate) fn general_category_of_char(c: char) -> GeneralCategory {
278
278
match c as usize {
279
- _ => super::util::bsearch_range_value_table(c, GENERAL_CATEGORY).unwrap_or(GeneralCategory::OtherUnassigned )
279
+ _ => super::util::bsearch_range_value_table(c, GENERAL_CATEGORY).unwrap_or(GeneralCategory::Unassigned )
280
280
}
281
281
}
282
282
283
283
#[inline]
284
284
pub(crate) fn general_category_is_letter_cased(gc: GeneralCategory) -> bool {
285
- matches!(gc, GeneralCategory::LetterUppercase | GeneralCategory::LetterLowercase | GeneralCategory::LetterTitlecase )
285
+ matches!(gc, GeneralCategory::UppercaseLetter | GeneralCategory::LowercaseLetter | GeneralCategory::TitlecaseLetter )
286
286
}
287
287
288
288
#[inline]
289
289
pub(crate) fn general_category_group(gc: GeneralCategory) -> GeneralCategoryGroup {
290
290
match gc {
291
- GeneralCategory::LetterUppercase |
292
- GeneralCategory::LetterLowercase |
293
- GeneralCategory::LetterTitlecase |
294
- GeneralCategory::LetterModifier |
295
- GeneralCategory::LetterOther => GeneralCategoryGroup::Letter,
296
- GeneralCategory::MarkNonspacing |
297
- GeneralCategory::MarkSpacing |
298
- GeneralCategory::MarkEnclosing => GeneralCategoryGroup::Mark,
299
- GeneralCategory::NumberDecimal |
300
- GeneralCategory::NumberLetter |
301
- GeneralCategory::NumberOther => GeneralCategoryGroup::Number,
302
- GeneralCategory::PunctuationConnector |
303
- GeneralCategory::PunctuationDash |
304
- GeneralCategory::PunctuationOpen |
305
- GeneralCategory::PunctuationClose |
306
- GeneralCategory::PunctuationInitial |
307
- GeneralCategory::PunctuationFinal |
308
- GeneralCategory::PunctuationOther => GeneralCategoryGroup::Punctuation,
309
- GeneralCategory::SymbolMath |
310
- GeneralCategory::SymbolCurrency |
311
- GeneralCategory::SymbolModifier |
312
- GeneralCategory::SymbolOther => GeneralCategoryGroup::Symbol,
313
- GeneralCategory::SeparatorSpace |
314
- GeneralCategory::SeparatorLine |
315
- GeneralCategory::SeparatorParagraph => GeneralCategoryGroup::Separator,
316
- GeneralCategory::OtherControl |
317
- GeneralCategory::OtherFormat |
318
- GeneralCategory::OtherSurrogate |
319
- GeneralCategory::OtherPrivateUse |
320
- GeneralCategory::OtherUnassigned => GeneralCategoryGroup::Other,
291
+ GeneralCategory::UppercaseLetter |
292
+ GeneralCategory::LowercaseLetter |
293
+ GeneralCategory::TitlecaseLetter |
294
+ GeneralCategory::ModifierLetter |
295
+ GeneralCategory::OtherLetter => GeneralCategoryGroup::Letter,
296
+ GeneralCategory::NonspacingMark |
297
+ GeneralCategory::SpacingMark |
298
+ GeneralCategory::EnclosingMark => GeneralCategoryGroup::Mark,
299
+ GeneralCategory::DecimalNumber |
300
+ GeneralCategory::LetterNumber |
301
+ GeneralCategory::OtherNumber => GeneralCategoryGroup::Number,
302
+ GeneralCategory::ConnectorPunctuation |
303
+ GeneralCategory::DashPunctuation |
304
+ GeneralCategory::OpenPunctuation |
305
+ GeneralCategory::ClosePunctuation |
306
+ GeneralCategory::InitialPunctuation |
307
+ GeneralCategory::FinalPunctuation |
308
+ GeneralCategory::OtherPunctuation => GeneralCategoryGroup::Punctuation,
309
+ GeneralCategory::MathSymbol |
310
+ GeneralCategory::CurrencySymbol |
311
+ GeneralCategory::ModifierSymbol |
312
+ GeneralCategory::OtherSymbol => GeneralCategoryGroup::Symbol,
313
+ GeneralCategory::SpaceSeparator |
314
+ GeneralCategory::LineSeparator |
315
+ GeneralCategory::ParagraphSeparator => GeneralCategoryGroup::Separator,
316
+ GeneralCategory::Control |
317
+ GeneralCategory::Format |
318
+ GeneralCategory::Surrogate |
319
+ GeneralCategory::PrivateUse |
320
+ GeneralCategory::Unassigned => GeneralCategoryGroup::Other,
321
321
}
322
322
}
323
323
""" )
324
324
gc_variants = {
325
- "Lu" : "GeneralCategory::LetterUppercase " ,
326
- "Ll" : "GeneralCategory::LetterLowercase " ,
327
- "Lt" : "GeneralCategory::LetterTitlecase " ,
328
- "Lm" : "GeneralCategory::LetterModifier " ,
329
- "Lo" : "GeneralCategory::LetterOther " ,
330
- "Mn" : "GeneralCategory::MarkNonspacing " ,
331
- "Mc" : "GeneralCategory::MarkSpacing " ,
332
- "Me" : "GeneralCategory::MarkEnclosing " ,
333
- "Nd" : "GeneralCategory::NumberDecimal " ,
334
- "Nl" : "GeneralCategory::NumberLetter " ,
335
- "No" : "GeneralCategory::NumberOther " ,
336
- "Pc" : "GeneralCategory::PunctuationConnector " ,
337
- "Pd" : "GeneralCategory::PunctuationDash " ,
338
- "Ps" : "GeneralCategory::PunctuationOpen " ,
339
- "Pe" : "GeneralCategory::PunctuationClose " ,
340
- "Pi" : "GeneralCategory::PunctuationInitial " ,
341
- "Pf" : "GeneralCategory::PunctuationFinal " ,
342
- "Po" : "GeneralCategory::PunctuationOther " ,
343
- "Sm" : "GeneralCategory::SymbolMath " ,
344
- "Sc" : "GeneralCategory::SymbolCurrency " ,
345
- "Sk" : "GeneralCategory::SymbolModifier " ,
346
- "So" : "GeneralCategory::SymbolOther " ,
347
- "Zs" : "GeneralCategory::SeparatorSpace " ,
348
- "Zl" : "GeneralCategory::SeparatorLine " ,
349
- "Zp" : "GeneralCategory::SeparatorParagraph " ,
350
- "Cc" : "GeneralCategory::OtherControl " ,
351
- "Cf" : "GeneralCategory::OtherFormat " ,
352
- "Cs" : "GeneralCategory::OtherSurrogate " ,
353
- "Co" : "GeneralCategory::OtherPrivateUse " ,
354
- "Cn" : "GeneralCategory::OtherUnassigned " ,
325
+ "Lu" : "GeneralCategory::UppercaseLetter " ,
326
+ "Ll" : "GeneralCategory::LowercaseLetter " ,
327
+ "Lt" : "GeneralCategory::TitlecaseLetter " ,
328
+ "Lm" : "GeneralCategory::ModifierLetter " ,
329
+ "Lo" : "GeneralCategory::OtherLetter " ,
330
+ "Mn" : "GeneralCategory::NonspacingMark " ,
331
+ "Mc" : "GeneralCategory::SpacingMark " ,
332
+ "Me" : "GeneralCategory::EnclosingMark " ,
333
+ "Nd" : "GeneralCategory::DecimalNumber " ,
334
+ "Nl" : "GeneralCategory::LetterNumber " ,
335
+ "No" : "GeneralCategory::OtherNumber " ,
336
+ "Pc" : "GeneralCategory::ConnectorPunctuation " ,
337
+ "Pd" : "GeneralCategory::DashPunctuation " ,
338
+ "Ps" : "GeneralCategory::OpenPunctuation " ,
339
+ "Pe" : "GeneralCategory::ClosePunctuation " ,
340
+ "Pi" : "GeneralCategory::InitialPunctuation " ,
341
+ "Pf" : "GeneralCategory::FinalPunctuation " ,
342
+ "Po" : "GeneralCategory::OtherPunctuation " ,
343
+ "Sm" : "GeneralCategory::MathSymbol " ,
344
+ "Sc" : "GeneralCategory::CurrencySymbol " ,
345
+ "Sk" : "GeneralCategory::ModifierSymbol " ,
346
+ "So" : "GeneralCategory::OtherSymbol " ,
347
+ "Zs" : "GeneralCategory::SpaceSeparator " ,
348
+ "Zl" : "GeneralCategory::LineSeparator " ,
349
+ "Zp" : "GeneralCategory::ParagraphSeparator " ,
350
+ "Cc" : "GeneralCategory::Control " ,
351
+ "Cf" : "GeneralCategory::Format " ,
352
+ "Cs" : "GeneralCategory::Surrogate " ,
353
+ "Co" : "GeneralCategory::PrivateUse " ,
354
+ "Cn" : "GeneralCategory::Unassigned " ,
355
355
}
356
356
357
357
f .write (" // General category table:\n " )
0 commit comments