Skip to content

Commit e4321b5

Browse files
committed
refactoring: create "ExprBrackets" node
1 parent ad884c9 commit e4321b5

File tree

15 files changed

+281
-180
lines changed

15 files changed

+281
-180
lines changed

internal/php5/parser_test.go

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11513,14 +11513,14 @@ func TestStmtContinue(t *testing.T) {
1151311513
},
1151411514
},
1151511515
},
11516-
Expr: &ast.ParserBrackets{
11516+
Expr: &ast.ExprBrackets{
1151711517
Position: &position.Position{
1151811518
StartLine: 1,
1151911519
EndLine: 1,
1152011520
StartPos: 23,
1152111521
EndPos: 26,
1152211522
},
11523-
OpenBracketTkn: &token.Token{
11523+
OpenParenthesisTkn: &token.Token{
1152411524
ID: token.ID(40),
1152511525
Value: []byte("("),
1152611526
Position: &position.Position{
@@ -11530,7 +11530,7 @@ func TestStmtContinue(t *testing.T) {
1153011530
EndPos: 24,
1153111531
},
1153211532
},
11533-
Child: &ast.ScalarLnumber{
11533+
Expr: &ast.ScalarLnumber{
1153411534
Position: &position.Position{
1153511535
StartLine: 1,
1153611536
EndLine: 1,
@@ -11549,7 +11549,7 @@ func TestStmtContinue(t *testing.T) {
1154911549
},
1155011550
Value: []byte("3"),
1155111551
},
11552-
CloseBracketTkn: &token.Token{
11552+
CloseParenthesisTkn: &token.Token{
1155311553
ID: token.ID(41),
1155411554
Value: []byte(")"),
1155511555
Position: &position.Position{
@@ -12598,14 +12598,14 @@ func TestStmtEcho_Parenthesis(t *testing.T) {
1259812598
},
1259912599
},
1260012600
Exprs: []ast.Vertex{
12601-
&ast.ParserBrackets{
12601+
&ast.ExprBrackets{
1260212602
Position: &position.Position{
1260312603
StartLine: 1,
1260412604
EndLine: 1,
1260512605
StartPos: 7,
1260612606
EndPos: 11,
1260712607
},
12608-
OpenBracketTkn: &token.Token{
12608+
OpenParenthesisTkn: &token.Token{
1260912609
ID: token.ID(40),
1261012610
Value: []byte("("),
1261112611
Position: &position.Position{
@@ -12615,7 +12615,7 @@ func TestStmtEcho_Parenthesis(t *testing.T) {
1261512615
EndPos: 8,
1261612616
},
1261712617
},
12618-
Child: &ast.ExprVariable{
12618+
Expr: &ast.ExprVariable{
1261912619
Position: &position.Position{
1262012620
StartLine: 1,
1262112621
EndLine: 1,
@@ -12642,7 +12642,7 @@ func TestStmtEcho_Parenthesis(t *testing.T) {
1264212642
Value: []byte("$a"),
1264312643
},
1264412644
},
12645-
CloseBracketTkn: &token.Token{
12645+
CloseParenthesisTkn: &token.Token{
1264612646
ID: token.ID(41),
1264712647
Value: []byte(")"),
1264812648
Position: &position.Position{
@@ -12694,14 +12694,14 @@ func TestStmtExpression(t *testing.T) {
1269412694
StartPos: 3,
1269512695
EndPos: 9,
1269612696
},
12697-
Expr: &ast.ParserBrackets{
12697+
Expr: &ast.ExprBrackets{
1269812698
Position: &position.Position{
1269912699
StartLine: 1,
1270012700
EndLine: 1,
1270112701
StartPos: 3,
1270212702
EndPos: 8,
1270312703
},
12704-
OpenBracketTkn: &token.Token{
12704+
OpenParenthesisTkn: &token.Token{
1270512705
ID: token.ID(40),
1270612706
Value: []byte("("),
1270712707
Position: &position.Position{
@@ -12733,14 +12733,14 @@ func TestStmtExpression(t *testing.T) {
1273312733
},
1273412734
},
1273512735
},
12736-
Child: &ast.ParserBrackets{
12736+
Expr: &ast.ExprBrackets{
1273712737
Position: &position.Position{
1273812738
StartLine: 1,
1273912739
EndLine: 1,
1274012740
StartPos: 4,
1274112741
EndPos: 7,
1274212742
},
12743-
OpenBracketTkn: &token.Token{
12743+
OpenParenthesisTkn: &token.Token{
1274412744
ID: token.ID(40),
1274512745
Value: []byte("("),
1274612746
Position: &position.Position{
@@ -12750,7 +12750,7 @@ func TestStmtExpression(t *testing.T) {
1275012750
EndPos: 5,
1275112751
},
1275212752
},
12753-
Child: &ast.ScalarLnumber{
12753+
Expr: &ast.ScalarLnumber{
1275412754
Position: &position.Position{
1275512755
StartLine: 1,
1275612756
EndLine: 1,
@@ -12769,7 +12769,7 @@ func TestStmtExpression(t *testing.T) {
1276912769
},
1277012770
Value: []byte("1"),
1277112771
},
12772-
CloseBracketTkn: &token.Token{
12772+
CloseParenthesisTkn: &token.Token{
1277312773
ID: token.ID(41),
1277412774
Value: []byte(")"),
1277512775
Position: &position.Position{
@@ -12780,7 +12780,7 @@ func TestStmtExpression(t *testing.T) {
1278012780
},
1278112781
},
1278212782
},
12783-
CloseBracketTkn: &token.Token{
12783+
CloseParenthesisTkn: &token.Token{
1278412784
ID: token.ID(41),
1278512785
Value: []byte(")"),
1278612786
Position: &position.Position{
@@ -29993,14 +29993,14 @@ func TestStmtBreak(t *testing.T) {
2999329993
},
2999429994
},
2999529995
},
29996-
Expr: &ast.ParserBrackets{
29996+
Expr: &ast.ExprBrackets{
2999729997
Position: &position.Position{
2999829998
StartLine: 1,
2999929999
EndLine: 1,
3000030000
StartPos: 20,
3000130001
EndPos: 23,
3000230002
},
30003-
OpenBracketTkn: &token.Token{
30003+
OpenParenthesisTkn: &token.Token{
3000430004
ID: token.ID(40),
3000530005
Value: []byte("("),
3000630006
Position: &position.Position{
@@ -30010,7 +30010,7 @@ func TestStmtBreak(t *testing.T) {
3001030010
EndPos: 21,
3001130011
},
3001230012
},
30013-
Child: &ast.ScalarLnumber{
30013+
Expr: &ast.ScalarLnumber{
3001430014
Position: &position.Position{
3001530015
StartLine: 1,
3001630016
EndLine: 1,
@@ -30029,7 +30029,7 @@ func TestStmtBreak(t *testing.T) {
3002930029
},
3003030030
Value: []byte("3"),
3003130031
},
30032-
CloseBracketTkn: &token.Token{
30032+
CloseParenthesisTkn: &token.Token{
3003330033
ID: token.ID(41),
3003430034
Value: []byte(")"),
3003530035
Position: &position.Position{
@@ -31402,14 +31402,14 @@ func TestExprClone_Brackets(t *testing.T) {
3140231402
},
3140331403
},
3140431404
},
31405-
Expr: &ast.ParserBrackets{
31405+
Expr: &ast.ExprBrackets{
3140631406
Position: &position.Position{
3140731407
StartLine: 1,
3140831408
EndLine: 1,
3140931409
StartPos: 8,
3141031410
EndPos: 12,
3141131411
},
31412-
OpenBracketTkn: &token.Token{
31412+
OpenParenthesisTkn: &token.Token{
3141331413
ID: token.ID(40),
3141431414
Value: []byte("("),
3141531415
Position: &position.Position{
@@ -31419,7 +31419,7 @@ func TestExprClone_Brackets(t *testing.T) {
3141931419
EndPos: 9,
3142031420
},
3142131421
},
31422-
Child: &ast.ExprVariable{
31422+
Expr: &ast.ExprVariable{
3142331423
Position: &position.Position{
3142431424
StartLine: 1,
3142531425
EndLine: 1,
@@ -31446,7 +31446,7 @@ func TestExprClone_Brackets(t *testing.T) {
3144631446
Value: []byte("$a"),
3144731447
},
3144831448
},
31449-
CloseBracketTkn: &token.Token{
31449+
CloseParenthesisTkn: &token.Token{
3145031450
ID: token.ID(41),
3145131451
Value: []byte(")"),
3145231452
Position: &position.Position{
@@ -38335,14 +38335,14 @@ func TestExprPrint(t *testing.T) {
3833538335
},
3833638336
},
3833738337
},
38338-
Expr: &ast.ParserBrackets{
38338+
Expr: &ast.ExprBrackets{
3833938339
Position: &position.Position{
3834038340
StartLine: 1,
3834138341
EndLine: 1,
3834238342
StartPos: 8,
3834338343
EndPos: 12,
3834438344
},
38345-
OpenBracketTkn: &token.Token{
38345+
OpenParenthesisTkn: &token.Token{
3834638346
ID: token.ID(40),
3834738347
Value: []byte("("),
3834838348
Position: &position.Position{
@@ -38352,7 +38352,7 @@ func TestExprPrint(t *testing.T) {
3835238352
EndPos: 9,
3835338353
},
3835438354
},
38355-
Child: &ast.ExprVariable{
38355+
Expr: &ast.ExprVariable{
3835638356
Position: &position.Position{
3835738357
StartLine: 1,
3835838358
EndLine: 1,
@@ -38379,7 +38379,7 @@ func TestExprPrint(t *testing.T) {
3837938379
Value: []byte("$a"),
3838038380
},
3838138381
},
38382-
CloseBracketTkn: &token.Token{
38382+
CloseParenthesisTkn: &token.Token{
3838338383
ID: token.ID(41),
3838438384
Value: []byte(")"),
3838538385
Position: &position.Position{

0 commit comments

Comments
 (0)