nolanderc / glsl_analyzer

Language server for GLSL (autocomplete, goto-definition, formatter, and more)
GNU General Public License v3.0
156 stars 3 forks source link

Resolve parser defects #15

Closed automaticp closed 9 months ago

automaticp commented 9 months ago

I'll be dumping snippets that confuse/crash the parser here.

Here's a first couple (v1.1.0):

#version 330 core

out Interface {
    vec4 frag_pos;
} out_block;

void main() {
    out_block.frag_pos = gl_in[0].gl_Position; // <- expected ;
}
#version 330 core
void main() {
    if (true) { discard; } // <- expected }
}
automaticp commented 9 months ago

The first one seems to be confusing .f as a floating point number.

The second one is unclear, but the parser does not recover well after it and spits out errors in the rest of the file if there's more code. All is fine without the braces though:

if (true) discard; // fine
nolanderc commented 9 months ago

Thank you for taking the time to report these!

The above snippets should be solved in #19 and #20 and released in v1.1.2.

I'm going to close this issue, if you find any more cases, just open a new issue! :-)