From 9d99668ad0b123f522e4adffec9dd34930c0d930 Mon Sep 17 00:00:00 2001 From: Baitinq Date: Thu, 15 May 2025 21:41:40 +0200 Subject: Bootstrap: Tokenizer: Tokenize ints --- std/stdlib.src | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'std/stdlib.src') diff --git a/std/stdlib.src b/std/stdlib.src index 133ed27..91884d5 100644 --- a/std/stdlib.src +++ b/std/stdlib.src @@ -31,6 +31,15 @@ let strcmp = (stra: *i8, strb: *i8) => bool { return true; }; +let isdigit = (c: i8) => bool { + if c > '0' { + if c < '9' { + return true; + }; + }; + return false; +}; + let isalphanum = (c: i8) => bool { if c > 'a' { if c < 'z' { @@ -42,10 +51,8 @@ let isalphanum = (c: i8) => bool { return true; }; }; - if c > '0' { - if c < '9' { - return true; - }; + if isdigit(c) { + return true; }; return false; -- cgit 1.4.1