From d6e10d2dabaf689ef36e628ee6d54cd460664615 Mon Sep 17 00:00:00 2001 From: Raiki Tamura Date: Sat, 2 Dec 2023 21:01:59 +0900 Subject: gccrs: Implement quick-check for Unicode gcc/rust/ChangeLog: * rust-lang.cc (run_rust_tests): Add test. * rust-system.h: Add . * util/make-rust-unicode.py: Output NFC_Quick_Check table. * util/rust-codepoint.h (struct Codepoint): Add is_supplementary method. * util/rust-unicode-data.h: Generated. * util/rust-unicode.cc (binary_search_sorted_array): Removed. (lookup_cc): Remove namespace. (is_alphabetic): Use std::binary_search (nfc_quick_check): New function. (nfc_normalize): Use nfc_quick_check. (is_nfc_qc_maybe): New function. (is_nfc_qc_no): New function. (rust_nfc_qc_test): New test. * util/rust-unicode.h (is_nfc_qc_no): New function. (is_nfc_qc_maybe): New function. (enum class): New enum class. (nfc_quick_check): New function. (rust_nfc_qc_test): New test. Signed-off-by: Raiki Tamura --- gcc/rust/util/rust-codepoint.h | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/rust/util/rust-codepoint.h') diff --git a/gcc/rust/util/rust-codepoint.h b/gcc/rust/util/rust-codepoint.h index 425d364..eb005eb 100644 --- a/gcc/rust/util/rust-codepoint.h +++ b/gcc/rust/util/rust-codepoint.h @@ -40,6 +40,7 @@ struct Codepoint static Codepoint eof () { return Codepoint (UINT32_MAX); } bool is_eof () const { return value == UINT32_MAX; } bool is_ascii () const { return value <= MAX_ASCII_CODEPOINT; } + bool is_supplementary_character () const { return value > 0xFFFF; } // Returns a C++ string containing string value of codepoint. std::string as_string (); -- cgit v1.1