rename AssignRef to Reference

This commit is contained in:
z7zmey
2018-04-05 12:03:32 +03:00
parent d19b16e161
commit 47c51ea022
11 changed files with 30 additions and 30 deletions

View File

@@ -106,8 +106,8 @@ func (p *Printer) printNode(n node.Node) {
case *assign.Assign:
p.printAssign(n)
case *assign.AssignRef:
p.printAssignRef(n)
case *assign.Reference:
p.printReference(n)
case *assign.BitwiseAnd:
p.printAssignBitwiseAnd(n)
case *assign.BitwiseOr:
@@ -544,8 +544,8 @@ func (p *Printer) printAssign(n node.Node) {
p.Print(nn.Expression)
}
func (p *Printer) printAssignRef(n node.Node) {
nn := n.(*assign.AssignRef)
func (p *Printer) printReference(n node.Node) {
nn := n.(*assign.Reference)
p.Print(nn.Variable)
io.WriteString(p.w, " =& ")
p.Print(nn.Expression)

View File

@@ -288,11 +288,11 @@ func TestPrintAssign(t *testing.T) {
}
}
func TestPrintAssignRef(t *testing.T) {
func TestPrintReference(t *testing.T) {
o := bytes.NewBufferString("")
p := printer.NewPrinter(o, " ")
p.Print(&assign.AssignRef{
p.Print(&assign.Reference{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
})