From b323c5aaa9b926ba43a9c5435b62b4fce992ff94 Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Mon, 23 Jan 2017 15:02:47 +0100 Subject: prog: add FieldName to Type FieldName() is the name of the struct field or union option with this type. TypeName() is now always the name of the type. --- sys/decl.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sys/decl.go') diff --git a/sys/decl.go b/sys/decl.go index a495ffd4a..3c98d1038 100644 --- a/sys/decl.go +++ b/sys/decl.go @@ -29,6 +29,7 @@ const ( type Type interface { Name() string + FieldName() string Dir() Dir Optional() bool Default() uintptr @@ -49,6 +50,7 @@ func IsPad(t Type) bool { type TypeCommon struct { TypeName string + FldName string // for struct fields and named args ArgDir Dir IsOptional bool } @@ -57,6 +59,10 @@ func (t *TypeCommon) Name() string { return t.TypeName } +func (t *TypeCommon) FieldName() string { + return t.FldName +} + func (t *TypeCommon) Optional() bool { return t.IsOptional } -- cgit mrf-deployment