Sync interpolated lexer state within re_lex_logical_token

This commit is contained in:
Micha Reiser
2025-12-10 17:16:28 +01:00
parent 7d47f711c1
commit c4e32ea180
3 changed files with 35 additions and 27 deletions

View File

@@ -145,6 +145,28 @@ Module(
simple: false,
},
),
ClassDef(
StmtClassDef {
node_index: NodeIndex(None),
range: 94..111,
decorator_list: [],
name: Identifier {
id: Name("A"),
range: 100..101,
node_index: NodeIndex(None),
},
type_params: None,
arguments: None,
body: [
Pass(
StmtPass {
node_index: NodeIndex(None),
range: 107..111,
},
),
],
},
),
],
},
)
@@ -189,17 +211,6 @@ Module(
|
|
1 | # Regression test for https://github.com/astral-sh/ty/issues/1828
2 | (c: int = 1,f"""{d=[
3 | def a(
| _______^
4 | | class A:
5 | | pass
| |_________^ Syntax Error: f-string: unterminated triple-quoted string
|
|
2 | (c: int = 1,f"""{d=[
3 | def a(
@@ -209,17 +220,6 @@ Module(
|
|
1 | # Regression test for https://github.com/astral-sh/ty/issues/1828
2 | (c: int = 1,f"""{d=[
3 | def a(
| _______^
4 | | class A:
5 | | pass
| |_________^ Syntax Error: Expected a statement
|
|
4 | class A:
5 | pass