Skip to content

GH-92266: Remove embedded tabs from c-analyzer/cpython/_parser.py #137622

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AA-Turner
Copy link
Member

@AA-Turner AA-Turner commented Aug 10, 2025

This is an attempt to avoid some of the problems we've seen with embedded tabs by changing the global variables within c-analyzer/cpython/_parser.py to use more structured data.

The output is identical, save for INCL_DIRS, where the fourth line (* ./Include/internal/mimalloc) currently uses spaces instead of tabs, showing that the current format is quite hard to properly keep up to date. The errant line was added in #109914.

What do you think @ericsnowcurrently?

See also:


# others
('Modules/_sre/sre_lib.h', 'LOCAL(type)', 'static inline type'),
('Modules/_sre/sre_lib.h', 'SRE(F)', 'sre_ucs2_'), ##F
Copy link
Member Author

@AA-Turner AA-Turner Aug 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This produces identical output to the current state, due to parsing ##F as a comment, but I think the line should probably read:

Suggested change
('Modules/_sre/sre_lib.h', 'SRE(F)', 'sre_ucs2_'), ##F
('Modules/_sre/sre_lib.h', 'SRE(F)', 'sre_ucs2_##F'),

# @end=conf@
''')
EXCLUDED = format_table_lines([
# OSX
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If updating other things:

Suggested change
# OSX
# macOS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant