---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/inline/err/f_string_unclosed_lbrace.py
---
## AST

```
Module(
    ModModule {
        range: 0..38,
        body: [
            Expr(
                StmtExpr {
                    range: 0..38,
                    value: FString(
                        ExprFString {
                            range: 0..38,
                            value: FStringValue {
                                inner: Concatenated(
                                    [
                                        FString(
                                            FString {
                                                range: 0..5,
                                                elements: [
                                                    Expression(
                                                        FStringExpressionElement {
                                                            range: 2..3,
                                                            expression: Name(
                                                                ExprName {
                                                                    range: 3..3,
                                                                    id: "",
                                                                    ctx: Invalid,
                                                                },
                                                            ),
                                                            debug_text: None,
                                                            conversion: None,
                                                            format_spec: None,
                                                        },
                                                    ),
                                                ],
                                                flags: FStringFlags {
                                                    quote_style: Double,
                                                    prefix: Regular,
                                                    triple_quoted: false,
                                                },
                                            },
                                        ),
                                        FString(
                                            FString {
                                                range: 5..15,
                                                elements: [
                                                    Expression(
                                                        FStringExpressionElement {
                                                            range: 7..15,
                                                            expression: Name(
                                                                ExprName {
                                                                    range: 8..11,
                                                                    id: "foo",
                                                                    ctx: Load,
                                                                },
                                                            ),
                                                            debug_text: None,
                                                            conversion: None,
                                                            format_spec: None,
                                                        },
                                                    ),
                                                ],
                                                flags: FStringFlags {
                                                    quote_style: Double,
                                                    prefix: Regular,
                                                    triple_quoted: false,
                                                },
                                            },
                                        ),
                                        FString(
                                            FString {
                                                range: 15..24,
                                                elements: [
                                                    Expression(
                                                        FStringExpressionElement {
                                                            range: 17..22,
                                                            expression: Name(
                                                                ExprName {
                                                                    range: 18..21,
                                                                    id: "foo",
                                                                    ctx: Load,
                                                                },
                                                            ),
                                                            debug_text: Some(
                                                                DebugText {
                                                                    leading: "",
                                                                    trailing: "=",
                                                                },
                                                            ),
                                                            conversion: None,
                                                            format_spec: None,
                                                        },
                                                    ),
                                                ],
                                                flags: FStringFlags {
                                                    quote_style: Double,
                                                    prefix: Regular,
                                                    triple_quoted: false,
                                                },
                                            },
                                        ),
                                        FString(
                                            FString {
                                                range: 24..29,
                                                elements: [
                                                    Expression(
                                                        FStringExpressionElement {
                                                            range: 26..27,
                                                            expression: Name(
                                                                ExprName {
                                                                    range: 27..27,
                                                                    id: "",
                                                                    ctx: Invalid,
                                                                },
                                                            ),
                                                            debug_text: None,
                                                            conversion: None,
                                                            format_spec: None,
                                                        },
                                                    ),
                                                ],
                                                flags: FStringFlags {
                                                    quote_style: Double,
                                                    prefix: Regular,
                                                    triple_quoted: false,
                                                },
                                            },
                                        ),
                                        FString(
                                            FString {
                                                range: 29..38,
                                                elements: [
                                                    Expression(
                                                        FStringExpressionElement {
                                                            range: 33..34,
                                                            expression: Name(
                                                                ExprName {
                                                                    range: 34..34,
                                                                    id: "",
                                                                    ctx: Invalid,
                                                                },
                                                            ),
                                                            debug_text: None,
                                                            conversion: None,
                                                            format_spec: None,
                                                        },
                                                    ),
                                                ],
                                                flags: FStringFlags {
                                                    quote_style: Double,
                                                    prefix: Regular,
                                                    triple_quoted: true,
                                                },
                                            },
                                        ),
                                    ],
                                ),
                            },
                        },
                    ),
                },
            ),
        ],
    },
)
```
## Errors

  |
1 |   f"{"
  |  ____^
2 | | f"{foo!r"
  | |_^ Syntax Error: missing closing quote in string literal
3 |   f"{foo="
4 |   f"{"
  |


  |
1 | f"{"
2 | f"{foo!r"
  | ^^ Syntax Error: Expected an f-string element or the end of the f-string
3 | f"{foo="
4 | f"{"
  |


  |
1 |   f"{"
2 |   f"{foo!r"
  |  ________^
3 | | f"{foo="
  | |_^ Syntax Error: missing closing quote in string literal
4 |   f"{"
5 |   f"""{"""
  |


  |
1 | f"{"
2 | f"{foo!r"
3 | f"{foo="
  | ^^ Syntax Error: f-string: expecting '}'
4 | f"{"
5 | f"""{"""
  |


  |
1 |   f"{"
2 |   f"{foo!r"
3 |   f"{foo="
  |  ________^
4 | | f"{"
  | |_^ Syntax Error: missing closing quote in string literal
5 |   f"""{"""
  |


  |
2 | f"{foo!r"
3 | f"{foo="
4 | f"{"
  | ^^ Syntax Error: Expected an f-string element or the end of the f-string
5 | f"""{"""
  |


  |
2 |   f"{foo!r"
3 |   f"{foo="
4 |   f"{"
  |  ____^
5 | | f"""{"""
  | |_^ Syntax Error: missing closing quote in string literal
  |


  |
3 | f"{foo="
4 | f"{"
5 | f"""{"""
  | ^^^^ Syntax Error: Expected an f-string element or the end of the f-string
  |


  |
3 | f"{foo="
4 | f"{"
5 | f"""{"""
  |______^
  |


  |
4 | f"{"
5 | f"""{"""
  |


  |
4 | f"{"
5 | f"""{"""
  |


  |
4 | f"{"
5 | f"""{"""
  |


  |
4 | f"{"
5 | f"""{"""
  |


  |
4 | f"{"
5 | f"""{"""
  |


  |
4 | f"{"
5 | f"""{"""
  |
