add attributes fiald to all nodes

This commit is contained in:
vadim
2017-12-29 17:53:13 +02:00
parent 70a4ef18ab
commit cdb405fcc7
151 changed files with 586 additions and 359 deletions

View File

@@ -12,6 +12,7 @@ func NewFullyQualified(parts []node.Node) node.Node {
return FullyQualified{
NameNode{
"FullyQualifiedName",
map[string]interface{}{},
parts,
},
}
@@ -22,5 +23,5 @@ func (n FullyQualified) Name() string {
}
func (n FullyQualified) Attributes() map[string]interface{} {
return nil
return n.attributes
}

View File

@@ -5,13 +5,15 @@ import (
)
type NameNode struct {
name string
parts []node.Node
name string
attributes map[string]interface{}
parts []node.Node
}
func NewName(parts []node.Node) node.Node {
return NameNode{
"Name",
map[string]interface{}{},
parts,
}
}
@@ -21,7 +23,7 @@ func (n NameNode) Name() string {
}
func (n NameNode) Attributes() map[string]interface{} {
return nil
return n.attributes
}
func (n NameNode) Walk(v node.Visitor) {

View File

@@ -12,6 +12,7 @@ func NewRelative(parts []node.Node) node.Node {
return Relative{
NameNode{
"RelativeName",
map[string]interface{}{},
parts,
},
}
@@ -22,5 +23,5 @@ func (n Relative) Name() string {
}
func (n Relative) Attributes() map[string]interface{} {
return nil
return n.attributes
}