From 5110ff445ddb5a09a13e17b187c06d2dc3a7d52a Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 2 Mar 2018 11:49:19 +0100 Subject: pkg/compiler: switch attributes from Ident to Type This allows parametrized attributes like size[10]. But this is not used for now. --- pkg/compiler/check.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'pkg/compiler/check.go') diff --git a/pkg/compiler/check.go b/pkg/compiler/check.go index 57ef5b995..58738fa3e 100644 --- a/pkg/compiler/check.go +++ b/pkg/compiler/check.go @@ -535,6 +535,12 @@ func (comp *compiler) checkStruct(ctx checkCtx, n *ast.Struct) { for _, f := range n.Fields { comp.checkType(ctx, f.Type, flags) } + for _, attr := range n.Attrs { + if attr.Ident == "" || attr.HasColon { + comp.error(attr.Pos, "bad struct/union attribute") + return + } + } if n.IsUnion { comp.parseUnionAttrs(n) } else { -- cgit mrf-deployment