Skip to content

Navigation Menu

Sign in
Sign up

fix(highlights): match constants with digits and leading underscores - #327

Open
dwo wants to merge 1 commit into
tree-sitter:master from
dwo:fix/constant-highlights
Open

fix(highlights): match constants with digits and leading underscores #327
dwo wants to merge 1 commit into
tree-sitter:master from
dwo:fix/constant-highlights

Conversation

@dwo

@dwo dwo commented Jan 30, 2026

Copy link
Copy Markdown

The constant highlight regex ^[A-Z][A-Z_]*$ did not allow digits or leading underscores, so identifiers like HTTP2, SHA256, _PRIVATE and __MAX_RETRIES were not highlighted as constants despite following PEP 8 naming conventions.

Updated the regex to ^_*[A-Z][A-Z_0-9]*$ and added highlight tests for identifier naming conventions.

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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /