Use strings as a non-terminal symbol in all grammars

This makes it easier to write the same logic for all Python versions
This commit is contained in:
Dave Halter
2018-04-05 09:55:19 +02:00
parent 7c7f4f4e54
commit a3e280c2b9
7 changed files with 22 additions and 6 deletions
+9
View File
@@ -262,6 +262,15 @@ class String(Literal):
return match.group(2)[:-len(match.group(1))]
class FStringString(Leaf):
"""
f-strings contain f-string expressions and normal python strings. These are
the string parts of f-strings.
"""
type = 'fstring_string'
__slots__ = ()
class _StringComparisonMixin(object):
def __eq__(self, other):
"""