KhronosGroup / glslang

Khronos-reference front end for GLSL/ESSL, partial front end for HLSL, and a SPIR-V generator.
Other
2.9k stars 816 forks source link

Report statement errors #3559

Open phr34k opened 3 months ago

phr34k commented 3 months ago

Initial changes to improve error reporting in combination with preprocessor directives. The intent of this changeset is the modify glslang in a way it reports location where the statement origionally begin, so that any syntax errors can report that location primarilly and/or report the type of statement.

All unit tests passed locally

This changeset modifies the glslang in the following ways:

Example

#line 200 
layout( .... ) fragColor1
#line 500 
layout( .... ) fragColor2:

See https://github.com/KhronosGroup/glslang/issues/3544

CLAassistant commented 3 months ago

CLA assistant check
All committers have signed the CLA.

arcady-lunarg commented 3 months ago

This looks interesting, but it's going to take a little while for me to give this a proper review.

phr34k commented 3 months ago

Sounds good, surely there are some corner cases that can have been easy to miss, but I hope it's a small step in the right direction!