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

Function lex_tstring_error

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

Source from the content-addressed store, hash-verified

2624 }
2625
2626 fn lex_tstring_error(source: &str) -> InterpolatedStringErrorType {
2627 let output = lex(source, Mode::Module, TextSize::default());
2628 match output
2629 .errors
2630 .into_iter()
2631 .next()
2632 .expect("lexer should give at least one error")
2633 .into_error()
2634 {
2635 LexicalErrorType::TStringError(error) => error,
2636 err => panic!("Expected TStringError: {err:?}"),
2637 }
2638 }
2639
2640 #[test]
2641 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