Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix ShaderLab parsing of whitespace and invalid parameters in variable references #357

Merged
merged 9 commits into from
Feb 7, 2018

Conversation

citizenmatt
Copy link
Member

Fixes #257. Allows parsing a variable reference with trailing whitespace.

Also handles the scenario where someone incorrectly adds parameters to a reference (e.g. BlendOp [_Op(foo, whatever) ]). It will highlight the invalid parameters with a warning and provides a quick fix to delete them. I'd prefer it to be a syntax error, but the shader compiler doesn't treat it as an error, but silently ignores it (and seems to silently break the variable reference, using a default value, too, although I need to recheck this).

This PR includes a small bit of housekeeping - fixed some obsolete warnings, etc. Also refactored the ShaderLab custom highlights to be defined in XML, rather than hand written.

@citizenmatt citizenmatt added this to the Rider 2018.1 milestone Feb 7, 2018
@citizenmatt citizenmatt self-assigned this Feb 7, 2018
@citizenmatt citizenmatt merged commit 25c077d into master Feb 7, 2018
@citizenmatt citizenmatt deleted the bugfix/shaderlab-syntax-257 branch February 7, 2018 23:08
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant