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

Report statement errors #3559

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

phr34k
Copy link

@phr34k phr34k commented Mar 27, 2024

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:

  • modified the standalone glslang to include --report-statements feature toggle to enable functionallity optionally
  • modified the function signature of parseHelper::parserError to add in the location
  • modified the grammar to use bison custom syntax error reporter
  • modified the parserContext to keep track of some extra meta data w.r.t. statement and scope boundaries
  • modified the grammar to track the statement/scope boundaries either trough bison "subroutines" or mid-action rules

Example

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

See #3544

@CLAassistant
Copy link

CLAassistant commented Mar 27, 2024

CLA assistant check
All committers have signed the CLA.

@arcady-lunarg
Copy link
Contributor

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

@phr34k
Copy link
Author

phr34k commented Mar 29, 2024

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!

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.

None yet

3 participants