[refactoring] fix typo

This commit is contained in:
Vadym Slizov 2020-12-11 17:29:22 +02:00
parent 45ded326d0
commit 5291529a37
No known key found for this signature in database
GPG Key ID: AEA2A9388EF42A4A
8 changed files with 231 additions and 231 deletions

62
internal/php5/php5.go generated
View File

@ -2430,9 +2430,9 @@ yydefault:
Parts: yyDollar[2].node.(*ast.ParserSeparatedList).Items, Parts: yyDollar[2].node.(*ast.ParserSeparatedList).Items,
SeparatorTkns: yyDollar[2].node.(*ast.ParserSeparatedList).SeparatorTkns, SeparatorTkns: yyDollar[2].node.(*ast.ParserSeparatedList).SeparatorTkns,
}, },
OpenCurlyBracket: yyDollar[3].token, OpenCurlyBracketTkn: yyDollar[3].token,
Stmts: yyDollar[4].list, Stmts: yyDollar[4].list,
CloseCurlyBracket: yyDollar[5].token, CloseCurlyBracketTkn: yyDollar[5].token,
} }
} }
case 13: case 13:
@ -2440,11 +2440,11 @@ yydefault:
// line internal/php5/php5.y:375 // line internal/php5/php5.y:375
{ {
yyVAL.node = &ast.StmtNamespace{ yyVAL.node = &ast.StmtNamespace{
Position: yylex.(*Parser).builder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token), Position: yylex.(*Parser).builder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token),
NsTkn: yyDollar[1].token, NsTkn: yyDollar[1].token,
OpenCurlyBracket: yyDollar[2].token, OpenCurlyBracketTkn: yyDollar[2].token,
Stmts: yyDollar[3].list, Stmts: yyDollar[3].list,
CloseCurlyBracket: yyDollar[4].token, CloseCurlyBracketTkn: yyDollar[4].token,
} }
} }
case 14: case 14:
@ -2867,10 +2867,10 @@ yydefault:
// line internal/php5/php5.y:769 // line internal/php5/php5.y:769
{ {
yyVAL.node = &ast.StmtStmtList{ yyVAL.node = &ast.StmtStmtList{
Position: yylex.(*Parser).builder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token), Position: yylex.(*Parser).builder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token),
OpenCurlyBracket: yyDollar[1].token, OpenCurlyBracketTkn: yyDollar[1].token,
Stmts: yyDollar[2].list, Stmts: yyDollar[2].list,
CloseCurlyBracket: yyDollar[3].token, CloseCurlyBracketTkn: yyDollar[3].token,
} }
} }
case 48: case 48:
@ -3193,13 +3193,13 @@ yydefault:
} }
yyVAL.node = &ast.StmtTry{ yyVAL.node = &ast.StmtTry{
Position: pos, Position: pos,
TryTkn: yyDollar[1].token, TryTkn: yyDollar[1].token,
OpenCurlyBracket: yyDollar[2].token, OpenCurlyBracketTkn: yyDollar[2].token,
Stmts: yyDollar[3].list, Stmts: yyDollar[3].list,
CloseCurlyBracket: yyDollar[4].token, CloseCurlyBracketTkn: yyDollar[4].token,
Catches: yyDollar[5].list, Catches: yyDollar[5].list,
Finally: yyDollar[6].node, Finally: yyDollar[6].node,
} }
} }
case 73: case 73:
@ -3418,9 +3418,9 @@ yydefault:
} }
n.Extends = yyDollar[3].node n.Extends = yyDollar[3].node
n.Implements = yyDollar[4].node n.Implements = yyDollar[4].node
n.OpenCurlyBracket = yyDollar[5].token n.OpenCurlyBracketTkn = yyDollar[5].token
n.Stmts = yyDollar[6].list n.Stmts = yyDollar[6].list
n.CloseCurlyBracket = yyDollar[7].token n.CloseCurlyBracketTkn = yyDollar[7].token
case *ast.StmtTrait: case *ast.StmtTrait:
n.Position = yylex.(*Parser).builder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[7].token) n.Position = yylex.(*Parser).builder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[7].token)
n.TraitName = &ast.Identifier{ n.TraitName = &ast.Identifier{
@ -3430,9 +3430,9 @@ yydefault:
} }
n.Extends = yyDollar[3].node n.Extends = yyDollar[3].node
n.Implements = yyDollar[4].node n.Implements = yyDollar[4].node
n.OpenCurlyBracket = yyDollar[5].token n.OpenCurlyBracketTkn = yyDollar[5].token
n.Stmts = yyDollar[6].list n.Stmts = yyDollar[6].list
n.CloseCurlyBracket = yyDollar[7].token n.CloseCurlyBracketTkn = yyDollar[7].token
} }
yyVAL.node = yyDollar[1].node yyVAL.node = yyDollar[1].node
@ -4557,10 +4557,10 @@ yydefault:
// line internal/php5/php5.y:2353 // line internal/php5/php5.y:2353
{ {
yyVAL.node = &ast.StmtStmtList{ yyVAL.node = &ast.StmtStmtList{
Position: yylex.(*Parser).builder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token), Position: yylex.(*Parser).builder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token),
OpenCurlyBracket: yyDollar[1].token, OpenCurlyBracketTkn: yyDollar[1].token,
Stmts: yyDollar[2].list, Stmts: yyDollar[2].list,
CloseCurlyBracket: yyDollar[3].token, CloseCurlyBracketTkn: yyDollar[3].token,
} }
} }
case 198: case 198:
@ -7027,10 +7027,10 @@ yydefault:
// line internal/php5/php5.y:4498 // line internal/php5/php5.y:4498
{ {
yyVAL.node = &ast.ScalarEncapsed{ yyVAL.node = &ast.ScalarEncapsed{
Position: yylex.(*Parser).builder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token), Position: yylex.(*Parser).builder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token),
OpenQoteTkn: yyDollar[1].token, OpenQuoteTkn: yyDollar[1].token,
Parts: yyDollar[2].list, Parts: yyDollar[2].list,
CloseQoteTkn: yyDollar[3].token, CloseQuoteTkn: yyDollar[3].token,
} }
} }
case 419: case 419:

View File

@ -366,19 +366,19 @@ top_statement:
Parts: $2.(*ast.ParserSeparatedList).Items, Parts: $2.(*ast.ParserSeparatedList).Items,
SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns,
}, },
OpenCurlyBracket: $3, OpenCurlyBracketTkn: $3,
Stmts: $4, Stmts: $4,
CloseCurlyBracket: $5, CloseCurlyBracketTkn: $5,
} }
} }
| T_NAMESPACE '{' top_statement_list '}' | T_NAMESPACE '{' top_statement_list '}'
{ {
$$ = &ast.StmtNamespace{ $$ = &ast.StmtNamespace{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), Position: yylex.(*Parser).builder.NewTokensPosition($1, $4),
NsTkn: $1, NsTkn: $1,
OpenCurlyBracket: $2, OpenCurlyBracketTkn: $2,
Stmts: $3, Stmts: $3,
CloseCurlyBracket: $4, CloseCurlyBracketTkn: $4,
} }
} }
| T_USE use_declarations ';' | T_USE use_declarations ';'
@ -769,9 +769,9 @@ unticked_statement:
{ {
$$ = &ast.StmtStmtList{ $$ = &ast.StmtStmtList{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), Position: yylex.(*Parser).builder.NewTokensPosition($1, $3),
OpenCurlyBracket: $1, OpenCurlyBracketTkn: $1,
Stmts: $2, Stmts: $2,
CloseCurlyBracket: $3, CloseCurlyBracketTkn: $3,
} }
} }
| T_IF parenthesis_expr statement elseif_list else_single | T_IF parenthesis_expr statement elseif_list else_single
@ -1045,12 +1045,12 @@ unticked_statement:
$$ = &ast.StmtTry{ $$ = &ast.StmtTry{
Position: pos, Position: pos,
TryTkn: $1, TryTkn: $1,
OpenCurlyBracket: $2, OpenCurlyBracketTkn: $2,
Stmts: $3, Stmts: $3,
CloseCurlyBracket: $4, CloseCurlyBracketTkn: $4,
Catches: $5, Catches: $5,
Finally: $6, Finally: $6,
} }
} }
| T_THROW expr ';' | T_THROW expr ';'
@ -2353,9 +2353,9 @@ method_body:
{ {
$$ = &ast.StmtStmtList{ $$ = &ast.StmtStmtList{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), Position: yylex.(*Parser).builder.NewTokensPosition($1, $3),
OpenCurlyBracket: $1, OpenCurlyBracketTkn: $1,
Stmts: $2, Stmts: $2,
CloseCurlyBracket: $3, CloseCurlyBracketTkn: $3,
} }
} }
; ;
@ -4498,9 +4498,9 @@ scalar:
{ {
$$ = &ast.ScalarEncapsed{ $$ = &ast.ScalarEncapsed{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), Position: yylex.(*Parser).builder.NewTokensPosition($1, $3),
OpenQoteTkn: $1, OpenQuoteTkn: $1,
Parts: $2, Parts: $2,
CloseQoteTkn: $3, CloseQuoteTkn: $3,
} }
} }
| T_START_HEREDOC encaps_list T_END_HEREDOC | T_START_HEREDOC encaps_list T_END_HEREDOC

102
internal/php7/php7.go generated
View File

@ -2730,9 +2730,9 @@ yydefault:
Parts: yyDollar[2].node.(*ast.ParserSeparatedList).Items, Parts: yyDollar[2].node.(*ast.ParserSeparatedList).Items,
SeparatorTkns: yyDollar[2].node.(*ast.ParserSeparatedList).SeparatorTkns, SeparatorTkns: yyDollar[2].node.(*ast.ParserSeparatedList).SeparatorTkns,
}, },
OpenCurlyBracket: yyDollar[3].token, OpenCurlyBracketTkn: yyDollar[3].token,
Stmts: yyDollar[4].list, Stmts: yyDollar[4].list,
CloseCurlyBracket: yyDollar[5].token, CloseCurlyBracketTkn: yyDollar[5].token,
} }
} }
case 95: case 95:
@ -2740,11 +2740,11 @@ yydefault:
// line internal/php7/php7.y:459 // line internal/php7/php7.y:459
{ {
yyVAL.node = &ast.StmtNamespace{ yyVAL.node = &ast.StmtNamespace{
Position: yylex.(*Parser).builder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token), Position: yylex.(*Parser).builder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token),
NsTkn: yyDollar[1].token, NsTkn: yyDollar[1].token,
OpenCurlyBracket: yyDollar[2].token, OpenCurlyBracketTkn: yyDollar[2].token,
Stmts: yyDollar[3].list, Stmts: yyDollar[3].list,
CloseCurlyBracket: yyDollar[4].token, CloseCurlyBracketTkn: yyDollar[4].token,
} }
} }
case 96: case 96:
@ -3127,10 +3127,10 @@ yydefault:
// line internal/php7/php7.y:813 // line internal/php7/php7.y:813
{ {
yyVAL.node = &ast.StmtStmtList{ yyVAL.node = &ast.StmtStmtList{
Position: yylex.(*Parser).builder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token), Position: yylex.(*Parser).builder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token),
OpenCurlyBracket: yyDollar[1].token, OpenCurlyBracketTkn: yyDollar[1].token,
Stmts: yyDollar[2].list, Stmts: yyDollar[2].list,
CloseCurlyBracket: yyDollar[3].token, CloseCurlyBracketTkn: yyDollar[3].token,
} }
} }
case 133: case 133:
@ -3363,13 +3363,13 @@ yydefault:
} }
yyVAL.node = &ast.StmtTry{ yyVAL.node = &ast.StmtTry{
Position: pos, Position: pos,
TryTkn: yyDollar[1].token, TryTkn: yyDollar[1].token,
OpenCurlyBracket: yyDollar[2].token, OpenCurlyBracketTkn: yyDollar[2].token,
Stmts: yyDollar[3].list, Stmts: yyDollar[3].list,
CloseCurlyBracket: yyDollar[4].token, CloseCurlyBracketTkn: yyDollar[4].token,
Catches: yyDollar[5].list, Catches: yyDollar[5].list,
Finally: yyDollar[6].node, Finally: yyDollar[6].node,
} }
} }
case 153: case 153:
@ -3560,11 +3560,11 @@ yydefault:
IdentifierTkn: yyDollar[3].token, IdentifierTkn: yyDollar[3].token,
Value: yyDollar[3].token.Value, Value: yyDollar[3].token.Value,
}, },
Extends: yyDollar[4].node, Extends: yyDollar[4].node,
Implements: yyDollar[5].node, Implements: yyDollar[5].node,
OpenCurlyBracket: yyDollar[7].token, OpenCurlyBracketTkn: yyDollar[7].token,
Stmts: yyDollar[8].list, Stmts: yyDollar[8].list,
CloseCurlyBracket: yyDollar[9].token, CloseCurlyBracketTkn: yyDollar[9].token,
} }
} }
case 171: case 171:
@ -3579,11 +3579,11 @@ yydefault:
IdentifierTkn: yyDollar[2].token, IdentifierTkn: yyDollar[2].token,
Value: yyDollar[2].token.Value, Value: yyDollar[2].token.Value,
}, },
Extends: yyDollar[3].node, Extends: yyDollar[3].node,
Implements: yyDollar[4].node, Implements: yyDollar[4].node,
OpenCurlyBracket: yyDollar[6].token, OpenCurlyBracketTkn: yyDollar[6].token,
Stmts: yyDollar[7].list, Stmts: yyDollar[7].list,
CloseCurlyBracket: yyDollar[8].token, CloseCurlyBracketTkn: yyDollar[8].token,
} }
} }
case 172: case 172:
@ -3630,9 +3630,9 @@ yydefault:
IdentifierTkn: yyDollar[2].token, IdentifierTkn: yyDollar[2].token,
Value: yyDollar[2].token.Value, Value: yyDollar[2].token.Value,
}, },
OpenCurlyBracket: yyDollar[4].token, OpenCurlyBracketTkn: yyDollar[4].token,
Stmts: yyDollar[5].list, Stmts: yyDollar[5].list,
CloseCurlyBracket: yyDollar[6].token, CloseCurlyBracketTkn: yyDollar[6].token,
} }
} }
case 177: case 177:
@ -4614,10 +4614,10 @@ yydefault:
// line internal/php7/php7.y:2191 // line internal/php7/php7.y:2191
{ {
yyVAL.node = &ast.StmtStmtList{ yyVAL.node = &ast.StmtStmtList{
Position: yylex.(*Parser).builder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token), Position: yylex.(*Parser).builder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token),
OpenCurlyBracket: yyDollar[1].token, OpenCurlyBracketTkn: yyDollar[1].token,
Stmts: yyDollar[2].list, Stmts: yyDollar[2].list,
CloseCurlyBracket: yyDollar[3].token, CloseCurlyBracketTkn: yyDollar[3].token,
} }
} }
case 266: case 266:
@ -4878,17 +4878,17 @@ yydefault:
// line internal/php7/php7.y:2441 // line internal/php7/php7.y:2441
{ {
yyVAL.node = &ast.StmtClass{ yyVAL.node = &ast.StmtClass{
Position: yylex.(*Parser).builder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token), Position: yylex.(*Parser).builder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token),
ClassTkn: yyDollar[1].token, ClassTkn: yyDollar[1].token,
OpenParenthesisTkn: yyDollar[2].node.(*ast.ArgumentList).OpenParenthesisTkn, OpenParenthesisTkn: yyDollar[2].node.(*ast.ArgumentList).OpenParenthesisTkn,
Arguments: yyDollar[2].node.(*ast.ArgumentList).Arguments, Arguments: yyDollar[2].node.(*ast.ArgumentList).Arguments,
SeparatorTkns: yyDollar[2].node.(*ast.ArgumentList).SeparatorTkns, SeparatorTkns: yyDollar[2].node.(*ast.ArgumentList).SeparatorTkns,
CloseParenthesisTkn: yyDollar[2].node.(*ast.ArgumentList).CloseParenthesisTkn, CloseParenthesisTkn: yyDollar[2].node.(*ast.ArgumentList).CloseParenthesisTkn,
Extends: yyDollar[3].node, Extends: yyDollar[3].node,
Implements: yyDollar[4].node, Implements: yyDollar[4].node,
OpenCurlyBracket: yyDollar[6].token, OpenCurlyBracketTkn: yyDollar[6].token,
Stmts: yyDollar[7].list, Stmts: yyDollar[7].list,
CloseCurlyBracket: yyDollar[8].token, CloseCurlyBracketTkn: yyDollar[8].token,
} }
} }
case 294: case 294:
@ -6178,10 +6178,10 @@ yydefault:
// line internal/php7/php7.y:3550 // line internal/php7/php7.y:3550
{ {
yyVAL.node = &ast.ScalarEncapsed{ yyVAL.node = &ast.ScalarEncapsed{
Position: yylex.(*Parser).builder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token), Position: yylex.(*Parser).builder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token),
OpenQoteTkn: yyDollar[1].token, OpenQuoteTkn: yyDollar[1].token,
Parts: yyDollar[2].list, Parts: yyDollar[2].list,
CloseQoteTkn: yyDollar[3].token, CloseQuoteTkn: yyDollar[3].token,
} }
} }
case 415: case 415:

View File

@ -450,19 +450,19 @@ top_statement:
Parts: $2.(*ast.ParserSeparatedList).Items, Parts: $2.(*ast.ParserSeparatedList).Items,
SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns,
}, },
OpenCurlyBracket: $3, OpenCurlyBracketTkn: $3,
Stmts: $4, Stmts: $4,
CloseCurlyBracket: $5, CloseCurlyBracketTkn: $5,
} }
} }
| T_NAMESPACE '{' top_statement_list '}' | T_NAMESPACE '{' top_statement_list '}'
{ {
$$ = &ast.StmtNamespace{ $$ = &ast.StmtNamespace{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), Position: yylex.(*Parser).builder.NewTokensPosition($1, $4),
NsTkn: $1, NsTkn: $1,
OpenCurlyBracket: $2, OpenCurlyBracketTkn: $2,
Stmts: $3, Stmts: $3,
CloseCurlyBracket: $4, CloseCurlyBracket: $4,
} }
} }
| T_USE mixed_group_use_declaration ';' | T_USE mixed_group_use_declaration ';'
@ -813,9 +813,9 @@ statement:
{ {
$$ = &ast.StmtStmtList{ $$ = &ast.StmtStmtList{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), Position: yylex.(*Parser).builder.NewTokensPosition($1, $3),
OpenCurlyBracket: $1, OpenCurlyBracketTkn: $1,
Stmts: $2, Stmts: $2,
CloseCurlyBracket: $3, CloseCurlyBracketTkn: $3,
} }
} }
| if_stmt | if_stmt
@ -1009,12 +1009,12 @@ statement:
$$ = &ast.StmtTry{ $$ = &ast.StmtTry{
Position: pos, Position: pos,
TryTkn: $1, TryTkn: $1,
OpenCurlyBracket: $2, OpenCurlyBracketTkn: $2,
Stmts: $3, Stmts: $3,
CloseCurlyBracket: $4, CloseCurlyBracketTkn: $4,
Catches: $5, Catches: $5,
Finally: $6, Finally: $6,
} }
} }
| T_THROW expr ';' | T_THROW expr ';'
@ -1194,11 +1194,11 @@ class_declaration_statement:
IdentifierTkn: $3, IdentifierTkn: $3,
Value: $3.Value, Value: $3.Value,
}, },
Extends: $4, Extends: $4,
Implements: $5, Implements: $5,
OpenCurlyBracket: $7, OpenCurlyBracketTkn: $7,
Stmts: $8, Stmts: $8,
CloseCurlyBracket: $9, CloseCurlyBracketTkn: $9,
} }
} }
| T_CLASS T_STRING extends_from implements_list backup_doc_comment '{' class_statement_list '}' | T_CLASS T_STRING extends_from implements_list backup_doc_comment '{' class_statement_list '}'
@ -1211,11 +1211,11 @@ class_declaration_statement:
IdentifierTkn: $2, IdentifierTkn: $2,
Value: $2.Value, Value: $2.Value,
}, },
Extends: $3, Extends: $3,
Implements: $4, Implements: $4,
OpenCurlyBracket: $6, OpenCurlyBracketTkn: $6,
Stmts: $7, Stmts: $7,
CloseCurlyBracket: $8, CloseCurlyBracketTkn: $8,
} }
} }
; ;
@ -1261,9 +1261,9 @@ trait_declaration_statement:
IdentifierTkn: $2, IdentifierTkn: $2,
Value: $2.Value, Value: $2.Value,
}, },
OpenCurlyBracket: $4, OpenCurlyBracketTkn: $4,
Stmts: $5, Stmts: $5,
CloseCurlyBracket: $6, CloseCurlyBracketTkn: $6,
} }
} }
; ;
@ -2191,9 +2191,9 @@ method_body:
{ {
$$ = &ast.StmtStmtList{ $$ = &ast.StmtStmtList{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), Position: yylex.(*Parser).builder.NewTokensPosition($1, $3),
OpenCurlyBracket: $1, OpenCurlyBracketTkn: $1,
Stmts: $2, Stmts: $2,
CloseCurlyBracket: $3, CloseCurlyBracketTkn: $3,
} }
} }
; ;
@ -2441,16 +2441,16 @@ anonymous_class:
{ {
$$ = &ast.StmtClass{ $$ = &ast.StmtClass{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $8), Position: yylex.(*Parser).builder.NewTokensPosition($1, $8),
ClassTkn: $1, ClassTkn: $1,
OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn,
Arguments: $2.(*ast.ArgumentList).Arguments, Arguments: $2.(*ast.ArgumentList).Arguments,
SeparatorTkns: $2.(*ast.ArgumentList).SeparatorTkns, SeparatorTkns: $2.(*ast.ArgumentList).SeparatorTkns,
CloseParenthesisTkn: $2.(*ast.ArgumentList).CloseParenthesisTkn, CloseParenthesisTkn: $2.(*ast.ArgumentList).CloseParenthesisTkn,
Extends: $3, Extends: $3,
Implements: $4, Implements: $4,
OpenCurlyBracket: $6, OpenCurlyBracketTkn: $6,
Stmts: $7, Stmts: $7,
CloseCurlyBracket: $8, CloseCurlyBracketTkn: $8,
} }
} }
; ;
@ -3550,9 +3550,9 @@ scalar:
{ {
$$ = &ast.ScalarEncapsed{ $$ = &ast.ScalarEncapsed{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), Position: yylex.(*Parser).builder.NewTokensPosition($1, $3),
OpenQoteTkn: $1, OpenQuoteTkn: $1,
Parts: $2, Parts: $2,
CloseQoteTkn: $3, CloseQuoteTkn: $3,
} }
} }
| T_START_HEREDOC encaps_list T_END_HEREDOC | T_START_HEREDOC encaps_list T_END_HEREDOC

View File

@ -102,10 +102,10 @@ func (n *ScalarDnumber) GetPosition() *position.Position {
// ScalarEncapsed node // ScalarEncapsed node
type ScalarEncapsed struct { type ScalarEncapsed struct {
Position *position.Position Position *position.Position
OpenQoteTkn *token.Token OpenQuoteTkn *token.Token
Parts []Vertex Parts []Vertex
CloseQoteTkn *token.Token CloseQuoteTkn *token.Token
} }
func (n *ScalarEncapsed) Accept(v NodeVisitor) { func (n *ScalarEncapsed) Accept(v NodeVisitor) {
@ -250,19 +250,19 @@ func (n *StmtCatch) GetPosition() *position.Position {
// StmtClass node // StmtClass node
type StmtClass struct { type StmtClass struct {
Position *position.Position Position *position.Position
Modifiers []Vertex Modifiers []Vertex
ClassTkn *token.Token ClassTkn *token.Token
ClassName Vertex ClassName Vertex
OpenParenthesisTkn *token.Token OpenParenthesisTkn *token.Token
Arguments []Vertex Arguments []Vertex
SeparatorTkns []*token.Token SeparatorTkns []*token.Token
CloseParenthesisTkn *token.Token CloseParenthesisTkn *token.Token
Extends Vertex Extends Vertex
Implements Vertex Implements Vertex
OpenCurlyBracket *token.Token OpenCurlyBracketTkn *token.Token
Stmts []Vertex Stmts []Vertex
CloseCurlyBracket *token.Token CloseCurlyBracketTkn *token.Token
} }
func (n *StmtClass) Accept(v NodeVisitor) { func (n *StmtClass) Accept(v NodeVisitor) {
@ -761,13 +761,13 @@ func (n *StmtLabel) GetPosition() *position.Position {
// StmtNamespace node // StmtNamespace node
type StmtNamespace struct { type StmtNamespace struct {
Position *position.Position Position *position.Position
NsTkn *token.Token NsTkn *token.Token
Name Vertex Name Vertex
OpenCurlyBracket *token.Token OpenCurlyBracketTkn *token.Token
Stmts []Vertex Stmts []Vertex
CloseCurlyBracket *token.Token CloseCurlyBracketTkn *token.Token
SemiColonTkn *token.Token SemiColonTkn *token.Token
} }
func (n *StmtNamespace) Accept(v NodeVisitor) { func (n *StmtNamespace) Accept(v NodeVisitor) {
@ -877,10 +877,10 @@ func (n *StmtStaticVar) GetPosition() *position.Position {
// StmtStmtList node // StmtStmtList node
type StmtStmtList struct { type StmtStmtList struct {
Position *position.Position Position *position.Position
OpenCurlyBracket *token.Token OpenCurlyBracketTkn *token.Token
Stmts []Vertex Stmts []Vertex
CloseCurlyBracket *token.Token CloseCurlyBracketTkn *token.Token
} }
func (n *StmtStmtList) Accept(v NodeVisitor) { func (n *StmtStmtList) Accept(v NodeVisitor) {
@ -934,14 +934,14 @@ func (n *StmtThrow) GetPosition() *position.Position {
// StmtTrait node // StmtTrait node
type StmtTrait struct { type StmtTrait struct {
Position *position.Position Position *position.Position
TraitTkn *token.Token TraitTkn *token.Token
TraitName Vertex TraitName Vertex
Extends Vertex Extends Vertex
Implements Vertex Implements Vertex
OpenCurlyBracket *token.Token OpenCurlyBracketTkn *token.Token
Stmts []Vertex Stmts []Vertex
CloseCurlyBracket *token.Token CloseCurlyBracketTkn *token.Token
} }
func (n *StmtTrait) Accept(v NodeVisitor) { func (n *StmtTrait) Accept(v NodeVisitor) {
@ -1039,13 +1039,13 @@ func (n *StmtTraitUsePrecedence) GetPosition() *position.Position {
// StmtTry node // StmtTry node
type StmtTry struct { type StmtTry struct {
Position *position.Position Position *position.Position
TryTkn *token.Token TryTkn *token.Token
OpenCurlyBracket *token.Token OpenCurlyBracketTkn *token.Token
Stmts []Vertex Stmts []Vertex
CloseCurlyBracket *token.Token CloseCurlyBracketTkn *token.Token
Catches []Vertex Catches []Vertex
Finally Vertex Finally Vertex
} }
func (n *StmtTry) Accept(v NodeVisitor) { func (n *StmtTry) Accept(v NodeVisitor) {

View File

@ -288,9 +288,9 @@ func (v *Dump) StmtClass(n *ast.StmtClass) {
v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn)
v.dumpVertex("Extends", n.Extends) v.dumpVertex("Extends", n.Extends)
v.dumpVertex("Implements", n.Implements) v.dumpVertex("Implements", n.Implements)
v.dumpToken("OpenCurlyBracket", n.OpenCurlyBracket) v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn)
v.dumpVertexList("Stmts", n.Stmts) v.dumpVertexList("Stmts", n.Stmts)
v.dumpToken("CloseCurlyBracket", n.CloseCurlyBracket) v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn)
v.indent-- v.indent--
v.print(v.indent, "},\n") v.print(v.indent, "},\n")
@ -706,9 +706,9 @@ func (v *Dump) StmtNamespace(n *ast.StmtNamespace) {
v.dumpPosition(n.Position) v.dumpPosition(n.Position)
v.dumpToken("NsTkn", n.NsTkn) v.dumpToken("NsTkn", n.NsTkn)
v.dumpVertex("Name", n.Name) v.dumpVertex("Name", n.Name)
v.dumpToken("OpenCurlyBracket", n.OpenCurlyBracket) v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn)
v.dumpVertexList("Stmts", n.Stmts) v.dumpVertexList("Stmts", n.Stmts)
v.dumpToken("CloseCurlyBracket", n.CloseCurlyBracket) v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn)
v.dumpToken("SemiColonTkn", n.SemiColonTkn) v.dumpToken("SemiColonTkn", n.SemiColonTkn)
v.indent-- v.indent--
@ -799,9 +799,9 @@ func (v *Dump) StmtStmtList(n *ast.StmtStmtList) {
v.indent++ v.indent++
v.dumpPosition(n.Position) v.dumpPosition(n.Position)
v.dumpToken("OpenCurlyBracket", n.OpenCurlyBracket) v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn)
v.dumpVertexList("Stmts", n.Stmts) v.dumpVertexList("Stmts", n.Stmts)
v.dumpToken("CloseCurlyBracket", n.CloseCurlyBracket) v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn)
v.indent-- v.indent--
v.print(v.indent, "},\n") v.print(v.indent, "},\n")
@ -850,9 +850,9 @@ func (v *Dump) StmtTrait(n *ast.StmtTrait) {
v.dumpVertex("TraitName", n.TraitName) v.dumpVertex("TraitName", n.TraitName)
v.dumpVertex("Extends", n.Extends) v.dumpVertex("Extends", n.Extends)
v.dumpVertex("Implements", n.Implements) v.dumpVertex("Implements", n.Implements)
v.dumpToken("OpenCurlyBracket", n.OpenCurlyBracket) v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn)
v.dumpVertexList("Stmts", n.Stmts) v.dumpVertexList("Stmts", n.Stmts)
v.dumpToken("CloseCurlyBracket", n.CloseCurlyBracket) v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn)
v.indent-- v.indent--
v.print(v.indent, "},\n") v.print(v.indent, "},\n")
@ -934,9 +934,9 @@ func (v *Dump) StmtTry(n *ast.StmtTry) {
v.dumpPosition(n.Position) v.dumpPosition(n.Position)
v.dumpToken("TryTkn", n.TryTkn) v.dumpToken("TryTkn", n.TryTkn)
v.dumpToken("OpenCurlyBracket", n.OpenCurlyBracket) v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn)
v.dumpVertexList("Stmts", n.Stmts) v.dumpVertexList("Stmts", n.Stmts)
v.dumpToken("CloseCurlyBracket", n.CloseCurlyBracket) v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn)
v.dumpVertexList("Catches", n.Catches) v.dumpVertexList("Catches", n.Catches)
v.dumpVertex("Finally", n.Finally) v.dumpVertex("Finally", n.Finally)
@ -2236,9 +2236,9 @@ func (v *Dump) ScalarEncapsed(n *ast.ScalarEncapsed) {
v.indent++ v.indent++
v.dumpPosition(n.Position) v.dumpPosition(n.Position)
v.dumpToken("OpenQoteTkn", n.OpenQoteTkn) v.dumpToken("OpenQuoteTkn", n.OpenQuoteTkn)
v.dumpVertexList("Parts", n.Parts) v.dumpVertexList("Parts", n.Parts)
v.dumpToken("CloseQoteTkn", n.CloseQoteTkn) v.dumpToken("CloseQuoteTkn", n.CloseQuoteTkn)
v.indent-- v.indent--
v.print(v.indent, "},\n") v.print(v.indent, "},\n")

View File

@ -13,7 +13,7 @@ import (
func TestDumper_root(t *testing.T) { func TestDumper_root(t *testing.T) {
o := bytes.NewBufferString("") o := bytes.NewBufferString("")
p := visitor.NewDump(o) p := visitor.NewDump(o).WithTokens().WithPositions()
n := &ast.Root{ n := &ast.Root{
Position: &position.Position{ Position: &position.Position{
StartLine: 1, StartLine: 1,

View File

@ -196,9 +196,9 @@ func (p *printer) StmtClass(n *ast.StmtClass) {
p.printToken(n.CloseParenthesisTkn, p.ifNodeList(n.Arguments, []byte(")"))) p.printToken(n.CloseParenthesisTkn, p.ifNodeList(n.Arguments, []byte(")")))
p.printNode(n.Extends) p.printNode(n.Extends)
p.printNode(n.Implements) p.printNode(n.Implements)
p.printToken(n.OpenCurlyBracket, []byte("{")) p.printToken(n.OpenCurlyBracketTkn, []byte("{"))
p.printList(n.Stmts) p.printList(n.Stmts)
p.printToken(n.CloseCurlyBracket, []byte("}")) p.printToken(n.CloseCurlyBracketTkn, []byte("}"))
} }
func (p *printer) StmtClassConstList(n *ast.StmtClassConstList) { func (p *printer) StmtClassConstList(n *ast.StmtClassConstList) {
@ -256,9 +256,9 @@ func (p *printer) StmtDeclare(n *ast.StmtDeclare) {
p.printToken(n.CloseParenthesisTkn, []byte(")")) p.printToken(n.CloseParenthesisTkn, []byte(")"))
p.printToken(n.ColonTkn, nil) p.printToken(n.ColonTkn, nil)
if stmt, ok := n.Stmt.(*ast.StmtStmtList); ok && n.ColonTkn != nil { if stmt, ok := n.Stmt.(*ast.StmtStmtList); ok && n.ColonTkn != nil {
p.printToken(stmt.OpenCurlyBracket, nil) p.printToken(stmt.OpenCurlyBracketTkn, nil)
p.printList(stmt.Stmts) p.printList(stmt.Stmts)
p.printToken(stmt.CloseCurlyBracket, nil) p.printToken(stmt.CloseCurlyBracketTkn, nil)
} else { } else {
p.printNode(n.Stmt) p.printNode(n.Stmt)
} }
@ -293,9 +293,9 @@ func (p *printer) StmtElse(n *ast.StmtElse) {
p.printToken(n.ElseTkn, []byte("else")) p.printToken(n.ElseTkn, []byte("else"))
p.printToken(n.ColonTkn, nil) p.printToken(n.ColonTkn, nil)
if stmt, ok := n.Stmt.(*ast.StmtStmtList); ok && n.ColonTkn != nil { if stmt, ok := n.Stmt.(*ast.StmtStmtList); ok && n.ColonTkn != nil {
p.printToken(stmt.OpenCurlyBracket, nil) p.printToken(stmt.OpenCurlyBracketTkn, nil)
p.printList(stmt.Stmts) p.printList(stmt.Stmts)
p.printToken(stmt.CloseCurlyBracket, nil) p.printToken(stmt.CloseCurlyBracketTkn, nil)
} else { } else {
p.printNode(n.Stmt) p.printNode(n.Stmt)
} }
@ -308,9 +308,9 @@ func (p *printer) StmtElseIf(n *ast.StmtElseIf) {
p.printToken(n.CloseParenthesisTkn, []byte(")")) p.printToken(n.CloseParenthesisTkn, []byte(")"))
p.printToken(n.ColonTkn, nil) p.printToken(n.ColonTkn, nil)
if stmt, ok := n.Stmt.(*ast.StmtStmtList); ok && n.ColonTkn != nil { if stmt, ok := n.Stmt.(*ast.StmtStmtList); ok && n.ColonTkn != nil {
p.printToken(stmt.OpenCurlyBracket, nil) p.printToken(stmt.OpenCurlyBracketTkn, nil)
p.printList(stmt.Stmts) p.printList(stmt.Stmts)
p.printToken(stmt.CloseCurlyBracket, nil) p.printToken(stmt.CloseCurlyBracketTkn, nil)
} else { } else {
p.printNode(n.Stmt) p.printNode(n.Stmt)
} }
@ -339,9 +339,9 @@ func (p *printer) StmtFor(n *ast.StmtFor) {
p.printToken(n.CloseParenthesisTkn, []byte(")")) p.printToken(n.CloseParenthesisTkn, []byte(")"))
p.printToken(n.ColonTkn, nil) p.printToken(n.ColonTkn, nil)
if stmt, ok := n.Stmt.(*ast.StmtStmtList); ok && n.ColonTkn != nil { if stmt, ok := n.Stmt.(*ast.StmtStmtList); ok && n.ColonTkn != nil {
p.printToken(stmt.OpenCurlyBracket, nil) p.printToken(stmt.OpenCurlyBracketTkn, nil)
p.printList(stmt.Stmts) p.printList(stmt.Stmts)
p.printToken(stmt.CloseCurlyBracket, nil) p.printToken(stmt.CloseCurlyBracketTkn, nil)
} else { } else {
p.printNode(n.Stmt) p.printNode(n.Stmt)
} }
@ -360,9 +360,9 @@ func (p *printer) StmtForeach(n *ast.StmtForeach) {
p.printToken(n.CloseParenthesisTkn, []byte(")")) p.printToken(n.CloseParenthesisTkn, []byte(")"))
p.printToken(n.ColonTkn, nil) p.printToken(n.ColonTkn, nil)
if stmt, ok := n.Stmt.(*ast.StmtStmtList); ok && n.ColonTkn != nil { if stmt, ok := n.Stmt.(*ast.StmtStmtList); ok && n.ColonTkn != nil {
p.printToken(stmt.OpenCurlyBracket, nil) p.printToken(stmt.OpenCurlyBracketTkn, nil)
p.printList(stmt.Stmts) p.printList(stmt.Stmts)
p.printToken(stmt.CloseCurlyBracket, nil) p.printToken(stmt.CloseCurlyBracketTkn, nil)
} else { } else {
p.printNode(n.Stmt) p.printNode(n.Stmt)
} }
@ -410,9 +410,9 @@ func (p *printer) StmtIf(n *ast.StmtIf) {
p.printToken(n.CloseParenthesisTkn, []byte(")")) p.printToken(n.CloseParenthesisTkn, []byte(")"))
p.printToken(n.ColonTkn, nil) p.printToken(n.ColonTkn, nil)
if stmt, ok := n.Stmt.(*ast.StmtStmtList); ok && n.ColonTkn != nil { if stmt, ok := n.Stmt.(*ast.StmtStmtList); ok && n.ColonTkn != nil {
p.printToken(stmt.OpenCurlyBracket, nil) p.printToken(stmt.OpenCurlyBracketTkn, nil)
p.printList(stmt.Stmts) p.printList(stmt.Stmts)
p.printToken(stmt.CloseCurlyBracket, nil) p.printToken(stmt.CloseCurlyBracketTkn, nil)
} else { } else {
p.printNode(n.Stmt) p.printNode(n.Stmt)
} }
@ -454,9 +454,9 @@ func (p *printer) StmtLabel(n *ast.StmtLabel) {
func (p *printer) StmtNamespace(n *ast.StmtNamespace) { func (p *printer) StmtNamespace(n *ast.StmtNamespace) {
p.printToken(n.NsTkn, []byte("namespace")) p.printToken(n.NsTkn, []byte("namespace"))
p.printNode(n.Name) p.printNode(n.Name)
p.printToken(n.OpenCurlyBracket, p.ifNodeList(n.Stmts, []byte("{"))) p.printToken(n.OpenCurlyBracketTkn, p.ifNodeList(n.Stmts, []byte("{")))
p.printList(n.Stmts) p.printList(n.Stmts)
p.printToken(n.CloseCurlyBracket, p.ifNodeList(n.Stmts, []byte("}"))) p.printToken(n.CloseCurlyBracketTkn, p.ifNodeList(n.Stmts, []byte("}")))
p.printToken(n.SemiColonTkn, p.ifNotNodeList(n.Stmts, []byte(";"))) p.printToken(n.SemiColonTkn, p.ifNotNodeList(n.Stmts, []byte(";")))
} }
@ -496,9 +496,9 @@ func (p *printer) StmtStaticVar(n *ast.StmtStaticVar) {
} }
func (p *printer) StmtStmtList(n *ast.StmtStmtList) { func (p *printer) StmtStmtList(n *ast.StmtStmtList) {
p.printToken(n.OpenCurlyBracket, []byte("{")) p.printToken(n.OpenCurlyBracketTkn, []byte("{"))
p.printList(n.Stmts) p.printList(n.Stmts)
p.printToken(n.CloseCurlyBracket, []byte("}")) p.printToken(n.CloseCurlyBracketTkn, []byte("}"))
} }
func (p *printer) StmtSwitch(n *ast.StmtSwitch) { func (p *printer) StmtSwitch(n *ast.StmtSwitch) {
@ -526,9 +526,9 @@ func (p *printer) StmtTrait(n *ast.StmtTrait) {
p.printNode(n.TraitName) p.printNode(n.TraitName)
p.printNode(n.Extends) p.printNode(n.Extends)
p.printNode(n.Implements) p.printNode(n.Implements)
p.printToken(n.OpenCurlyBracket, []byte("{")) p.printToken(n.OpenCurlyBracketTkn, []byte("{"))
p.printList(n.Stmts) p.printList(n.Stmts)
p.printToken(n.CloseCurlyBracket, []byte("}")) p.printToken(n.CloseCurlyBracketTkn, []byte("}"))
} }
func (p *printer) StmtTraitAdaptationList(n *ast.StmtTraitAdaptationList) { func (p *printer) StmtTraitAdaptationList(n *ast.StmtTraitAdaptationList) {
@ -566,9 +566,9 @@ func (p *printer) StmtTraitUsePrecedence(n *ast.StmtTraitUsePrecedence) {
func (p *printer) StmtTry(n *ast.StmtTry) { func (p *printer) StmtTry(n *ast.StmtTry) {
p.printToken(n.TryTkn, []byte("try")) p.printToken(n.TryTkn, []byte("try"))
p.printToken(n.OpenCurlyBracket, []byte("{")) p.printToken(n.OpenCurlyBracketTkn, []byte("{"))
p.printList(n.Stmts) p.printList(n.Stmts)
p.printToken(n.CloseCurlyBracket, []byte("}")) p.printToken(n.CloseCurlyBracketTkn, []byte("}"))
p.printList(n.Catches) p.printList(n.Catches)
p.printNode(n.Finally) p.printNode(n.Finally)
} }
@ -615,9 +615,9 @@ func (p *printer) StmtWhile(n *ast.StmtWhile) {
p.printToken(n.CloseParenthesisTkn, []byte(")")) p.printToken(n.CloseParenthesisTkn, []byte(")"))
p.printToken(n.ColonTkn, nil) p.printToken(n.ColonTkn, nil)
if stmt, ok := n.Stmt.(*ast.StmtStmtList); ok && n.ColonTkn != nil { if stmt, ok := n.Stmt.(*ast.StmtStmtList); ok && n.ColonTkn != nil {
p.printToken(stmt.OpenCurlyBracket, nil) p.printToken(stmt.OpenCurlyBracketTkn, nil)
p.printList(stmt.Stmts) p.printList(stmt.Stmts)
p.printToken(stmt.CloseCurlyBracket, nil) p.printToken(stmt.CloseCurlyBracketTkn, nil)
} else { } else {
p.printNode(n.Stmt) p.printNode(n.Stmt)
} }
@ -1181,9 +1181,9 @@ func (p *printer) ScalarDnumber(n *ast.ScalarDnumber) {
} }
func (p *printer) ScalarEncapsed(n *ast.ScalarEncapsed) { func (p *printer) ScalarEncapsed(n *ast.ScalarEncapsed) {
p.printToken(n.OpenQoteTkn, []byte("\"")) p.printToken(n.OpenQuoteTkn, []byte("\""))
p.printList(n.Parts) p.printList(n.Parts)
p.printToken(n.CloseQoteTkn, []byte("\"")) p.printToken(n.CloseQuoteTkn, []byte("\""))
} }
func (p *printer) ScalarEncapsedStringPart(n *ast.ScalarEncapsedStringPart) { func (p *printer) ScalarEncapsedStringPart(n *ast.ScalarEncapsedStringPart) {