PP: Report an error when a # is not the first thing on a line

According to the GLSL spec
Each number sign (#) can be preceded in its line only by spaces or horizontal tabs.
It may also be followed by spaces and horizontal tabs, preceding the directive.
This commit is contained in:
“jimihe” 2023-11-23 14:19:58 +08:00 committed by arcady-lunarg
parent 530a6266b2
commit feb5437942
3 changed files with 34 additions and 5 deletions

View file

@ -1,7 +1,8 @@
cppBad4.vert
ERROR: 0:2: '#' : (#) can be preceded in its line only by spaces or horizontal tabs
ERROR: 0:4: 'macro expansion' : unexpected '#' g
ERROR: 0:5: '' : syntax error, unexpected SEMICOLON, expecting LEFT_PAREN
ERROR: 2 compilation errors. No code generated.
ERROR: 3 compilation errors. No code generated.
Shader version: 100