summaryrefslogtreecommitdiff
path: root/pyparsing/core.py
diff options
context:
space:
mode:
authorptmcg <ptmcg@austin.rr.com>2021-10-01 23:43:58 -0500
committerptmcg <ptmcg@austin.rr.com>2021-10-01 23:43:58 -0500
commitbda854c3a3b58ddc113983ad6869e23179835bee (patch)
tree15db3aac4aa5125b8540118bf224b141b964831a /pyparsing/core.py
parent04d0cc72a5425055f77e7b321ccac96b851bd95a (diff)
downloadpyparsing-git-bda854c3a3b58ddc113983ad6869e23179835bee.tar.gz
Fix docstring of set_debug_actions to reflect added cache_hit bool argument, and add type annotations
Diffstat (limited to 'pyparsing/core.py')
-rw-r--r--pyparsing/core.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/pyparsing/core.py b/pyparsing/core.py
index d48da1e..377ed24 100644
--- a/pyparsing/core.py
+++ b/pyparsing/core.py
@@ -1653,11 +1653,13 @@ class ParserElement(ABC):
Customize display of debugging messages while doing pattern matching::
- ``start_action`` - method to be called when an expression is about to be parsed;
- should have the signature ``fn(input_string, location, expression)``
+ should have the signature ``fn(input_string: str, location: int, expression: ParserElement, cache_hit: bool)``
+
- ``success_action`` - method to be called when an expression has successfully parsed;
- should have the signature ``fn(input_string, start_location, end_location, expression, parsed_tokens)``
+ should have the signature ``fn(input_string: str, start_location: int, end_location: int, expression: ParserELement, parsed_tokens: ParseResults, cache_hit: bool)``
+
- ``exception_action`` - method to be called when expression fails to parse;
- should have the signature ``fn(input_string, location, expression, exception)``
+ should have the signature ``fn(input_string: str, location: int, expression: ParserElement, exception: Exception, cache_hit: bool)``
"""
self.debugActions = (
start_action or _default_start_debug_action,