data-section #3

Merged
sashakoshka merged 42 commits from data-section into main 2022-08-17 18:21:20 +00:00
3 changed files with 3 additions and 18 deletions
Showing only changes of commit e42bad5810 - Show all commits

View File

@ -7,7 +7,7 @@ import "testing"
func checkTree (modulePath string, correct string, test *testing.T) { func checkTree (modulePath string, correct string, test *testing.T) {
tree, err := Parse(modulePath) tree, err := Parse(modulePath)
if err != io.EOF { if err != io.EOF && err != nil {
test.Log("returned error:") test.Log("returned error:")
test.Log(err.Error()) test.Log(err.Error())
test.Fail() test.Fail()
@ -26,21 +26,6 @@ func checkTree (modulePath string, correct string, test *testing.T) {
} }
} }
// quickIdentifier returns a simple identifier of names
func quickIdentifier (trail ...string) (identifier Identifier) {
for _, item := range trail {
identifier.trail = append (
identifier.trail,
Argument {
what: ArgumentKindString,
value: item,
},
)
}
return
}
func TestMeta (test *testing.T) { func TestMeta (test *testing.T) {
checkTree ("../tests/parser/meta", checkTree ("../tests/parser/meta",
`:arf `:arf

View File

@ -41,7 +41,7 @@ func (identifier *Identifier) ToString () (output string) {
output += "." output += "."
} }
output += trailItem.ToString(0, false) output += trailItem
} }
return return
} }

View File

@ -17,7 +17,7 @@ type SyntaxTree struct {
// Identifier represents a chain of arguments separated by a dot. // Identifier represents a chain of arguments separated by a dot.
type Identifier struct { type Identifier struct {
location file.Location location file.Location
trail []Argument trail []string
} }
// TypeKind represents what kind of type a type is // TypeKind represents what kind of type a type is