From 07f4d4dd27a859c16397fbb2c4d3bb5dde79d323 Mon Sep 17 00:00:00 2001 From: Paul McGuire Date: Wed, 5 Jun 2019 22:34:45 -0500 Subject: Add better help directing to ParseResults as the return type for ParserElement.parseString --- .idea/misc.xml | 2 +- .idea/pyparsing.iml | 3 ++- pyparsing.py | 8 +++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 4225ef2..6c993b7 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/.idea/pyparsing.iml b/.idea/pyparsing.iml index 0fbf55e..5f2f3dc 100644 --- a/.idea/pyparsing.iml +++ b/.idea/pyparsing.iml @@ -7,8 +7,9 @@ + - + diff --git a/pyparsing.py b/pyparsing.py index b0f391e..2a20daa 100644 --- a/pyparsing.py +++ b/pyparsing.py @@ -87,6 +87,8 @@ classes inherit from. Use the docstrings for examples of how to: more complex ones - associate names with your parsed results using :class:`ParserElement.setResultsName` + - access the parsed data, which is returned as a :class:`ParseResults` + object - find some helpful expression short-cuts like :class:`delimitedList` and :class:`oneOf` - find more useful common expressions in the :class:`pyparsing_common` @@ -94,7 +96,7 @@ classes inherit from. Use the docstrings for examples of how to: """ __version__ = "2.4.1" -__versionTime__ = "26 May 2019 14:04 UTC" +__versionTime__ = "06 Jun 2019 03:33 UTC" __author__ = "Paul McGuire " import string @@ -1783,6 +1785,10 @@ class ParserElement(object): This is the main interface to the client code, once the complete expression has been built. + Returns the parsed data as a :class:`ParseResults` object, which may be + accessed as a list, or as a dict or object with attributes if the given parser + includes results names. + If you want the grammar to require that the entire input string be successfully parsed, then set ``parseAll`` to True (equivalent to ending the grammar with ``StringEnd()``). -- cgit v1.2.1