diff options
Diffstat (limited to 'Tools/c-analyzer/cpython/_parser.py')
-rw-r--r-- | Tools/c-analyzer/cpython/_parser.py | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/Tools/c-analyzer/cpython/_parser.py b/Tools/c-analyzer/cpython/_parser.py index eef7584..ef06a9f 100644 --- a/Tools/c-analyzer/cpython/_parser.py +++ b/Tools/c-analyzer/cpython/_parser.py @@ -1,7 +1,6 @@ import os.path import re -from c_common.fsutil import expand_filenames, iter_files_by_suffix from c_parser.preprocessor import ( get_preprocessor as _get_preprocessor, ) @@ -9,7 +8,7 @@ from c_parser import ( parse_file as _parse_file, parse_files as _parse_files, ) -from . import REPO_ROOT, INCLUDE_DIRS, SOURCE_DIRS +from . import REPO_ROOT GLOB_ALL = '**/*' @@ -43,19 +42,6 @@ def clean_lines(text): @end=sh@ ''' -GLOBS = [ - 'Include/*.h', - 'Include/internal/*.h', - 'Modules/**/*.h', - 'Modules/**/*.c', - 'Objects/**/*.h', - 'Objects/**/*.c', - 'Python/**/*.h', - 'Parser/**/*.c', - 'Python/**/*.h', - 'Parser/**/*.c', -] - EXCLUDED = clean_lines(''' # @begin=conf@ @@ -280,26 +266,6 @@ SAME = [ ] -def resolve_filename(filename): - orig = filename - filename = os.path.normcase(os.path.normpath(filename)) - if os.path.isabs(filename): - if os.path.relpath(filename, REPO_ROOT).startswith('.'): - raise Exception(f'{orig!r} is outside the repo ({REPO_ROOT})') - return filename - else: - return os.path.join(REPO_ROOT, filename) - - -def iter_filenames(*, search=False): - if search: - yield from iter_files_by_suffix(INCLUDE_DIRS, ('.h',)) - yield from iter_files_by_suffix(SOURCE_DIRS, ('.c',)) - else: - globs = (os.path.join(REPO_ROOT, file) for file in GLOBS) - yield from expand_filenames(globs) - - def get_preprocessor(*, file_macros=None, file_incldirs=None, |