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

Function lex_fstring_error

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

Source from the content-addressed store, hash-verified

2595 }
2596
2597 fn lex_fstring_error(source: &str) -> InterpolatedStringErrorType {
2598 let output = lex(source, Mode::Module, TextSize::default());
2599 match output
2600 .errors
2601 .into_iter()
2602 .next()
2603 .expect("lexer should give at least one error")
2604 .into_error()
2605 {
2606 LexicalErrorType::FStringError(error) => error,
2607 err => panic!("Expected FStringError: {err:?}"),
2608 }
2609 }
2610
2611 #[test]
2612 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