From 6c98d20bd25fb34af629847c94f3283c28d1a4ab Mon Sep 17 00:00:00 2001 From: ptmcg Date: Sun, 7 Oct 2018 13:04:41 -0500 Subject: Fix Issue #22, test for returning given parse results from a parse action; convert pyparsing.xxx references to pp.xxx references in unitTests.py --- pyparsing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pyparsing.py') 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)), -- cgit v1.2.1