feat(unicode,datastruct): port Unicode tables and data structures
ghostty-unicode: Ghostty computes codepoint properties with the uucode Zig package (v0.2.0, Unicode 17.0.0). There is no Rust equivalent, so a trimmed UCD set is vendored in ucd/ and build.rs re-implements uucode's derivations: cell width rules incl. Ghostty's overrides for emoji modifiers and Prepend, grapheme break classes with the compile-time grapheme_break state table, the is_symbol set, and emoji presentation. Lookups are three array indexes per codepoint. Validated against the official GraphemeBreakTest.txt. ghostty-datastruct: split_tree (used for GTK splits; f16 ratios so rounding and debug diagrams match Zig), circ_buf, lru, cache_table, blocking_queue, segmented_pool, message_data, comparison, array_list_collection. intrusive_linked_list is not needed (lru is index based). lru now reports the evicted (old) key, Zig reported the new key, which appears to be a bug. Not yet covered: case_folding_full (needed by input bindings). Test Plan: - cargo test -p ghostty-unicode (16) -p ghostty-datastruct (88) - cargo clippy for both crates with -D warnings
This commit is contained in:
1 parent
b96984b020
commit
5b8c92b98c
31 files changed
+18468
-3
No files matched your search
@@ -0,0 +1,21 @@
|
||||
//! The generated Unicode property lookup table for Ghostty
|
||||
//! (`props_table.zig`). Generated by `build.rs`.
|
||||
|
||||
use crate::lut::Tables;
|
||||
use crate::props::{GraphemeBreakNoControl, Properties};
|
||||
|
||||
mod generated {
|
||||
use super::{GraphemeBreakNoControl, Properties};
|
||||
include!(concat!(env!("OUT_DIR"), "/props_tables.rs"));
|
||||
}
|
||||
|
||||
/// The lookup tables for Ghostty.
|
||||
#[inline]
|
||||
#[must_use]
|
||||
pub fn table() -> Tables<'static, Properties> {
|
||||
Tables {
|
||||
stage1: &generated::STAGE1,
|
||||
stage2: &generated::STAGE2,
|
||||
stage3: &generated::STAGE3,
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user