started writing lexer after making string lib

This commit is contained in:
2026-04-13 19:59:48 +10:00
parent f67c045845
commit c0c35e4d17
24 changed files with 601 additions and 7 deletions

View File

@@ -0,0 +1,24 @@
# string_IsAlnum
Returns true if the given `string` is alphanumeric.
## Arguments
- str (string): the string to check.
## Returns
isAlnum (bool): returns `true` if `string` is alphanumeric, otherwise `false`.
## Example
### Ground
```python
call !string_IsAlnum "abc123" &isAlnum
println $isAlnum # true
call !string_IsAlnum "@$!ffasdf" &isAlnum
println $isAlnum # false
call !string_IsAlnum "1234" &isAlnum
println $isAlnum # true
call !string_IsAlnum "_" &isAlnum
println $isAlnum # false
```

View File

@@ -0,0 +1,24 @@
# string_IsAlpha
Returns true if the given `string` is only the letters a-Z.
## Arguments
- str (string): the string to check.
## Returns
isAlpha (bool): returns `true` if `string` is only the letters a-Z, otherwise `false`.
## Example
### Ground
```python
call !string_IsAlpha "abcABC" &isAlpha
println $isAlpha # true
call !string_IsAlpha "123" &isAlpha
println $isAlpha # false
call !string_IsAlpha "abc_$@" &isAlpha
println $isAlpha # false
call !string_IsAlpha "aAbBcCdDeEfF" &isAlpha
println $isAlpha # true
```

View File

@@ -0,0 +1,24 @@
# string_IsAlpha
Returns true if the given `string` is only numbers.
## Arguments
- str (string): the string to check.
## Returns
isAlpha (bool): returns `true` if `string` is only numbers, otherwise `false`.
## Example
### Ground
```python
call !string_IsAlpha "65535" &isAlpha
println $isAlpha # true
call !string_IsAlpha "$!@/_ffff" &isAlpha
println $isAlpha # false
call !string_IsAlpha "1234" &isAlpha
println $isAlpha # true
call !string_IsAlpha "abcd123" &isAlpha
println $isAlpha # false
```

View File

@@ -0,0 +1,24 @@
# string_IsSpace
Returns true if the given `string` is whitespace.
## Arguments
- str (string): the string to check.
## Returns
isAlpha (bool): returns `true` if `string` is whitespace, otherwise `false`.
## Example
### Ground
```python
call !string_IsAlpha " " &isAlpha
println $isAlpha # true
call !string_IsAlpha " " &isAlpha
println $isAlpha # true
call !string_IsAlpha "abc_def" &isAlpha
println $isAlpha # false
call !string_IsAlpha " a" &isAlpha
println $isAlpha # false
```