Per https://github.com/gpuweb/gpuweb/issues/3346, WGSL has a partial order of precedence, meaning that among other things the arguments to a shift expression must be parenthesized if they are not unary: a + b << c is not valid and should not parse (in C precedence rules, this would be (a + b) << c which is very likely not what's intended, hence the nudge to always explicitly parenthesize).
Looking at the code this should be fairly straightforward. From what I can see, parse_equality_expression currently nests the additive_expression parser inside a call to parse_binary_op for shift_expression, and this should be changed to more closely match the structure of the WGSL spec.
Per https://github.com/gpuweb/gpuweb/issues/3346, WGSL has a partial order of precedence, meaning that among other things the arguments to a shift expression must be parenthesized if they are not unary:
a + b << c
is not valid and should not parse (in C precedence rules, this would be(a + b) << c
which is very likely not what's intended, hence the nudge to always explicitly parenthesize).Looking at the code this should be fairly straightforward. From what I can see,
parse_equality_expression
currently nests the additive_expression parser inside a call toparse_binary_op
for shift_expression, and this should be changed to more closely match the structure of the WGSL spec.