From 090dedda1b32921fa10fa29a589b63b28233f649 Mon Sep 17 00:00:00 2001 From: StudebakerGuy <> Date: Sat, 7 Mar 2026 18:28:34 -0500 Subject: [PATCH] is_number now searches generate tables --- core/unicode/letter.odin | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/core/unicode/letter.odin b/core/unicode/letter.odin index ade35e16e..636b1bdb2 100644 --- a/core/unicode/letter.odin +++ b/core/unicode/letter.odin @@ -225,12 +225,25 @@ is_control :: proc(r: rune) -> bool #no_bounds_check { return false } +/* +Checks to see if the rune `r` is a number. This means the rune is a member +of the general category Nd, Nl, or No. + +Inputs: +r: The rune to check if it is number. + +Returns: +`true` if the ruen belongs to the general category Nd, Nl, or No. `false` +is return in all other cases. + +*/ @(require_results) is_number :: proc(r: rune) -> bool #no_bounds_check { if u32(r) <= MAX_LATIN1 { return char_properties[u8(r)]&pN != 0 } - return false + + return in_range(r, nd_ranges) || in_range(r, nl_ranges) || in_range(r, no_ranges) } @(require_results)