-
Notifications
You must be signed in to change notification settings - Fork 84
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
Add pp.join([...]), which joins an array of strings, preserving vertical alignment #360
base: main
Are you sure you want to change the base?
Conversation
…nment And use pp in a few places. Fixes gpuweb#356
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WDYT?
${useBindGroup1 ? '[[set 1, binding 0]] var<image> image1;' : ''} | ||
const wgslFragment = pp` | ||
${pp._if(useBindGroup0)}[[set 0, binding 0]] var<image> image0;${pp._endif} | ||
${pp._if(useBindGroup1)}[[set 1, binding 0]] var<image> image1;${pp._endif} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe not better.
Hmm yea I don't see so much value in having it join lines by preserving indentation. Overall, I think what's most important is readability of the template code which is better both without pp.join and without manual string formatting. What could be neat though is a simple post process formatter to fixup indentation for logging purposes? |
Maintaining the indentation is mostly just incidental since I could do it easily. Originally, I was going to have any interpolant of type
what do you mean by this? |
I do think it would be easier to use. Seems like pp.join is roughly as much typing as
Doing |
I may not keep this but if I do something like this, TODO: update |
And use
pp
in a few places.Fixes #356