On Wed Nov 2 20:25:34 2022 +0000, Francisco Casas wrote:
My understanding is that the first part of this block of code for the case
var_modifiers type var_identifier '(' parameters ')' colon_attribute
should be the same as the previous case:
| attribute_list var_modifiers type var_identifier '(' parameters ')' colon_attribute
but with the arguments shifted. In that case, I see a discrepancy in how modifiers are handled, since matrix majority modifiers are allowed. Also, to avoid redundancy, it is possible to put the former case on an intermediate rule for the parser? For instance, if we call this rule `func_prototype_without_attrs`:
func_prototype: func_prototype_without_attrs { return $1 } | attribute_list func_prototype_without_attrs { $2->attr_count = $1.count; $2->attrs = $1.attrs; return $2; }
Of course that would mean that it wouldn't make sense to add the `attr_count` and `attrs` parameters to `hlsl_new_func_decl()`.
Yeah, this code is old. I thought for some reason that bison wouldn't work with the rule factored out like that, but it does after all, so adjusted accordingly.