std/jule/constant/lit
Index
fn IsAscii(r: rune): bool
fn ToRune(mut lit: str): (rune, errors: []Error)
fn ToRawStr(lit: str): str
fn ToStr(mut lit: str): (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): (rune, errors: []Error)
Returns rune value string from literal, includes quotes. Bytes are represents rune literal, allows escape sequences. Returns zero rune if len(lit) == 0. Assumes lit is syntaticaly and semantically correct.
ToRawStr
fn ToRawStr(lit: str): str
Returns raw-string value string from literal, includes quotes. Bytes are represents string characters. Returns empty string if len(lit) == 0. Assumes lit is syntaticaly and semantically correct.
ToStr
fn ToStr(mut lit: str): (str, errors: []Error)
Returns string value string from literal, includes quotes. Bytes are represents string characters, allows escape sequences. Returns empty string if len(lit) == 0. Assumes lit is syntaticaly and semantically correct.
Error
struct Error {
Offset: int
Text: str
}
An error for literal parsing.