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

Failures with macro functions #18

Open
DiThi opened this issue Sep 7, 2017 · 1 comment
Open

Failures with macro functions #18

DiThi opened this issue Sep 7, 2017 · 1 comment
Assignees

Comments

@DiThi
Copy link

DiThi commented Sep 7, 2017

I'm back

glsl.parse(`void main(){
#define thing(a, b, c) \
{ \
	a *= b+c; \
}
	uint a = 2u;
}`)

Error:

	uint a = 2u;
             ^
Expected "(" but "a" found.

It also fails with single line macros without { }, although the error is different I think.

@lammas lammas self-assigned this Sep 11, 2017
@lammas
Copy link
Owner

lammas commented Sep 11, 2017

This is a fun one: three problems in one.
First, indeed multi-line macros fail to parse and also the code generator did not generate parameter lists for macros. The above example unfortunately does not produce a multi-line macro, but it seems to cause a different issue where parsing fails if a variable declaration after a define has leading indentation.

I have to admit, it's a bit of a head scratcher, so I will have to look at this with rested eyes.

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

2 participants