From 3a5086ad33418343425a77718e902ffdf797a09e Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Sat, 17 Sep 2022 23:36:59 -0400 Subject: [PATCH] Moved type sections into a dedicated file --- analyzer/type-section.go | 21 +++++++++++++++++++++ analyzer/type.go | 19 ------------------- 2 files changed, 21 insertions(+), 19 deletions(-) create mode 100644 analyzer/type-section.go diff --git a/analyzer/type-section.go b/analyzer/type-section.go new file mode 100644 index 0000000..4e8f6de --- /dev/null +++ b/analyzer/type-section.go @@ -0,0 +1,21 @@ +package analyzer + +// TypeSection represents a type definition section. +type TypeSection struct { + sectionBase + inherits Type + complete bool +} + +// Kind returns SectionKindType. +func (section TypeSection) Kind () (kind SectionKind) { + kind = SectionKindType + return +} + +// ToString returns all data stored within the type section, in string form. +func (section TypeSection) ToString (indent int) (output string) { + output += doIndent(indent, "typeSection ", section.where.ToString(), "\n") + output += section.inherits.ToString(indent + 1) + return +} diff --git a/analyzer/type.go b/analyzer/type.go index d60f221..671a124 100644 --- a/analyzer/type.go +++ b/analyzer/type.go @@ -96,22 +96,3 @@ func (what Type) ToString (indent int) (output string) { } return } - -// TypeSection represents a type definition section. -type TypeSection struct { - sectionBase - inherits Type -} - -// Kind returns SectionKindType. -func (section TypeSection) Kind () (kind SectionKind) { - kind = SectionKindType - return -} - -// ToString returns all data stored within the type section, in string form. -func (section TypeSection) ToString (indent int) (output string) { - output += doIndent(indent, "typeSection ", section.where.ToString(), "\n") - output += section.inherits.ToString(indent + 1) - return -}