(source: &str, mode: Mode, start_offset: TextSize)
| 1659 | |
| 1660 | #[track_caller] |
| 1661 | fn lex_valid(source: &str, mode: Mode, start_offset: TextSize) -> LexerOutput { |
| 1662 | let output = lex(source, mode, start_offset); |
| 1663 | |
| 1664 | if !output.errors.is_empty() { |
| 1665 | let mut message = "Unexpected lexical errors for a valid source:\n".to_string(); |
| 1666 | for error in &output.errors { |
| 1667 | writeln!(&mut message, "{error:?}").unwrap(); |
| 1668 | } |
| 1669 | writeln!(&mut message, "Source:\n{source}").unwrap(); |
| 1670 | panic!("{message}"); |
| 1671 | } |
| 1672 | |
| 1673 | output |
| 1674 | } |
| 1675 | |
| 1676 | #[track_caller] |
| 1677 | fn lex_invalid(source: &str, mode: Mode) -> LexerOutput { |
no test coverage detected