MCPcopy Create free account
hub / github.com/astral-sh/ruff / lex_tstring_error

Function lex_tstring_error

crates/ruff_python_parser/src/lexer.rs:2641–2653  ·  view source on GitHub ↗
(source: &str)

Source from the content-addressed store, hash-verified

2639 }
2640
2641 fn lex_tstring_error(source: &str) -> InterpolatedStringErrorType {
2642 let output = lex(source, Mode::Module, TextSize::default());
2643 match output
2644 .errors
2645 .into_iter()
2646 .next()
2647 .expect("lexer should give at least one error")
2648 .into_error()
2649 {
2650 LexicalErrorType::TStringError(error) => error,
2651 err => panic!("Expected TStringError: {err:?}"),
2652 }
2653 }
2654
2655 #[test]
2656 fn lex_fstring_unclosed() {

Callers

nothing calls this directly

Calls 6

lexFunction · 0.85
expectMethod · 0.80
defaultFunction · 0.50
into_errorMethod · 0.45
nextMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected