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

Function lex_tstring_error

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

Source from the content-addressed store, hash-verified

2774 }
2775
2776 fn lex_tstring_error(source: &str) -> InterpolatedStringErrorType {
2777 let output = lex(source, Mode::Module, TextSize::default());
2778 match output
2779 .errors
2780 .into_iter()
2781 .next()
2782 .expect("lexer should give at least one error")
2783 .into_error()
2784 {
2785 LexicalErrorType::TStringError(error) => error,
2786 err => panic!("Expected TStringError: {err:?}"),
2787 }
2788 }
2789
2790 #[test]
2791 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