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

Function lex_fstring_error

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

Source from the content-addressed store, hash-verified

2580 }
2581
2582 fn lex_fstring_error(source: &str) -> InterpolatedStringErrorType {
2583 let output = lex(source, Mode::Module, TextSize::default());
2584 match output
2585 .errors
2586 .into_iter()
2587 .next()
2588 .expect("lexer should give at least one error")
2589 .into_error()
2590 {
2591 LexicalErrorType::FStringError(error) => error,
2592 err => panic!("Expected FStringError: {err:?}"),
2593 }
2594 }
2595
2596 #[test]
2597 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