Added ToString for SectionTable
This commit is contained in:
parent
955f8b4719
commit
744e8de794
@ -15,6 +15,15 @@ func (where locator) ToString () (output string) {
|
|||||||
// and all sections that it requires from other modules.
|
// and all sections that it requires from other modules.
|
||||||
type SectionTable map[locator] Section
|
type SectionTable map[locator] Section
|
||||||
|
|
||||||
|
// ToString returns the data stored in the table as a string.
|
||||||
|
func (table SectionTable) ToString (indent int) (output string) {
|
||||||
|
for _, section := range table {
|
||||||
|
output += section.ToString(indent)
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// SectionKind differentiates Section interfaces.
|
// SectionKind differentiates Section interfaces.
|
||||||
type SectionKind int
|
type SectionKind int
|
||||||
|
|
||||||
|
13
analyzer/test-common.go
Normal file
13
analyzer/test-common.go
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
package analyzer
|
||||||
|
|
||||||
|
import "os"
|
||||||
|
import "testing"
|
||||||
|
import "path/filepath"
|
||||||
|
import "git.tebibyte.media/arf/arf/testCommon"
|
||||||
|
|
||||||
|
func checkTree (modulePath string, skim bool, correct string, test *testing.T) {
|
||||||
|
cwd, _ := os.Getwd()
|
||||||
|
modulePath = filepath.Join(cwd, modulePath)
|
||||||
|
table, err := Analyze(modulePath, skim)
|
||||||
|
testCommon.CheckStrings(test, table, err, correct)
|
||||||
|
}
|
4
tests/analyzer/type/main.arf
Normal file
4
tests/analyzer/type/main.arf
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
:arf
|
||||||
|
---
|
||||||
|
|
||||||
|
type basicInt:Int:<5>
|
Reference in New Issue
Block a user