diff options
Diffstat (limited to 'std/stdlib.src')
| -rw-r--r-- | std/stdlib.src | 35 |
1 files changed, 35 insertions, 0 deletions
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; +}; |