-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow multi-line f-string with format spec
- Loading branch information
1 parent
37d21c0
commit 68f3d35
Showing
2 changed files
with
139 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 120 additions & 0 deletions
120
...r/src/snapshots/ruff_python_parser__lexer__tests__fstring_with_multiline_format_spec.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
--- | ||
source: crates/ruff_python_parser/src/lexer.rs | ||
expression: lex_source(source) | ||
--- | ||
[ | ||
( | ||
FStringStart, | ||
0..4, | ||
), | ||
( | ||
FStringMiddle { | ||
value: "__", | ||
is_raw: false, | ||
}, | ||
4..6, | ||
), | ||
( | ||
Lbrace, | ||
6..7, | ||
), | ||
( | ||
NonLogicalNewline, | ||
7..8, | ||
), | ||
( | ||
Name { | ||
name: "x", | ||
}, | ||
12..13, | ||
), | ||
( | ||
Colon, | ||
13..14, | ||
), | ||
( | ||
FStringMiddle { | ||
value: "d", | ||
is_raw: false, | ||
}, | ||
14..15, | ||
), | ||
( | ||
NonLogicalNewline, | ||
15..16, | ||
), | ||
( | ||
Rbrace, | ||
16..17, | ||
), | ||
( | ||
FStringMiddle { | ||
value: "__", | ||
is_raw: false, | ||
}, | ||
17..19, | ||
), | ||
( | ||
FStringEnd, | ||
19..22, | ||
), | ||
( | ||
FStringStart, | ||
23..25, | ||
), | ||
( | ||
FStringMiddle { | ||
value: "__", | ||
is_raw: false, | ||
}, | ||
25..27, | ||
), | ||
( | ||
Lbrace, | ||
27..28, | ||
), | ||
( | ||
NonLogicalNewline, | ||
28..29, | ||
), | ||
( | ||
Name { | ||
name: "x", | ||
}, | ||
33..34, | ||
), | ||
( | ||
Colon, | ||
34..35, | ||
), | ||
( | ||
FStringMiddle { | ||
value: "d", | ||
is_raw: false, | ||
}, | ||
35..36, | ||
), | ||
( | ||
NonLogicalNewline, | ||
36..37, | ||
), | ||
( | ||
Rbrace, | ||
37..38, | ||
), | ||
( | ||
FStringMiddle { | ||
value: "__", | ||
is_raw: false, | ||
}, | ||
38..40, | ||
), | ||
( | ||
FStringEnd, | ||
40..41, | ||
), | ||
( | ||
Newline, | ||
41..41, | ||
), | ||
] |