1import gleam/list
 2import nibble/lexer.{type Token, Keep}
 3
 4pub fn chars() -> lexer.Lexer(String, Nil) {
 5  lexer.simple([lexer.custom(fn(_, lexeme, _) { Keep(lexeme, Nil) })])
 6}
 7
 8pub fn run(
 9  lexer: lexer.Lexer(String, Nil),
10  on input: String,
11) -> List(Token(String)) {
12  let assert Ok(tokens) = lexer.run(input, lexer)
13
14  // Nibble's lexer prepends an empty string to the quasi_lexer's
15  // otherwise acceptable output. After dropping it, we need to decrement
16  // column values on the first row since the empty token advanced the column counter
17  tokens
18  |> list.drop(1)
19}