fluent interface for node SetAttribure

This commit is contained in:
vadim
2018-01-02 14:11:08 +02:00
parent 2051e3a23d
commit 31cc11da0c
153 changed files with 392 additions and 240 deletions

View File

@@ -7,7 +7,7 @@ import (
type Dnumber struct {
name string
attributes map[string]interface{}
position *node.Position
position *node.Position
}
func NewDnumber(value string) node.Node {
@@ -32,8 +32,9 @@ func (n Dnumber) Attribute(key string) interface{} {
return n.attributes[key]
}
func (n Dnumber) SetAttribute(key string, value interface{}) {
func (n Dnumber) SetAttribute(key string, value interface{}) node.Node {
n.attributes[key] = value
return n
}
func (n Dnumber) Position() *node.Position {

View File

@@ -32,8 +32,9 @@ func (n Encapsed) Attribute(key string) interface{} {
return n.attributes[key]
}
func (n Encapsed) SetAttribute(key string, value interface{}) {
func (n Encapsed) SetAttribute(key string, value interface{}) node.Node {
n.attributes[key] = value
return n
}
func (n Encapsed) Position() *node.Position {

View File

@@ -7,7 +7,7 @@ import (
type EncapsedStringPart struct {
name string
attributes map[string]interface{}
position *node.Position
position *node.Position
}
func NewEncapsedStringPart(value string) node.Node {
@@ -32,8 +32,9 @@ func (n EncapsedStringPart) Attribute(key string) interface{} {
return n.attributes[key]
}
func (n EncapsedStringPart) SetAttribute(key string, value interface{}) {
func (n EncapsedStringPart) SetAttribute(key string, value interface{}) node.Node {
n.attributes[key] = value
return n
}
func (n EncapsedStringPart) Position() *node.Position {

View File

@@ -7,7 +7,7 @@ import (
type Lnumber struct {
name string
attributes map[string]interface{}
position *node.Position
position *node.Position
}
func NewLnumber(value string) node.Node {
@@ -32,8 +32,9 @@ func (n Lnumber) Attribute(key string) interface{} {
return n.attributes[key]
}
func (n Lnumber) SetAttribute(key string, value interface{}) {
func (n Lnumber) SetAttribute(key string, value interface{}) node.Node {
n.attributes[key] = value
return n
}
func (n Lnumber) Position() *node.Position {

View File

@@ -7,7 +7,7 @@ import (
type MagicConstant struct {
name string
attributes map[string]interface{}
position *node.Position
position *node.Position
}
func NewMagicConstant(value string) node.Node {
@@ -32,8 +32,9 @@ func (n MagicConstant) Attribute(key string) interface{} {
return n.attributes[key]
}
func (n MagicConstant) SetAttribute(key string, value interface{}) {
func (n MagicConstant) SetAttribute(key string, value interface{}) node.Node {
n.attributes[key] = value
return n
}
func (n MagicConstant) Position() *node.Position {

View File

@@ -32,8 +32,9 @@ func (n String) Attribute(key string) interface{} {
return n.attributes[key]
}
func (n String) SetAttribute(key string, value interface{}) {
func (n String) SetAttribute(key string, value interface{}) node.Node {
n.attributes[key] = value
return n
}
func (n String) Position() *node.Position {