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

Getting extraneous syntax error in .glsl file when using for loop #24

Open
jayandor opened this issue Sep 19, 2024 · 0 comments
Open

Getting extraneous syntax error in .glsl file when using for loop #24

jayandor opened this issue Sep 19, 2024 · 0 comments

Comments

@jayandor
Copy link

vscode extension version: 0.0.2
glsl-lsp version: 0.0.2
OS: Windows_NT x64 10.0.22631

The extension is reporting a syntax error whenever I create a version 450 GLSL file and use a basic for loop in it. For example, I can create the following file:

#version 450

void doStuff(void) {
    for (int i = 0; i < 10; i++) {
        // Nothing
    }
}

And it will give me two syntax errors. One highlights the closing parenthesis on the for loop, saying "Syntax error: expected a semi-colon ; after the expression", and the second highlights the closing curly brace at the end of the doStuff() function definition, saying "Syntax error: expected a closing brace '}'".

The syntax error does disappear if I add a third semicolon after the increment expression, making it for (int i = 0; i < 10; i++;) {, but I've never seen a construction like that, and if I try to compile the compilation fails there.

I'm not incredibly experienced with GLSL yet, but a lot of Googling didn't show any reason such a basic for loop construction wouldn't work, and perhaps more importantly, the code does compile and run just fine, so it seems to be an extraneous error from the parser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant