std/jule/constant/lit
Index
fn IsAscii(r: rune): bool
fn ToRune(mut lit: string): (rune, errors: []Error)
fn GetRune(mut lit: string): (r: rune, length: int, errors: []Error)
fn ToRawString(lit: string): string
fn ToString(mut lit: string): (string, errors: []Error)
struct Error
IsAscii
fn IsAscii(r: rune): boolReports whether rune is byte actually. In other words, whether rune is ASCII.
ToRune
fn ToRune(mut lit: string): (rune, errors: []Error)Returns rune from literal, literal includes quotes. Allows escape sequences. Assumes lit is syntactically correct.
GetRune
fn GetRune(mut lit: string): (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.
ToRawString
fn ToRawString(lit: string): stringReturns raw-string value string from literal, literal includes quotes. Assumes lit is syntactically correct.
ToString
fn ToString(mut lit: string): (string, 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: string
}An error for literal parsing.