-
Notifications
You must be signed in to change notification settings - Fork 337
Add pointer-chaining expressions: ptr.field and ptr[i] #1580
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
Conversation
Also replace "surfaces" with the simpler "is exposed"
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.
Thank you for writing this!
I got two major concerns, and one minor one.
Major-1 is that I'd like us to pick between this and "->" so that we don't end up with both.
Major-2 is the description of out-of-bounds accesses
WGSL meeting minutes 2021-04-13
|
Is this PR still current? |
This resolves an ambiguity on how to type-check things like: var m:mat2x2<f32>; let p = &m; *p[0] = m[1]; This grammar change pulls processing of the * and & from lhs_expression into core_lhs_expression. So this example will parse as if: (*p)[0] = m[1]; This is necessary, unless we want to support gpuweb#1580 (which propooses to add apply array indexing and struct member selection on pointer values). Note: This means reference expressions are parsed differently on the left side of an assignment than they anywhere else. Fixes: gpuweb#3530
Closing. This was revisited, with consensus as described at #4114 (comment) |
Add pointer-chaining expressions: ptr.field and ptr[i]
Fixes: #1530
This builds on #1569