[naga wgsl-in] Add directive keywords to "expected" values on global item parsing #6421
Labels
area: naga front-end
good first issue
Good for newcomers
lang: WGSL
WebGPU Shading Language
naga
Shader Translator
type: bug
Something isn't working
Is your feature request related to a problem? Please describe.
#6352 adds/added parsing for directives, which only happen before global declarations. However, it did not add any diagnostic adjustments for the final, fatal diagnostic presented when Naga simply did not find any sentinel tokens indicating a deeper parse path to try than
Parser::global_decl
. To be painfully concrete, I'm referring to the code here:wgpu/naga/src/front/wgsl/error.rs
Lines 340 to 343 in db334f7
Describe the solution you'd like
We should also suggest directive identifiers in the set of sentinels that begin a global item for this diagnostic.
Describe alternatives you've considered
We could simply not do this. However, this feels like hiding functionality in a way that hurts, rather than helps, users.
Additional context
-
The text was updated successfully, but these errors were encountered: