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

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

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


  |
1 | f"{"
  |      Syntax Error: f-string: unterminated string
2 | f"{foo!r"
3 | f"{foo="
  |


  |
1 | f"{"
  |      Syntax Error: f-string: unterminated string
2 | f"{foo!r"
3 | f"{foo="
  |


  |
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: f-string: unterminated string
3 | f"{foo="
4 | f"{"
  |


  |
1 | f"{"
2 | f"{foo!r"
  |           Syntax Error: f-string: unterminated string
3 | f"{foo="
4 | 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"
  |           Syntax Error: Expected FStringEnd, found Unknown
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: unterminated string
4 | f"{"
5 | f"""{"""
  |


  |
1 | f"{"
2 | f"{foo!r"
3 | f"{foo="
  |          Syntax Error: f-string: unterminated string
4 | f"{"
5 | f"""{"""
  |


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


  |
3 | f"{foo="
4 | f"{"
5 | f"""{"""
  | ^^^^ Syntax Error: Expected FStringEnd, found FStringStart
  |


  |
3 | f"{foo="
4 | f"{"
5 | f"""{"""
  |      ^^^ Syntax Error: Expected an expression
  |


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


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