diff options
author | ptmcg <ptmcg@austin.rr.com> | 2018-10-07 13:04:41 -0500 |
---|---|---|
committer | ptmcg <ptmcg@austin.rr.com> | 2018-10-07 13:04:41 -0500 |
commit | 6c98d20bd25fb34af629847c94f3283c28d1a4ab (patch) | |
tree | c02d49801d4ca61029b72f99cd4550e43c2d9933 /pyparsing.py | |
parent | 55bce0e4047a01417667803b86102560182de50d (diff) | |
download | pyparsing-git-6c98d20bd25fb34af629847c94f3283c28d1a4ab.tar.gz |
Fix Issue #22, test for returning given parse results from a parse action; convert pyparsing.xxx references to pp.xxx references in unitTests.py
Diffstat (limited to 'pyparsing.py')
-rw-r--r-- | pyparsing.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pyparsing.py b/pyparsing.py index b8609a9..a4a7546 100644 --- a/pyparsing.py +++ b/pyparsing.py @@ -1419,7 +1419,7 @@ class ParserElement(object): exc.__cause__ = parse_action_exc
raise exc
- if tokens is not None:
+ if tokens is not None and tokens is not retTokens:
retTokens = ParseResults( tokens,
self.resultsName,
asList=self.saveAsList and isinstance(tokens,(ParseResults,list)),
@@ -1438,7 +1438,7 @@ class ParserElement(object): exc.__cause__ = parse_action_exc
raise exc
- if tokens is not None:
+ if tokens is not None and tokens is not retTokens:
retTokens = ParseResults( tokens,
self.resultsName,
asList=self.saveAsList and isinstance(tokens,(ParseResults,list)),
|