glexer
Types
Values
pub fn lex(lexer: Lexer) -> List(#(token.Token, Position))
pub fn to_source(
tokens: List(#(token.Token, Position)),
) -> String
Turn a sequence of tokens back to their Gleam source code representation.
pub fn unescape_string(string: String) -> Result(String, Nil)
Convert the value of a string token to the string it represents.
This function can fail if the original string contains invalid escape sequences.
unescape_string("\\\"X\\\" marks the spot")
// --> Ok("\"X\" marks the spot")
unescape_string("\\u{1F600}")
// --> Ok("😀")
unescape_string("\\x")
// --> Error(Nil)