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 2: tests from glslang #21

Closed automaticp closed 9 months ago

automaticp commented 9 months ago

Ran v1.1.2 through a handpicked subset of tests for glslang. Picked out the files that are:

Don't have time right now to condense to snippets and minimal repros, but I have this output that points to the problematic files:

FAILED(001): comment.frag:11:7: expected ;
FAILED(002): constantUnaryConversion.comp:26:5: expected ,
FAILED(003): constFoldIntMin.frag:6:23: expected ,
FAILED(004): decls.frag:41:17: expected )
FAILED(005): numeral.frag:78:20: expected ,
FAILED(006): preprocessor.edge_cases.vert:3:17: expected a declaration
FAILED(007): preprocessor.function_macro.vert:9:26: expected ;
FAILED(008): stringToDouble.vert:110:36: expected ,
FAILED(009): tokenPaste.vert:18:14: expected ;

FAILED 9 out of 161 files.

Just look for the files with the same names at the link above, the line:column points to the first error occurrence.

Overall pretty clean, mostly newline escapes and (004) are relevant.

automaticp commented 9 months ago

Also should these files be pulled into the samples/ for future regression tests, etc.?

automaticp commented 9 months ago

Actually cannot figure out the license for the test glsl code in glslang. Uh...

nolanderc commented 9 months ago

Oh wow! Nice work!

There will certainly be some issues relates to macros as we don’t expand them, so unless they look like regular function calls/identifiers stuff will go wrong.

Newline escapes is also something I have mostly ignored since it’s rarely used, but I guess macros is an obvious exception.

It would probably be nice to have these somewhere, so feel free to add them! So far I mostly use samples for interactive debugging, but having a more structured approach would be nice.

nolanderc commented 9 months ago

Actually cannot figure out the license for the test glsl code in glslang. Uh...

An alternative is just to extract a minimal example and commit that, it’s what I’ve done so far

automaticp commented 9 months ago

Alright, I'll try to figure something out over the weekend

nolanderc commented 9 months ago

Most of these are fixedin #31.

See #30 for the remaining issue surrounding macros (tokenPaste.vert).