From 579fc64e4fc730e212e05b5dadff8140018ca65c Mon Sep 17 00:00:00 2001 From: Baitinq Date: Thu, 15 May 2025 14:59:03 +0200 Subject: Bootstrap: Tokenizer: Continue implementing --- std/stdlib.src | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'std/stdlib.src') diff --git a/std/stdlib.src b/std/stdlib.src index 5904bef..133ed27 100644 --- a/std/stdlib.src +++ b/std/stdlib.src @@ -1,5 +1,6 @@ extern printf = (*i8, varargs) => void; +/* TODO: This has a bug (with varargs i think) */ let println = (str: *i8, args: varargs) => void { printf(str, args); printf("\n"); @@ -29,3 +30,37 @@ let strcmp = (stra: *i8, strb: *i8) => bool { return true; }; + +let isalphanum = (c: i8) => bool { + if c > 'a' { + if c < 'z' { + return true; + }; + }; + if c > 'A' { + if c < 'Z' { + return true; + }; + }; + if c > '0' { + if c < '9' { + return true; + }; + }; + + return false; +}; + +let iswhitespace = (c: i8) => bool { + if c == ' ' { + return true; + }; + + if c >= '\t' { + if c <= '\r' { + return true; + }; + }; + + return false; +}; -- cgit 1.4.1