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

Incorrect parsing behavior when function return types have precision qualifiers #478

Open
kpk47 opened this issue Jan 28, 2025 · 0 comments

Comments

@kpk47
Copy link

kpk47 commented Jan 28, 2025

The parser throws an error when given a function whose return type has a precision qualifier.

Input:

lowp float foo(lowp float bar) {
  return 1.0;
}

Error:

Parse error: Error in input: Ln: 1 Col: 6
lowp float foo(lowp float bar) {
     ^
Expecting: Type qualifier, ';' or 'layout'

Expected output:

lowp float f(lowp float f){return 1.;}

The error goes away when you remove the precision qualifier from the return type:

float foo(lowp float bar) {
  return 1.0;
}

Output:

float f(lowp float f){return 1.;}
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

No branches or pull requests

1 participant