bpo-32989: IDLE - fix bad editor call of pyparse method (GH-5968)

Fix comments and add tests for editor newline_and_indent_event method.
Remove unused None default for function parameter of pyparse find_good_parse_start method
and code triggered by that default.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
This commit is contained in:
Cheryl Sabella 2020-01-21 05:11:26 -05:00 committed by Terry Jan Reedy
parent 8698b34b68
commit ec64640a2c
6 changed files with 154 additions and 39 deletions

View file

@ -133,8 +133,7 @@ class Parser:
self.code = s
self.study_level = 0
def find_good_parse_start(self, is_char_in_string=None,
_synchre=_synchre):
def find_good_parse_start(self, is_char_in_string, _synchre=_synchre):
"""
Return index of a good place to begin parsing, as close to the
end of the string as possible. This will be the start of some
@ -149,10 +148,6 @@ class Parser:
"""
code, pos = self.code, None
if not is_char_in_string:
# no clue -- make the caller pass everything
return None
# Peek back from the end for a good place to start,
# but don't try too often; pos will be left None, or
# bumped to a legitimate synch point.