Moved type sections into a dedicated file

This commit is contained in:
Sasha Koshka 2022-09-17 23:36:59 -04:00
parent 744e8de794
commit 3a5086ad33
2 changed files with 21 additions and 19 deletions

21
analyzer/type-section.go Normal file
View File

@ -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
}

View File

@ -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
}