summaryrefslogtreecommitdiff
path: root/examples/pythonGrammarParser.py
diff options
context:
space:
mode:
authorHugo <hugovk@users.noreply.github.com>2018-08-21 15:40:38 +0300
committerHugo <hugovk@users.noreply.github.com>2018-08-21 15:40:38 +0300
commitc3dba1ed5f9be226044c7ffaf1cd47adcc7482f4 (patch)
tree2c0c45c153434d0c6b78c0d5e51448933f959fb8 /examples/pythonGrammarParser.py
parent444859662f1829f2d8068fb33cdc375427bf9b6c (diff)
downloadpyparsing-git-c3dba1ed5f9be226044c7ffaf1cd47adcc7482f4.tar.gz
Upgrade Python syntax with pyupgrade
Diffstat (limited to 'examples/pythonGrammarParser.py')
-rw-r--r--examples/pythonGrammarParser.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/pythonGrammarParser.py b/examples/pythonGrammarParser.py
index f199917..706f758 100644
--- a/examples/pythonGrammarParser.py
+++ b/examples/pythonGrammarParser.py
@@ -137,7 +137,7 @@ class SemanticGroup(object):
self.contents = self.contents[:-1] + self.contents[-1].contents
def __str__(self):
- return "%s(%s)" % (self.label,
+ return "{}({})".format(self.label,
" ".join([isinstance(c,str) and c or str(c) for c in self.contents]) )
class OrList(SemanticGroup):
@@ -164,7 +164,7 @@ class Atom(SemanticGroup):
self.contents = contents[0]
def __str__(self):
- return "%s%s" % (self.rep, self.contents)
+ return "{}{}".format(self.rep, self.contents)
def makeGroupObject(cls):
def groupAction(s,l,t):