Cleanup a lot of details in the tokenizer for fstrings

This commit is contained in:
Dave Halter
2018-03-31 14:25:29 +02:00
parent 235fda3fbb
commit b1aa7c6a79
2 changed files with 44 additions and 24 deletions

View File

@@ -150,8 +150,8 @@ yield_expr: 'yield' [yield_arg]
yield_arg: 'from' test | testlist
strings: (STRING | fstring)+
fstring: FSTRING_START fstring_content FSTRING_END
fstring_content: (FSTRING_STRING | fstring_expr)*
fstring: FSTRING_START fstring_content* FSTRING_END
fstring_content: (FSTRING_STRING | fstring_expr)
fstring_conversion: '!' NAME
fstring_expr: '{' testlist [ fstring_conversion ] [ fstring_format_spec ] '}'
fstring_format_spec: ':' fstring_content
fstring_expr: '{' testlist [ fstring_conversion ] [ fstring_format_spec ] '}'
fstring_format_spec: ':' fstring_content*