-
Notifications
You must be signed in to change notification settings - Fork 34
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
Start working on HLSL initialization lists #329
base: main
Are you sure you want to change the base?
Conversation
This one is a bit gnarly because it involves a lot of depth-first traversing of declarations, types, and initialization expresssions. Questions and suggestions on how to clarify are greatly appreciated!
a51eec2
to
2da528e
Compare
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.
I understand the depth-first traversal well enough. I think an example would be helpful to some, but perhaps that doesn't fit in this context?
specs/language/declarations.tex
Outdated
element's type. | ||
|
||
\p An initializer-list is invalid if the flattened initializer sequence contains | ||
less elements than the target object's flattened ordering, or if any initializer |
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.
nit: fewer elements
Co-authored-by: Greg Roth <[email protected]>
in the flattened initializer sequence which can be implicitly converted to the | ||
element's type. | ||
|
||
\p An initializer-list is invalid if the flattened initializer sequence contains |
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.
An initializer-list is valid if too many elements are provided?
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.
Updated language in the latest version
specs/language/declarations.tex
Outdated
|
||
\p Each \textit{initializer-list} is comprised of zero or more | ||
\textit{initializer-clause} expressions, which in turn may be another | ||
initializer-list or an \textit{assignment-expression}. Each |
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.
I haven't seen the whole grammar so maybe assignment-expression isn't used elsewhere, but it seems natural it would mean A=B (where = is used visually). I wonder if there is a better term for this. Like 'initializer-value'.
Also, maybe this is visualized with '=', then disregard my comment. But maybe it would be good to have a definition of 'assignment-expression' included in the provided grammar to clarify.
Edit: I now know C++ better
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.
The most recent update here tried to clarify the language and not use the grammar tokens since the C++ grammar is a bit bonkers to follow.
specs/language/declarations.tex
Outdated
depth-first traversal of the subobjects of an object following the defined | ||
subobject ordering. | ||
|
||
\p Each \textit{initializer-list} is comprised of zero or more |
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.
I mentioned this offline, I think 'initializer-list' is the wrong term here since it isn't defined in the grammar to be allowed to be empty.
This one is a bit gnarly because it involves a lot of depth-first traversing of declarations, types, and initialization expresssions.
Questions and suggestions on how to clarify are greatly appreciated!