unicode: export bidi details

This commit is contained in:
Drew DeVault 2024-01-26 18:30:39 +01:00
parent 2097b64da5
commit 771e9850fc

View file

@ -94,6 +94,39 @@ export fn gc_code(v: gc) const str = {
}; };
}; };
// Bidirectional classification.
export type bidi = enum u8 {
UNKNOWN,
L,
LRE,
LRO,
R,
AL,
RLE,
RLO,
PDF,
EN,
ES,
ET,
AN,
CS,
NSM,
BN,
B,
S,
WS,
ON,
LRI,
RLI,
FSI,
PDI,
};
// Returns the [[bidi]] classification corresponding to this rune.
export fn rune_bidi(rn: rune) bidi = {
return get_ucdrecord(rn).bidirectional: bidi;
};
// Unicode character Script attribute. // Unicode character Script attribute.
export type script = enum u16 { export type script = enum u16 {
COMMON, // Zyyy COMMON, // Zyyy