add attributes fiald to all nodes
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user