Make GraphemeBreakProperty available globally

This commit is contained in:
Kovid Goyal 2025-04-09 19:57:34 +05:30
parent 203e9f6c58
commit e976cf67fd
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
3 changed files with 21 additions and 21 deletions

View file

@ -1177,10 +1177,10 @@ def gen_char_props() -> None:
gp('import "unsafe"')
gp(f'const MAX_UNICODE = {sys.maxunicode}')
gp(f'const UNICODE_LIMIT = {sys.maxunicode + 1}')
generate_enum(c, gp, 'GraphemeBreakProperty', *grapheme_segmentation_maps, prefix='GBP_')
generate_enum(c, gp, 'IndicConjunctBreak', *incb_map, prefix='ICB_')
cen('// UCBDeclaration {{''{')
cen(f'#define MAX_UNICODE ({sys.maxunicode}u)')
generate_enum(cen, gp, 'GraphemeBreakProperty', *grapheme_segmentation_maps, prefix='GBP_')
generate_enum(c, gp, 'IndicConjunctBreak', *incb_map, prefix='ICB_')
generate_enum(cen, gp, 'UnicodeCategory', 'Cn', *class_maps, prefix='UC_')
cen('// EndUCBDeclaration }}''}')
gp(make_bitfield('tools/wcswidth', 'CharProps', *CharProps.go_fields(), add_package=False)[1])

View file

@ -3,25 +3,6 @@
#pragma once
typedef enum GraphemeBreakProperty {
GBP_AtStart,
GBP_None,
GBP_Prepend,
GBP_CR,
GBP_LF,
GBP_Control,
GBP_Extend,
GBP_Regional_Indicator,
GBP_SpacingMark,
GBP_L,
GBP_V,
GBP_T,
GBP_LV,
GBP_LVT,
GBP_ZWJ,
GBP_Private_Expecting_RI,
} GraphemeBreakProperty;
typedef enum IndicConjunctBreak {
ICB_None,
ICB_Linker,

View file

@ -105,6 +105,25 @@ static_assert(sizeof(GraphemeSegmentationResult) == sizeof(uint16_t), "Fix the o
// UCBDeclaration {{{
#define MAX_UNICODE (1114111u)
typedef enum GraphemeBreakProperty {
GBP_AtStart,
GBP_None,
GBP_Prepend,
GBP_CR,
GBP_LF,
GBP_Control,
GBP_Extend,
GBP_Regional_Indicator,
GBP_SpacingMark,
GBP_L,
GBP_V,
GBP_T,
GBP_LV,
GBP_LVT,
GBP_ZWJ,
GBP_Private_Expecting_RI,
} GraphemeBreakProperty;
typedef enum UnicodeCategory {
UC_Cn,
UC_Cc,