trim $ from variable name identifier

This commit is contained in:
z7zmey
2018-03-18 16:50:19 +02:00
parent 7e6f7e7267
commit 643027db9a
58 changed files with 1107 additions and 1107 deletions

View File

@@ -34,7 +34,7 @@ func TestCastArray(t *testing.T) {
Stmts: []node.Node{
&stmt.Expression{
Expr: &cast.CastArray{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
},
},
},
@@ -54,7 +54,7 @@ func TestCastBool(t *testing.T) {
Stmts: []node.Node{
&stmt.Expression{
Expr: &cast.CastBool{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
},
},
},
@@ -74,7 +74,7 @@ func TestCastBoolShort(t *testing.T) {
Stmts: []node.Node{
&stmt.Expression{
Expr: &cast.CastBool{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
},
},
},
@@ -94,7 +94,7 @@ func TestCastDouble(t *testing.T) {
Stmts: []node.Node{
&stmt.Expression{
Expr: &cast.CastDouble{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
},
},
},
@@ -114,7 +114,7 @@ func TestCastFloat(t *testing.T) {
Stmts: []node.Node{
&stmt.Expression{
Expr: &cast.CastDouble{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
},
},
},
@@ -134,7 +134,7 @@ func TestCastInt(t *testing.T) {
Stmts: []node.Node{
&stmt.Expression{
Expr: &cast.CastInt{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
},
},
},
@@ -154,7 +154,7 @@ func TestCastIntShort(t *testing.T) {
Stmts: []node.Node{
&stmt.Expression{
Expr: &cast.CastInt{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
},
},
},
@@ -174,7 +174,7 @@ func TestCastObject(t *testing.T) {
Stmts: []node.Node{
&stmt.Expression{
Expr: &cast.CastObject{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
},
},
},
@@ -194,7 +194,7 @@ func TestCastString(t *testing.T) {
Stmts: []node.Node{
&stmt.Expression{
Expr: &cast.CastString{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
},
},
},
@@ -214,7 +214,7 @@ func TestCastUnset(t *testing.T) {
Stmts: []node.Node{
&stmt.Expression{
Expr: &cast.CastUnset{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
},
},
},

View File

@@ -19,49 +19,49 @@ var nodesToTest = []struct {
}{
{
&cast.CastArray{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
},
[]string{"Expr"},
map[string]interface{}{},
},
{
&cast.CastBool{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
},
[]string{"Expr"},
map[string]interface{}{},
},
{
&cast.CastDouble{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
},
[]string{"Expr"},
map[string]interface{}{},
},
{
&cast.CastInt{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
},
[]string{"Expr"},
map[string]interface{}{},
},
{
&cast.CastObject{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
},
[]string{"Expr"},
map[string]interface{}{},
},
{
&cast.CastString{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
},
[]string{"Expr"},
map[string]interface{}{},
},
{
&cast.CastUnset{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
},
[]string{"Expr"},
map[string]interface{}{},