Add 'f-string: expressions nested too deeply' issue.

This commit is contained in:
Dave Halter
2017-08-26 11:10:04 +02:00
parent 7d4aa755a5
commit 296ecc6728
3 changed files with 28 additions and 11 deletions

View File

@@ -38,7 +38,8 @@ class TokenNamespace:
START_SYMBOL = 'fstring'
GRAMMAR = """
fstring: expression* ENDMARKER
expression: '{' PYTHON_EXPR [ '!' CONVERSION ] [ ':' expression* ] '}'
format_spec: ':' expression*
expression: '{' PYTHON_EXPR [ '!' CONVERSION ] [ format_spec ] '}'
"""
_prefix = r'((?:[^{}]+)*)'