Lex chars to tokens until the end of the input
()
| 111 | |
| 112 | /// Lex chars to tokens until the end of the input |
| 113 | pub fn lexer<'a>() -> impl Parser<'a, ParserInput<'a>, Vec<Token>, ParserError<'a>> { |
| 114 | lex_token() |
| 115 | .repeated() |
| 116 | .collect() |
| 117 | .then_ignore(whitespace().or_not()) |
| 118 | } |
| 119 | |
| 120 | /// Lex chars to a single token |
| 121 | fn lex_token<'a>() -> impl Parser<'a, ParserInput<'a>, Token, ParserError<'a>> { |