(source: &str, mode: Mode, start_offset: TextSize)
| 1748 | } |
| 1749 | |
| 1750 | fn lex_valid(source: &str, mode: Mode, start_offset: TextSize) -> LexerOutput { |
| 1751 | let output = lex(source, mode, start_offset); |
| 1752 | |
| 1753 | if !output.errors.is_empty() { |
| 1754 | let mut message = "Unexpected lexical errors for a valid source:\n".to_string(); |
| 1755 | for error in &output.errors { |
| 1756 | writeln!(&mut message, "{error:?}").unwrap(); |
| 1757 | } |
| 1758 | writeln!(&mut message, "Source:\n{source}").unwrap(); |
| 1759 | panic!("{message}"); |
| 1760 | } |
| 1761 | |
| 1762 | output |
| 1763 | } |
| 1764 | |
| 1765 | fn lex_invalid(source: &str, mode: Mode) -> LexerOutput { |
| 1766 | let output = lex(source, mode, TextSize::default()); |
no test coverage detected