node position
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
type Dnumber struct {
|
||||
name string
|
||||
attributes map[string]interface{}
|
||||
position *node.Position
|
||||
}
|
||||
|
||||
func NewDnumber(value string) node.Node {
|
||||
@@ -15,6 +16,7 @@ func NewDnumber(value string) node.Node {
|
||||
map[string]interface{}{
|
||||
"value": value,
|
||||
},
|
||||
nil,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +36,15 @@ func (n Dnumber) SetAttribute(key string, value interface{}) {
|
||||
n.attributes[key] = value
|
||||
}
|
||||
|
||||
func (n Dnumber) Position() *node.Position {
|
||||
return n.position
|
||||
}
|
||||
|
||||
func (n Dnumber) SetPosition(p *node.Position) node.Node {
|
||||
n.position = p
|
||||
return n
|
||||
}
|
||||
|
||||
func (n Dnumber) Walk(v node.Visitor) {
|
||||
if v.EnterNode(n) == false {
|
||||
return
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
type Encapsed struct {
|
||||
name string
|
||||
attributes map[string]interface{}
|
||||
position *node.Position
|
||||
parts []node.Node
|
||||
}
|
||||
|
||||
@@ -14,6 +15,7 @@ func NewEncapsed(parts []node.Node) node.Node {
|
||||
return Encapsed{
|
||||
"Encapsed",
|
||||
map[string]interface{}{},
|
||||
nil,
|
||||
parts,
|
||||
}
|
||||
}
|
||||
@@ -34,6 +36,15 @@ func (n Encapsed) SetAttribute(key string, value interface{}) {
|
||||
n.attributes[key] = value
|
||||
}
|
||||
|
||||
func (n Encapsed) Position() *node.Position {
|
||||
return n.position
|
||||
}
|
||||
|
||||
func (n Encapsed) SetPosition(p *node.Position) node.Node {
|
||||
n.position = p
|
||||
return n
|
||||
}
|
||||
|
||||
func (n Encapsed) Walk(v node.Visitor) {
|
||||
if v.EnterNode(n) == false {
|
||||
return
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
type EncapsedStringPart struct {
|
||||
name string
|
||||
attributes map[string]interface{}
|
||||
position *node.Position
|
||||
}
|
||||
|
||||
func NewEncapsedStringPart(value string) node.Node {
|
||||
@@ -15,6 +16,7 @@ func NewEncapsedStringPart(value string) node.Node {
|
||||
map[string]interface{}{
|
||||
"value": value,
|
||||
},
|
||||
nil,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +36,15 @@ func (n EncapsedStringPart) SetAttribute(key string, value interface{}) {
|
||||
n.attributes[key] = value
|
||||
}
|
||||
|
||||
func (n EncapsedStringPart) Position() *node.Position {
|
||||
return n.position
|
||||
}
|
||||
|
||||
func (n EncapsedStringPart) SetPosition(p *node.Position) node.Node {
|
||||
n.position = p
|
||||
return n
|
||||
}
|
||||
|
||||
func (n EncapsedStringPart) Walk(v node.Visitor) {
|
||||
if v.EnterNode(n) == false {
|
||||
return
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
type Lnumber struct {
|
||||
name string
|
||||
attributes map[string]interface{}
|
||||
position *node.Position
|
||||
}
|
||||
|
||||
func NewLnumber(value string) node.Node {
|
||||
@@ -15,6 +16,7 @@ func NewLnumber(value string) node.Node {
|
||||
map[string]interface{}{
|
||||
"value": value,
|
||||
},
|
||||
nil,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +36,15 @@ func (n Lnumber) SetAttribute(key string, value interface{}) {
|
||||
n.attributes[key] = value
|
||||
}
|
||||
|
||||
func (n Lnumber) Position() *node.Position {
|
||||
return n.position
|
||||
}
|
||||
|
||||
func (n Lnumber) SetPosition(p *node.Position) node.Node {
|
||||
n.position = p
|
||||
return n
|
||||
}
|
||||
|
||||
func (n Lnumber) Walk(v node.Visitor) {
|
||||
if v.EnterNode(n) == false {
|
||||
return
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
type MagicConstant struct {
|
||||
name string
|
||||
attributes map[string]interface{}
|
||||
position *node.Position
|
||||
}
|
||||
|
||||
func NewMagicConstant(value string) node.Node {
|
||||
@@ -15,6 +16,7 @@ func NewMagicConstant(value string) node.Node {
|
||||
map[string]interface{}{
|
||||
"value": value,
|
||||
},
|
||||
nil,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +36,15 @@ func (n MagicConstant) SetAttribute(key string, value interface{}) {
|
||||
n.attributes[key] = value
|
||||
}
|
||||
|
||||
func (n MagicConstant) Position() *node.Position {
|
||||
return n.position
|
||||
}
|
||||
|
||||
func (n MagicConstant) SetPosition(p *node.Position) node.Node {
|
||||
n.position = p
|
||||
return n
|
||||
}
|
||||
|
||||
func (n MagicConstant) Walk(v node.Visitor) {
|
||||
if v.EnterNode(n) == false {
|
||||
return
|
||||
|
||||
@@ -7,15 +7,16 @@ import (
|
||||
type String struct {
|
||||
name string
|
||||
attributes map[string]interface{}
|
||||
position *node.Position
|
||||
}
|
||||
|
||||
func NewString(value string) node.Node {
|
||||
return String{
|
||||
"String",
|
||||
|
||||
map[string]interface{}{
|
||||
"value": value,
|
||||
},
|
||||
nil,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +36,15 @@ func (n String) SetAttribute(key string, value interface{}) {
|
||||
n.attributes[key] = value
|
||||
}
|
||||
|
||||
func (n String) Position() *node.Position {
|
||||
return n.position
|
||||
}
|
||||
|
||||
func (n String) SetPosition(p *node.Position) node.Node {
|
||||
n.position = p
|
||||
return n
|
||||
}
|
||||
|
||||
func (n String) Walk(v node.Visitor) {
|
||||
if v.EnterNode(n) == false {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user