mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-36876: Small adjustments to the C-analyzer tool. (GH-23045)
This is a little bit of clean-up, small fixes, and additional helpers prior to building an updated & accurate list of globals to eliminate.
This commit is contained in:
parent
b9ee4af4c6
commit
4fe72090de
16 changed files with 632 additions and 217 deletions
|
@ -1,3 +1,5 @@
|
|||
import re
|
||||
|
||||
from ..info import KIND, ParsedItem, FileInfo
|
||||
|
||||
|
||||
|
@ -121,6 +123,19 @@ class SourceInfo:
|
|||
def done(self):
|
||||
self._set_ready()
|
||||
|
||||
def too_much(self, maxtext, maxlines):
|
||||
if maxtext and len(self.text) > maxtext:
|
||||
pass
|
||||
elif maxlines and self.end - self.start > maxlines:
|
||||
pass
|
||||
else:
|
||||
return False
|
||||
|
||||
#if re.fullmatch(r'[^;]+\[\][ ]*=[ ]*[{]([ ]*\d+,)*([ ]*\d+,?)\s*',
|
||||
# self._current.text):
|
||||
# return False
|
||||
return True
|
||||
|
||||
def _set_ready(self):
|
||||
if self._current is None:
|
||||
self._ready = False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue