Skip to content
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

Fix GLSL and HLSL preprocessor directive start #2357

Merged
merged 1 commit into from Feb 26, 2023

Conversation

bitsawer
Copy link
Contributor

Currently, both shader language lexers require that when parsing preprocessor directives # is the first character on a line. This PR loosens the restriction as these should all be valid directives:

#define NORMAL 1
#    define VALUE 10
    #define MORE 20
    #    define ANOTHER 30

This also allows putting line numbers, non-breaking spaces etc. in certain code snippets:

10. #ifdef VALUE
11. ...
12. #endif

@Anteru Anteru added A-lexing area: changes to individual lexers changelog-update Items which need to get mentioned in the changelog labels Feb 26, 2023
@Anteru Anteru merged commit 875b858 into pygments:master Feb 26, 2023
@Anteru
Copy link
Collaborator

Anteru commented Feb 26, 2023

Merged, thanks for the contribution!

@Anteru Anteru removed the changelog-update Items which need to get mentioned in the changelog label Mar 25, 2023
@Anteru Anteru added this to the 2.15.0 milestone Mar 25, 2023
@bitsawer bitsawer deleted the shader_lang_preprocessor_changes branch May 29, 2023 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lexing area: changes to individual lexers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants