Insert a start token so later stages can treat the start of a file like a newline
(tokens: Vec<Token>)
| 101 | |
| 102 | /// Insert a start token so later stages can treat the start of a file like a newline |
| 103 | fn insert_start(tokens: Vec<Token>) -> Vec<Token> { |
| 104 | std::iter::once(Token { |
| 105 | kind: TokenKind::Start, |
| 106 | span: 0..0, |
| 107 | }) |
| 108 | .chain(tokens) |
| 109 | .collect() |
| 110 | } |
| 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>> { |
no test coverage detected