Add the cool epic to meta
This commit is contained in:
parent
0a56a61f4f
commit
2be41be609
@ -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 != "" {
|
||||
|
Loading…
Reference in New Issue
Block a user