diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2019-10-31 21:10:28 -0700 |
---|---|---|
committer | Paul McGuire <ptmcg@users.noreply.github.com> | 2019-10-31 23:10:28 -0500 |
commit | 53d1b4a6f48a53c4c4ec4ac7031362b691c0366d (patch) | |
tree | 088ad3cf3561b78a00af4fb2fd474f4a2b8ca70c /examples/indentedGrammarExample.py | |
parent | 41752aa52cc97c710474bb2972cceab057b52ad4 (diff) | |
download | pyparsing-git-53d1b4a6f48a53c4c4ec4ac7031362b691c0366d.tar.gz |
Blacken the project (#141)
Diffstat (limited to 'examples/indentedGrammarExample.py')
-rw-r--r-- | examples/indentedGrammarExample.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/indentedGrammarExample.py b/examples/indentedGrammarExample.py index 0133a9e..c761393 100644 --- a/examples/indentedGrammarExample.py +++ b/examples/indentedGrammarExample.py @@ -37,14 +37,16 @@ stmt = Forward() suite = indentedBlock(stmt, indentStack)
identifier = Word(alphas, alphanums)
-funcDecl = ("def" + identifier + Group( "(" + Optional( delimitedList(identifier) ) + ")" ) + ":")
-funcDef = Group( funcDecl + suite )
+funcDecl = (
+ "def" + identifier + Group("(" + Optional(delimitedList(identifier)) + ")") + ":"
+)
+funcDef = Group(funcDecl + suite)
rvalue = Forward()
funcCall = Group(identifier + "(" + Optional(delimitedList(rvalue)) + ")")
rvalue << (funcCall | identifier | Word(nums))
assignment = Group(identifier + "=" + rvalue)
-stmt << ( funcDef | assignment | identifier )
+stmt << (funcDef | assignment | identifier)
module_body = OneOrMore(stmt)
|