about summary refs log tree commit diff
path: root/std
diff options
context:
space:
mode:
authorBaitinq <[email protected]>2025-05-15 14:59:03 +0200
committerBaitinq <[email protected]>2025-05-15 14:59:03 +0200
commit579fc64e4fc730e212e05b5dadff8140018ca65c (patch)
tree50983a33b7efadcd4a935d536375323ed6c6ffe3 /std
parentCodegen: Fix bug with nested ifs (diff)
downloadinterpreter-579fc64e4fc730e212e05b5dadff8140018ca65c.tar.gz
interpreter-579fc64e4fc730e212e05b5dadff8140018ca65c.tar.bz2
interpreter-579fc64e4fc730e212e05b5dadff8140018ca65c.zip
Bootstrap: Tokenizer: Continue implementing
Diffstat (limited to 'std')
-rw-r--r--std/stdlib.src35
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;
+};