hadronized / glsl

GLSL parser for Rust
190 stars 28 forks source link

Replace non-standard #elseif preprocessor directive by #elif #150

Closed AlexTMjugador closed 7 months ago

AlexTMjugador commented 3 years ago

According to The OpenGL Shading Language 4.5 specification, § 3.3, page 13, #elif is the standards-compliant and recognized way to write an "else if" preprocessor directive, instead of the #elseif that is currently parsed.

This non-conformance leads to standards-compliant shaders that use the affected preprocessor directive to not be able to be parsed, which is a bad thing.

Fix the situation by accepting #elif instead of #elseif, and rename identifiers appropriately. Broken shaders that use the non-conforming #elseif should be changed anyway.