node position

This commit is contained in:
z7zmey
2017-12-31 12:59:22 +02:00
parent 8edc05c8d5
commit f2d972582f
158 changed files with 1644 additions and 5 deletions

View File

@@ -13,6 +13,7 @@ func NewAssign(variable node.Node, expression node.Node) node.Node {
AssignOp{
"Assign",
map[string]interface{}{},
nil,
variable,
expression,
},
@@ -35,6 +36,15 @@ func (n Assign) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Assign) Position() *node.Position {
return n.position
}
func (n Assign) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Assign) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -7,6 +7,7 @@ import (
type AssignOp struct {
name string
attributes map[string]interface{}
position *node.Position
variable node.Node
expression node.Node
}

View File

@@ -13,6 +13,7 @@ func NewAssignRef(variable node.Node, expression node.Node) node.Node {
AssignOp{
"AssignRef",
map[string]interface{}{},
nil,
variable,
expression,
},
@@ -35,6 +36,15 @@ func (n AssignRef) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n AssignRef) Position() *node.Position {
return n.position
}
func (n AssignRef) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n AssignRef) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -13,6 +13,7 @@ func NewBitwiseAnd(variable node.Node, expression node.Node) node.Node {
AssignOp{
"AssignBitwiseAnd",
map[string]interface{}{},
nil,
variable,
expression,
},
@@ -35,6 +36,15 @@ func (n BitwiseAnd) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n BitwiseAnd) Position() *node.Position {
return n.position
}
func (n BitwiseAnd) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n BitwiseAnd) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -13,6 +13,7 @@ func NewBitwiseOr(variable node.Node, expression node.Node) node.Node {
AssignOp{
"AssignBitwiseOr",
map[string]interface{}{},
nil,
variable,
expression,
},
@@ -35,6 +36,15 @@ func (n BitwiseOr) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n BitwiseOr) Position() *node.Position {
return n.position
}
func (n BitwiseOr) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n BitwiseOr) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -13,6 +13,7 @@ func NewBitwiseXor(variable node.Node, expression node.Node) node.Node {
AssignOp{
"AssignBitwiseXor",
map[string]interface{}{},
nil,
variable,
expression,
},
@@ -31,6 +32,15 @@ func (n BitwiseXor) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n BitwiseXor) Position() *node.Position {
return n.position
}
func (n BitwiseXor) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n BitwiseXor) Name() string {
return "BitwiseXor"
}

View File

@@ -13,6 +13,7 @@ func NewConcat(variable node.Node, expression node.Node) node.Node {
AssignOp{
"AssignConcat",
map[string]interface{}{},
nil,
variable,
expression,
},
@@ -35,6 +36,15 @@ func (n Concat) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Concat) Position() *node.Position {
return n.position
}
func (n Concat) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Concat) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -13,6 +13,7 @@ func NewDiv(variable node.Node, expression node.Node) node.Node {
AssignOp{
"AssignDiv",
map[string]interface{}{},
nil,
variable,
expression,
},
@@ -35,6 +36,15 @@ func (n Div) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Div) Position() *node.Position {
return n.position
}
func (n Div) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Div) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -13,6 +13,7 @@ func NewMinus(variable node.Node, expression node.Node) node.Node {
AssignOp{
"AssignMinus",
map[string]interface{}{},
nil,
variable,
expression,
},
@@ -35,6 +36,15 @@ func (n Minus) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Minus) Position() *node.Position {
return n.position
}
func (n Minus) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Minus) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -13,6 +13,7 @@ func NewMod(variable node.Node, expression node.Node) node.Node {
AssignOp{
"AssignMod",
map[string]interface{}{},
nil,
variable,
expression,
},
@@ -35,6 +36,15 @@ func (n Mod) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Mod) Position() *node.Position {
return n.position
}
func (n Mod) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Mod) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -13,6 +13,7 @@ func NewMul(variable node.Node, expression node.Node) node.Node {
AssignOp{
"AssignMul",
map[string]interface{}{},
nil,
variable,
expression,
},
@@ -35,6 +36,15 @@ func (n Mul) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Mul) Position() *node.Position {
return n.position
}
func (n Mul) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Mul) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -13,6 +13,7 @@ func NewPlus(variable node.Node, expression node.Node) node.Node {
AssignOp{
"AssignPlus",
map[string]interface{}{},
nil,
variable,
expression,
},
@@ -35,6 +36,15 @@ func (n Plus) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Plus) Position() *node.Position {
return n.position
}
func (n Plus) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Plus) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -13,6 +13,7 @@ func NewPow(variable node.Node, expression node.Node) node.Node {
AssignOp{
"AssignPow",
map[string]interface{}{},
nil,
variable,
expression,
},
@@ -35,6 +36,15 @@ func (n Pow) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Pow) Position() *node.Position {
return n.position
}
func (n Pow) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Pow) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -13,6 +13,7 @@ func NewShiftLeft(variable node.Node, expression node.Node) node.Node {
AssignOp{
"AssignShiftLeft",
map[string]interface{}{},
nil,
variable,
expression,
},
@@ -35,6 +36,15 @@ func (n ShiftLeft) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n ShiftLeft) Position() *node.Position {
return n.position
}
func (n ShiftLeft) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n ShiftLeft) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -13,6 +13,7 @@ func NewShiftRight(variable node.Node, expression node.Node) node.Node {
AssignOp{
"AssignShiftRight",
map[string]interface{}{},
nil,
variable,
expression,
},
@@ -35,6 +36,15 @@ func (n ShiftRight) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n ShiftRight) Position() *node.Position {
return n.position
}
func (n ShiftRight) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n ShiftRight) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return