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

Function lex_fstring_error

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

Source from the content-addressed store, hash-verified

2730 }
2731
2732 fn lex_fstring_error(source: &str) -> InterpolatedStringErrorType {
2733 let output = lex(source, Mode::Module, TextSize::default());
2734 match output
2735 .errors
2736 .into_iter()
2737 .next()
2738 .expect("lexer should give at least one error")
2739 .into_error()
2740 {
2741 LexicalErrorType::FStringError(error) => error,
2742 err => panic!("Expected FStringError: {err:?}"),
2743 }
2744 }
2745
2746 #[test]
2747 fn test_fstring_error() {

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