(source: &str, mode: Mode, start_offset: TextSize)
| 1674 | |
| 1675 | #[track_caller] |
| 1676 | fn lex_valid(source: &str, mode: Mode, start_offset: TextSize) -> LexerOutput { |
| 1677 | let output = lex(source, mode, start_offset); |
| 1678 | |
| 1679 | if !output.errors.is_empty() { |
| 1680 | let mut message = "Unexpected lexical errors for a valid source:\n".to_string(); |
| 1681 | for error in &output.errors { |
| 1682 | writeln!(&mut message, "{error:?}").unwrap(); |
| 1683 | } |
| 1684 | writeln!(&mut message, "Source:\n{source}").unwrap(); |
| 1685 | panic!("{message}"); |
| 1686 | } |
| 1687 | |
| 1688 | output |
| 1689 | } |
| 1690 | |
| 1691 | #[track_caller] |
| 1692 | fn lex_invalid(source: &str, mode: Mode) -> LexerOutput { |
no test coverage detected