From 91b6fff6c73471a9597e6984c8bb9e8c02cad567 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Thu, 14 Mar 2024 02:43:59 -0400 Subject: [PATCH] Add the cool epic to meta --- entity/meta.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/entity/meta.go b/entity/meta.go index 70ec58e..4ae964d 100644 --- a/entity/meta.go +++ b/entity/meta.go @@ -10,10 +10,11 @@ import "git.tebibyte.media/fspl/fspl/errors" // Metadata represents a module metadata file. type Metadata struct { - Position errors.Position + Pos errors.Position UUID uuid.UUID Dependencies []*Dependency } +func (this *Metadata) Position () errors.Position { return this.Pos } func (this *Metadata) String () string { out := fmt.Sprint(Quote(this.UUID.String())) for _, dependency := range this.Dependencies { @@ -24,16 +25,24 @@ func (this *Metadata) String () string { // Directive is a declaration within a module metadata file. type Directive interface { + fmt.Stringer + + // Position returns the position of the directive within its metadata + // file. + Position () errors.Position + directive() } +var _ Directive = &Dependency { } // Dependency is a metadata dependency listing. type Dependency struct { - Position errors.Position + Pos errors.Position Address Address Nickname string } func (*Dependency) directive () { } +func (this *Dependency) Position () errors.Position { return this.Pos } func (this *Dependency) String () string { out := fmt.Sprint("+ ", this.Address) if this.Nickname != "" {