std/jule/constant/lit
Index
fn IsAscii(r: rune): bool
fn ToRune(mut lit: str): (<anonymous>: rune, errors: []Error)
fn GetRune(mut lit: str): (r: rune, length: int, errors: []Error)
fn ToRawStr(lit: str): str
fn ToStr(mut lit: str): (<anonymous>: str, errors: []Error)
struct Error
IsAscii
fn IsAscii(r: rune): bool
Reports whether rune is byte actually. In other words, whether rune is ASCII.
ToRune
fn ToRune(mut lit: str): (<anonymous>: rune, errors: []Error)
Returns rune from literal, literal includes quotes. Allows escape sequences. Assumes lit is syntactically correct.
GetRune
fn GetRune(mut lit: str): (r: rune, length: int, errors: []Error)
Returns the first rune from ltieral. Quotes of the literal must be removed. Allows escape sequences. Checks the literal syntactically and semantically for the first rune.
ToRawStr
fn ToRawStr(lit: str): str
Returns raw-string value string from literal, literal includes quotes. Assumes lit is syntactically correct.
ToStr
fn ToStr(mut lit: str): (<anonymous>: str, errors: []Error)
Returns string value string from literal, literal includes quotes. Allows escape sequences. Assumes lit is syntactically correct.
Error
struct Error {
Offset: int
Text: str
}
An error for literal parsing.