diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2014-06-16 23:00:54 (GMT) |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2014-06-16 23:00:54 (GMT) |
commit | 7c5318f58346c0f8f45b60c88410f64d954d36b5 (patch) | |
tree | b5754226aa4b0460f6cda611e10061f53723f908 /Lib/idlelib/HyperParser.py | |
parent | 487a143c580c9b12a936ed8cd31d6979c9d411e1 (diff) | |
download | cpython-7c5318f58346c0f8f45b60c88410f64d954d36b5.zip cpython-7c5318f58346c0f8f45b60c88410f64d954d36b5.tar.gz cpython-7c5318f58346c0f8f45b60c88410f64d954d36b5.tar.bz2 |
Issue #21686: add unittest for idlelib.HyperParser. Original patch by Saimadhav
Heblikar.
Diffstat (limited to 'Lib/idlelib/HyperParser.py')
-rw-r--r-- | Lib/idlelib/HyperParser.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Lib/idlelib/HyperParser.py b/Lib/idlelib/HyperParser.py index bd92807..5816d00 100644 --- a/Lib/idlelib/HyperParser.py +++ b/Lib/idlelib/HyperParser.py @@ -1,4 +1,4 @@ -"""Provide advanced parsing abilities for the ParenMatch and other extensions. +"""Provide advanced parsing abilities for ParenMatch and other extensions. HyperParser uses PyParser. PyParser mostly gives information on the proper indentation of code. HyperParser gives additional information on @@ -88,7 +88,7 @@ class HyperParser: self.indexbracket += 1 def is_in_string(self): - """Is the index given to the HyperParser is in a string?""" + """Is the index given to the HyperParser in a string?""" # The bracket to which we belong should be an opener. # If it's an opener, it has to have a character. return (self.isopener[self.indexbracket] and @@ -96,7 +96,7 @@ class HyperParser: in ('"', "'")) def is_in_code(self): - """Is the index given to the HyperParser is in a normal code?""" + """Is the index given to the HyperParser in normal code?""" return (not self.isopener[self.indexbracket] or self.rawtext[self.bracketing[self.indexbracket][0]] not in ('#', '"', "'")) @@ -248,3 +248,8 @@ class HyperParser: break return rawtext[last_identifier_pos:self.indexinrawtext] + + +if __name__ == '__main__': + import unittest + unittest.main('idlelib.idle_test.test_hyperparser', verbosity=2) |