Skip to content

Vala: recognize conditional compilation directives - #3207

Merged
birkenfeld merged 1 commit into
pygments:masterfrom
Sanjays2402:fix/vala-preprocessor-directives
Jul 14, 2026
Merged

Vala: recognize conditional compilation directives#3207
birkenfeld merged 1 commit into
pygments:masterfrom
Sanjays2402:fix/vala-preprocessor-directives

Conversation

@Sanjays2402

Copy link
Copy Markdown
Contributor

The Vala lexer only special-cased #if 0, so valid #if, #elif, #else, and #endif lines emitted Error tokens for #. This recognizes those lines as preprocessor directives and adds a golden regression snippet based on the report.

Fixes #2858.

The lexer only handled the special `#if 0` case, so valid `#if`, `#elif`,
`#else`, and `#endif` lines emitted Error tokens for their hash marks.
Recognize complete conditional-directive lines as preprocessor comments and
add a golden regression snippet based on the report.

Fixes pygments#2858
@birkenfeld
birkenfeld merged commit 8c7866d into pygments:master Jul 14, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vala: error on #if macros

2 participants