Skip to content

Commit

Permalink
Added fstring test case and potential fix. (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric-Vin authored Nov 1, 2023
1 parent 139caa3 commit 6d4b7f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion data/python.gram
Original file line number Diff line number Diff line change
Expand Up @@ -1696,7 +1696,7 @@ fstring_full_format_spec:
)
}
fstring_format_spec:
| t=FSTRING_MIDDLE { ast.Constant(value=t.string.encode(), LOCATIONS) }
| t=FSTRING_MIDDLE { ast.Constant(value=t.string, LOCATIONS) }
| fstring_replacement_field
fstring:
| a=FSTRING_START b=fstring_mid* c=FSTRING_END {
Expand Down
5 changes: 4 additions & 1 deletion tests/python_parser/data/fstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,7 @@



f'{expr:}'
f'{expr:}'

foo = 3.14159
verbosePrint(f'Foo {foo:.3} bar.')

0 comments on commit 6d4b7f2

Please sign in to comment.