[refactoring] fix typo
This commit is contained in:
parent
45ded326d0
commit
5291529a37
BIN
internal/php5/php5.go
generated
BIN
internal/php5/php5.go
generated
Binary file not shown.
@ -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
|
||||||
|
BIN
internal/php7/php7.go
generated
BIN
internal/php7/php7.go
generated
Binary file not shown.
@ -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
|
||||||
|
@ -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) {
|
||||||
|
@ -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")
|
||||||
|
@ -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,
|
||||||
|
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user