summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorptmcg <ptmcg@austin.rr.com>2021-08-01 22:42:22 -0500
committerptmcg <ptmcg@austin.rr.com>2021-08-01 22:42:22 -0500
commit918aa07f41bd3a619a45dc28da0048585216469b (patch)
tree63ee815bea86c742b8d9ae2a7bea89e2e5235b28
parenta636603f1242055eaddec8ba27fc16cc50924b3e (diff)
downloadpyparsing-git-918aa07f41bd3a619a45dc28da0048585216469b.tar.gz
Successful rename in results.py with module level and class level names
-rw-r--r--pyparsing/results.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/pyparsing/results.py b/pyparsing/results.py
index fb636c0..f770d49 100644
--- a/pyparsing/results.py
+++ b/pyparsing/results.py
@@ -474,7 +474,7 @@ class ParseResults:
out.append(str(item))
return out
- def asList(self):
+ def as_list(self):
"""
Returns the parse results as a nested list of matching tokens, all converted to strings.
@@ -494,7 +494,7 @@ class ParseResults:
for res in self._toklist
]
- def asDict(self):
+ def as_dict(self):
"""
Returns the named parse results as a nested dictionary.
@@ -534,7 +534,7 @@ class ParseResults:
ret._name = self._name
return ret
- def getName(self):
+ def get_name(self):
r"""
Returns the results name for this token expression. Useful when several
different expressions might match at a particular location.
@@ -575,7 +575,7 @@ class ParseResults:
None,
)
- return find_in_parent(self) if par else None
+ return find_in_parent(name) if par else None
elif (
len(self) == 1
and len(self._tokdict) == 1
@@ -744,6 +744,10 @@ class ParseResults:
ret = cls([ret], name=name)
return ret
+ asList = as_list
+ asDict = as_dict
+ getName = get_name
+
MutableMapping.register(ParseResults)
MutableSequence.register(ParseResults)