Proposal: move field declaration align syntax to field name #5640
Labels
proposal
This issue suggests modifications. If it also has the "accepted" label then it is planned.
Milestone
In the current Zig grammar, fields declarations can be forced to arbitrary alignment by using the
align
attribute:When an explicit type is given, the
align
is specified after the type:With this grammar, it looks like
align
is actually part of the type expression, which led me to falsely believe thatis valid syntax.
I propose to instead place the
align
attribute after the type name to improve readability:Another option would be to actually move the align specifier to the type expression, and have
TypeName align(expr)
be valid syntax. I think in that case it would be clearer to have the alignment before the type name though:The text was updated successfully, but these errors were encountered: