-
Notifications
You must be signed in to change notification settings - Fork 1
melon.char
melon.char
Contains useful functions for matching characters against sets of characters efficiently
melon

melon.char.IsAlpha(char) -> bool
Argument and Return information
| # | Name | Type | Description |
|---|---|---|---|
| 1 | char | char | The character to check |
| # | Name | Type | Description |
|---|---|---|---|
| 1 | bool | bool | Is this character in the given set |
Is the given character an Alphabetic character

melon.char.IsAlphaNumeric(char) -> bool
Argument and Return information
| # | Name | Type | Description |
|---|---|---|---|
| 1 | char | char | The character to check |
| # | Name | Type | Description |
|---|---|---|---|
| 1 | bool | bool | Is this character in the given set |
Is the given character an AlphaNumeric character

melon.char.IsHex(char) -> bool
Argument and Return information
| # | Name | Type | Description |
|---|---|---|---|
| 1 | char | char | The character to check |
| # | Name | Type | Description |
|---|---|---|---|
| 1 | bool | bool | Is this character in the given set |
Is the given character a hexadecimal character, (0-9, a-f, A-F)

melon.char.IsKeyboardSymbol(char) -> bool
Argument and Return information
| # | Name | Type | Description |
|---|---|---|---|
| 1 | char | char | The character to check |
| # | Name | Type | Description |
|---|---|---|---|
| 1 | bool | bool | Is this character in the given set |
Is the given character a "keyboard symbol", aka any character enterable through a standard US keyboard

melon.char.IsLower(char) -> bool
Argument and Return information
| # | Name | Type | Description |
|---|---|---|---|
| 1 | char | char | The character to check |
| # | Name | Type | Description |
|---|---|---|---|
| 1 | bool | bool | Is this character in the given set |
Is the given character an Alphabetical Lower-Case

melon.char.IsNum(char) -> bool
Argument and Return information
| # | Name | Type | Description |
|---|---|---|---|
| 1 | char | char | The character to check |
| # | Name | Type | Description |
|---|---|---|---|
| 1 | bool | bool | Is this character in the given set |
Is the given character a Numeric character

melon.char.IsUpper(char) -> bool
Argument and Return information
| # | Name | Type | Description |
|---|---|---|---|
| 1 | char | char | The character to check |
| # | Name | Type | Description |
|---|---|---|---|
| 1 | bool | bool | Is this character in the given set |
Is the given character an Alphabetical Upper-Case

melon.char.IsWhitespace(char) -> bool
Argument and Return information
| # | Name | Type | Description |
|---|---|---|---|
| 1 | char | char | The character to check |
| # | Name | Type | Description |
|---|---|---|---|
| 1 | bool | bool | Is this character in the given set |
Is the given character a whitespace character

melon.char.Range(from: char, to: char) -> fn(from: char) -> bool
Argument and Return information
| # | Name | Type | Description |
|---|---|---|---|
| 1 | from | char | The starting character |
| 2 | to | char | The ending character |
| # | Name | Type | Description |
|---|---|---|---|
| 1 | match | fn(from: char) -> bool | The generated function |
Creates a new function that checks if the given char is within the two given codepoints inclusively

melon.char.Ranges(ranges: table<fn(ranges: char)>, intersects?: bool) -> fn(ranges: char) -> bool

melon.char.Set(chars: char...) -> fn(chars: char) -> bool
Argument and Return information
| # | Name | Type | Description |
|---|---|---|---|
| 1 | chars | char... | All specific characters to match against |
| # | Name | Type | Description |
|---|---|---|---|
| 1 | match | fn(chars: char) -> bool | The generated function |
Creates a new function that checks against the given characters