From feebb017c47fe71b7b509da3eb1666b92645afee Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Mon, 3 Aug 2020 21:22:53 +0200 Subject: [PATCH] [refactoring] update `use` ast structure --- internal/php5/parser_test.go | 897 ++++++----- internal/php5/php5.go | Bin 333216 -> 332402 bytes internal/php5/php5.y | 97 +- internal/php5/php5_test.go | 896 ++++++----- internal/php7/parser_test.go | 1623 +++++++++++-------- internal/php7/php7.go | Bin 273775 -> 273828 bytes internal/php7/php7.y | 103 +- internal/php7/php7_test.go | 1624 ++++++++++++-------- pkg/ast/ast.go | 4 +- pkg/ast/node.go | 52 +- pkg/ast/traverser/dfs.go | 90 +- pkg/ast/visitor/dump.go | 24 +- pkg/ast/visitor/namespace_resolver.go | 62 +- pkg/ast/visitor/namespace_resolver_test.go | 161 +- pkg/ast/visitor/null.go | 16 +- pkg/printer/pretty_printer.go | 80 +- pkg/printer/pretty_printer_test.go | 113 +- pkg/printer/printer.go | 182 ++- pkg/printer/printer_test.go | 115 +- pkg/token/position.go | 1 - pkg/token/position_string.go | 151 +- 21 files changed, 3610 insertions(+), 2681 deletions(-) diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index dcb70ae..b210323 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -11442,7 +11442,7 @@ func TestStmtUse(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -11451,17 +11451,17 @@ func TestStmtUse(t *testing.T) { EndPos: 11, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -11470,17 +11470,27 @@ func TestStmtUse(t *testing.T) { EndPos: 10, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, }, @@ -11510,7 +11520,7 @@ func TestStmtUse_FullyQualified(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -11519,17 +11529,17 @@ func TestStmtUse_FullyQualified(t *testing.T) { EndPos: 12, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 8, - EndPos: 11, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 11, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -11538,17 +11548,27 @@ func TestStmtUse_FullyQualified(t *testing.T) { EndPos: 11, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 8, - EndPos: 11, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 11, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 11, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, }, @@ -11578,7 +11598,7 @@ func TestStmtUse_FullyQualifiedAlias(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -11587,49 +11607,59 @@ func TestStmtUse_FullyQualifiedAlias(t *testing.T) { EndPos: 19, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 8, - EndPos: 18, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 18, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 8, - EndPos: 11, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 8, - EndPos: 11, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 15, EndPos: 18, }, }, - Value: []byte("Bar"), + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 11, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 11, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 15, + EndPos: 18, + }, + }, + Value: []byte("Bar"), + }, }, }, }, @@ -11657,7 +11687,7 @@ func TestStmtUse_List(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -11666,17 +11696,17 @@ func TestStmtUse_List(t *testing.T) { EndPos: 16, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 15, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -11685,31 +11715,31 @@ func TestStmtUse_List(t *testing.T) { EndPos: 10, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 15, - }, - }, - Use: &ast.NameName{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -11718,17 +11748,27 @@ func TestStmtUse_List(t *testing.T) { EndPos: 15, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 15, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 15, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 15, + }, + }, + Value: []byte("Bar"), }, - Value: []byte("Bar"), }, }, }, @@ -11758,7 +11798,7 @@ func TestStmtUse_ListAlias(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -11767,17 +11807,17 @@ func TestStmtUse_ListAlias(t *testing.T) { EndPos: 23, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 22, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -11786,63 +11826,73 @@ func TestStmtUse_ListAlias(t *testing.T) { EndPos: 10, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 22, - }, - }, - Use: &ast.NameName{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 12, - EndPos: 15, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 15, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 19, EndPos: 22, }, }, - Value: []byte("Baz"), + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 15, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 15, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 19, + EndPos: 22, + }, + }, + Value: []byte("Baz"), + }, }, }, }, @@ -11870,7 +11920,7 @@ func TestStmtUse_ListFunctionType(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -11879,38 +11929,46 @@ func TestStmtUse_ListFunctionType(t *testing.T) { EndPos: 26, }, }, - UseType: &ast.Identifier{ + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, - EndPos: 15, + EndPos: 25, }, }, - Value: []byte("function"), - }, - Uses: []ast.Vertex{ - &ast.StmtUse{ + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 15, + }, + }, + Value: []byte("function"), + }, + Use: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 16, - EndPos: 19, + EndPos: 25, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 16, - EndPos: 19, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 19, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -11919,31 +11977,31 @@ func TestStmtUse_ListFunctionType(t *testing.T) { EndPos: 19, }, }, - Value: []byte("Foo"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 19, + }, + }, + Value: []byte("Foo"), + }, + }, }, }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 22, - EndPos: 25, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 22, - EndPos: 25, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 22, + EndPos: 25, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -11952,7 +12010,19 @@ func TestStmtUse_ListFunctionType(t *testing.T) { EndPos: 25, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 22, + EndPos: 25, + }, + }, + Value: []byte("Bar"), + }, + }, }, }, }, @@ -11982,7 +12052,7 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -11991,38 +12061,46 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { EndPos: 40, }, }, - UseType: &ast.Identifier{ + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, - EndPos: 15, + EndPos: 39, }, }, - Value: []byte("function"), - }, - Uses: []ast.Vertex{ - &ast.StmtUse{ + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 15, + }, + }, + Value: []byte("function"), + }, + Use: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 16, - EndPos: 26, + EndPos: 39, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 16, - EndPos: 19, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 26, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12031,42 +12109,42 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { EndPos: 19, }, }, - Value: []byte("Foo"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 19, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 23, + EndPos: 26, + }, + }, + Value: []byte("foo"), }, }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 23, - EndPos: 26, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 39, + }, }, - }, - Value: []byte("foo"), - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 39, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 32, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12075,21 +12153,33 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { EndPos: 32, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 32, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 36, + EndPos: 39, + }, + }, + Value: []byte("bar"), }, }, }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 36, - EndPos: 39, - }, - }, - Value: []byte("bar"), - }, }, }, }, @@ -12116,7 +12206,7 @@ func TestStmtUse_ListConstType(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12125,38 +12215,47 @@ func TestStmtUse_ListConstType(t *testing.T) { EndPos: 23, }, }, - UseType: &ast.Identifier{ + + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, - EndPos: 12, + EndPos: 22, }, }, - Value: []byte("const"), - }, - Uses: []ast.Vertex{ - &ast.StmtUse{ + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 12, + }, + }, + Value: []byte("const"), + }, + Use: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 13, - EndPos: 16, + EndPos: 22, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 13, - EndPos: 16, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 16, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12165,31 +12264,31 @@ func TestStmtUse_ListConstType(t *testing.T) { EndPos: 16, }, }, - Value: []byte("Foo"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 16, + }, + }, + Value: []byte("Foo"), + }, + }, }, }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 19, - EndPos: 22, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 19, - EndPos: 22, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 19, + EndPos: 22, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12198,7 +12297,19 @@ func TestStmtUse_ListConstType(t *testing.T) { EndPos: 22, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 19, + EndPos: 22, + }, + }, + Value: []byte("Bar"), + }, + }, }, }, }, @@ -12228,7 +12339,7 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12237,38 +12348,46 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { EndPos: 37, }, }, - UseType: &ast.Identifier{ + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, - EndPos: 12, + EndPos: 36, }, }, - Value: []byte("const"), - }, - Uses: []ast.Vertex{ - &ast.StmtUse{ + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 12, + }, + }, + Value: []byte("const"), + }, + Use: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 13, - EndPos: 23, + EndPos: 36, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 13, - EndPos: 16, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 23, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12277,42 +12396,42 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { EndPos: 16, }, }, - Value: []byte("Foo"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 16, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 20, + EndPos: 23, + }, + }, + Value: []byte("foo"), }, }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 20, - EndPos: 23, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 26, + EndPos: 36, + }, }, - }, - Value: []byte("foo"), - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 26, - EndPos: 36, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 26, - EndPos: 29, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12321,21 +12440,33 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { EndPos: 29, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 26, + EndPos: 29, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 33, + EndPos: 36, + }, + }, + Value: []byte("bar"), }, }, }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 33, - EndPos: 36, - }, - }, - Value: []byte("bar"), - }, }, }, }, diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 162c38257aff062d8a898e9dbc2cce8a38d5a841..7a695b705f4fc19c926cd96b45f73dc97d44ff07 100644 GIT binary patch delta 10034 zcmdT~XL!{`_I~Ef+>nHp1PBmHZV(WWa!Yb^FGYetLMJqp9u}hnDM3KQLeLd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y @@ -428,49 +428,56 @@ top_statement: } | T_USE use_declarations ';' { - $$ = &ast.StmtUseList{ast.Node{}, nil, $2} + useList := &ast.StmtUseList{ast.Node{}, $2} + $$ = &ast.StmtUse{ast.Node{}, useList} // save position + useList.GetNode().Position = position.NewNodeListPosition($2) $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.UseDeclarationList, $3.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_USE T_FUNCTION use_function_declarations ';' { - useType := &ast.Identifier{ast.Node{}, $2.Value} - $$ = &ast.StmtUseList{ast.Node{}, useType, $3} + identifier := &ast.Identifier{ast.Node{}, $2.Value} + useList := &ast.StmtUseList{ast.Node{}, $3} + useType := &ast.StmtUseType{ast.Node{}, identifier, useList} + $$ = &ast.StmtUse{ast.Node{}, useType} // save position - useType.GetNode().Position = position.NewTokenPosition($2) + identifier.GetNode().Position = position.NewTokenPosition($2) + useList.GetNode().Position = position.NewNodeListPosition($3) + useType.GetNode().Position = position.NewTokenNodePosition($2, useList) $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments + yylex.(*Parser).setFreeFloating(identifier, token.Start, $2.Tokens) yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(useType, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.UseDeclarationList, $4.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $4.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_USE T_CONST use_const_declarations ';' { - useType := &ast.Identifier{ast.Node{}, $2.Value} - $$ = &ast.StmtUseList{ast.Node{}, useType, $3} + identifier := &ast.Identifier{ast.Node{}, $2.Value} + useList := &ast.StmtUseList{ast.Node{}, $3} + useType := &ast.StmtUseType{ast.Node{}, identifier, useList} + $$ = &ast.StmtUse{ast.Node{}, useType} // save position - useType.GetNode().Position = position.NewTokenPosition($2) + identifier.GetNode().Position = position.NewTokenPosition($2) + useList.GetNode().Position = position.NewNodeListPosition($3) + useType.GetNode().Position = position.NewTokenNodePosition($2, useList) $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments + yylex.(*Parser).setFreeFloating(identifier, token.Start, $2.Tokens) yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(useType, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.UseDeclarationList, $4.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $4.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -511,22 +518,19 @@ use_declaration: namespace_name { name := &ast.NameName{ast.Node{}, $1} - $$ = &ast.StmtUse{ast.Node{}, nil, name, nil} + $$ = &ast.StmtUseDeclaration{ast.Node{}, name, nil} // save position name.GetNode().Position = position.NewNodeListPosition($1) $$.GetNode().Position = position.NewNodeListPosition($1) - // save comments - yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | namespace_name T_AS T_STRING { name := &ast.NameName{ast.Node{}, $1} alias := &ast.Identifier{ast.Node{}, $3.Value} - $$ = &ast.StmtUse{ast.Node{}, nil, name, alias} + $$ = &ast.StmtUseDeclaration{ast.Node{}, name, alias} // save position name.GetNode().Position = position.NewNodeListPosition($1) @@ -534,7 +538,6 @@ use_declaration: $$.GetNode().Position = position.NewNodeListTokenPosition($1, $3) // save comments - yylex.(*Parser).MoveFreeFloating($1[0], $$) yylex.(*Parser).setFreeFloating(name, token.End, $2.Tokens) yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Tokens) @@ -543,16 +546,14 @@ use_declaration: | T_NS_SEPARATOR namespace_name { name := &ast.NameName{ast.Node{}, $2} - $$ = &ast.StmtUse{ast.Node{}, nil, name, nil} + $$ = &ast.StmtUseDeclaration{ast.Node{}, name, nil} // save position name.GetNode().Position = position.NewNodeListPosition($2) $$.GetNode().Position = position.NewNodeListPosition($2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.Slash, $1.Tokens) - yylex.(*Parser).MoveFreeFloating($2[0], name) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -560,7 +561,7 @@ use_declaration: { name := &ast.NameName{ast.Node{}, $2} alias := &ast.Identifier{ast.Node{}, $4.Value} - $$ = &ast.StmtUse{ast.Node{}, nil, name, alias} + $$ = &ast.StmtUseDeclaration{ast.Node{}, name, alias} // save position name.GetNode().Position = position.NewNodeListPosition($2) @@ -568,9 +569,7 @@ use_declaration: $$.GetNode().Position = position.NewNodeListTokenPosition($2, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.Slash, $1.Tokens) - yylex.(*Parser).MoveFreeFloating($2[0], name) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) yylex.(*Parser).setFreeFloating(name, token.End, $3.Tokens) yylex.(*Parser).setFreeFloating(alias, token.Start, $4.Tokens) @@ -600,22 +599,19 @@ use_function_declaration: namespace_name { name := &ast.NameName{ast.Node{}, $1} - $$ = &ast.StmtUse{ast.Node{}, nil, name, nil} + $$ = &ast.StmtUseDeclaration{ast.Node{}, name, nil} // save position name.GetNode().Position = position.NewNodeListPosition($1) $$.GetNode().Position = position.NewNodeListPosition($1) - // save comments - yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | namespace_name T_AS T_STRING { name := &ast.NameName{ast.Node{}, $1} alias := &ast.Identifier{ast.Node{}, $3.Value} - $$ = &ast.StmtUse{ast.Node{}, nil, name, alias} + $$ = &ast.StmtUseDeclaration{ast.Node{}, name, alias} // save position name.GetNode().Position = position.NewNodeListPosition($1) @@ -623,7 +619,6 @@ use_function_declaration: $$.GetNode().Position = position.NewNodeListTokenPosition($1, $3) // save comments - yylex.(*Parser).MoveFreeFloating($1[0], $$) yylex.(*Parser).setFreeFloating(name, token.End, $2.Tokens) yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Tokens) @@ -632,16 +627,14 @@ use_function_declaration: | T_NS_SEPARATOR namespace_name { name := &ast.NameName{ast.Node{}, $2} - $$ = &ast.StmtUse{ast.Node{}, nil, name, nil} + $$ = &ast.StmtUseDeclaration{ast.Node{}, name, nil} // save position name.GetNode().Position = position.NewNodeListPosition($2) $$.GetNode().Position = position.NewNodeListPosition($2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.Slash, $1.Tokens) - yylex.(*Parser).MoveFreeFloating($2[0], name) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -649,7 +642,7 @@ use_function_declaration: { name := &ast.NameName{ast.Node{}, $2} alias := &ast.Identifier{ast.Node{}, $4.Value} - $$ = &ast.StmtUse{ast.Node{}, nil, name, alias} + $$ = &ast.StmtUseDeclaration{ast.Node{}, name, alias} // save position name.GetNode().Position = position.NewNodeListPosition($2) @@ -657,9 +650,7 @@ use_function_declaration: $$.GetNode().Position = position.NewNodeListTokenPosition($2, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.Slash, $1.Tokens) - yylex.(*Parser).MoveFreeFloating($2[0], name) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) yylex.(*Parser).setFreeFloating(name, token.End, $3.Tokens) yylex.(*Parser).setFreeFloating(alias, token.Start, $4.Tokens) @@ -689,22 +680,19 @@ use_const_declaration: namespace_name { name := &ast.NameName{ast.Node{}, $1} - $$ = &ast.StmtUse{ast.Node{}, nil, name, nil} + $$ = &ast.StmtUseDeclaration{ast.Node{}, name, nil} // save position name.GetNode().Position = position.NewNodeListPosition($1) $$.GetNode().Position = position.NewNodeListPosition($1) - // save comments - yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | namespace_name T_AS T_STRING { name := &ast.NameName{ast.Node{}, $1} alias := &ast.Identifier{ast.Node{}, $3.Value} - $$ = &ast.StmtUse{ast.Node{}, nil, name, alias} + $$ = &ast.StmtUseDeclaration{ast.Node{}, name, alias} // save position name.GetNode().Position = position.NewNodeListPosition($1) @@ -712,7 +700,6 @@ use_const_declaration: $$.GetNode().Position = position.NewNodeListTokenPosition($1, $3) // save comments - yylex.(*Parser).MoveFreeFloating($1[0], $$) yylex.(*Parser).setFreeFloating(name, token.End, $2.Tokens) yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Tokens) @@ -721,16 +708,14 @@ use_const_declaration: | T_NS_SEPARATOR namespace_name { name := &ast.NameName{ast.Node{}, $2} - $$ = &ast.StmtUse{ast.Node{}, nil, name, nil} + $$ = &ast.StmtUseDeclaration{ast.Node{}, name, nil} // save position name.GetNode().Position = position.NewNodeListPosition($2) $$.GetNode().Position = position.NewNodeListPosition($2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.Slash, $1.Tokens) - yylex.(*Parser).MoveFreeFloating($2[0], name) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -738,7 +723,7 @@ use_const_declaration: { name := &ast.NameName{ast.Node{}, $2} alias := &ast.Identifier{ast.Node{}, $4.Value} - $$ = &ast.StmtUse{ast.Node{}, nil, name, alias} + $$ = &ast.StmtUseDeclaration{ast.Node{}, name, alias} // save position name.GetNode().Position = position.NewNodeListPosition($2) @@ -746,9 +731,7 @@ use_const_declaration: $$.GetNode().Position = position.NewNodeListTokenPosition($2, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.Slash, $1.Tokens) - yylex.(*Parser).MoveFreeFloating($2[0], name) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) yylex.(*Parser).setFreeFloating(name, token.End, $3.Tokens) yylex.(*Parser).setFreeFloating(alias, token.Start, $4.Tokens) diff --git a/internal/php5/php5_test.go b/internal/php5/php5_test.go index d36ab6d..7c4c4c6 100644 --- a/internal/php5/php5_test.go +++ b/internal/php5/php5_test.go @@ -8525,7 +8525,7 @@ func TestPhp5(t *testing.T) { }, }, }, - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 154, @@ -8534,17 +8534,17 @@ func TestPhp5(t *testing.T) { EndPos: 3289, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 154, - EndLine: 154, - StartPos: 3285, - EndPos: 3288, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 154, + EndLine: 154, + StartPos: 3285, + EndPos: 3288, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 154, @@ -8553,24 +8553,34 @@ func TestPhp5(t *testing.T) { EndPos: 3288, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 154, - EndLine: 154, - StartPos: 3285, - EndPos: 3288, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 154, + EndLine: 154, + StartPos: 3285, + EndPos: 3288, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 154, + EndLine: 154, + StartPos: 3285, + EndPos: 3288, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, }, }, }, }, - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 155, @@ -8579,17 +8589,17 @@ func TestPhp5(t *testing.T) { EndPos: 3299, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3295, - EndPos: 3298, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3295, + EndPos: 3298, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 155, @@ -8598,24 +8608,34 @@ func TestPhp5(t *testing.T) { EndPos: 3298, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3295, - EndPos: 3298, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3295, + EndPos: 3298, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3295, + EndPos: 3298, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, }, }, }, }, - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 156, @@ -8624,54 +8644,64 @@ func TestPhp5(t *testing.T) { EndPos: 3316, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3305, - EndPos: 3315, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3305, + EndPos: 3315, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 156, EndLine: 156, StartPos: 3305, - EndPos: 3308, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3305, - EndPos: 3308, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3312, EndPos: 3315, }, }, - Value: []byte("Bar"), + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3305, + EndPos: 3308, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3305, + EndPos: 3308, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3312, + EndPos: 3315, + }, + }, + Value: []byte("Bar"), + }, }, }, }, }, - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 157, @@ -8680,17 +8710,17 @@ func TestPhp5(t *testing.T) { EndPos: 3330, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3321, - EndPos: 3324, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3321, + EndPos: 3329, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 157, @@ -8699,31 +8729,31 @@ func TestPhp5(t *testing.T) { EndPos: 3324, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3321, - EndPos: 3324, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3321, + EndPos: 3324, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3321, + EndPos: 3324, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3326, - EndPos: 3329, - }, - }, - Use: &ast.NameName{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 157, @@ -8732,24 +8762,34 @@ func TestPhp5(t *testing.T) { EndPos: 3329, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3326, - EndPos: 3329, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3326, + EndPos: 3329, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3326, + EndPos: 3329, + }, + }, + Value: []byte("Bar"), }, - Value: []byte("Bar"), }, }, }, }, }, }, - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 158, @@ -8758,17 +8798,17 @@ func TestPhp5(t *testing.T) { EndPos: 3351, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 158, - EndLine: 158, - StartPos: 3335, - EndPos: 3338, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3335, + EndPos: 3350, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 158, @@ -8777,68 +8817,78 @@ func TestPhp5(t *testing.T) { EndPos: 3338, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 158, - EndLine: 158, - StartPos: 3335, - EndPos: 3338, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3335, + EndPos: 3338, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3335, + EndPos: 3338, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 158, - EndLine: 158, - StartPos: 3340, - EndPos: 3350, - }, - }, - Use: &ast.NameName{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 158, EndLine: 158, StartPos: 3340, - EndPos: 3343, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 158, - EndLine: 158, - StartPos: 3340, - EndPos: 3343, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 158, - EndLine: 158, - StartPos: 3347, EndPos: 3350, }, }, - Value: []byte("Baz"), + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3340, + EndPos: 3343, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3340, + EndPos: 3343, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3347, + EndPos: 3350, + }, + }, + Value: []byte("Baz"), + }, }, }, }, }, - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 159, @@ -8847,38 +8897,46 @@ func TestPhp5(t *testing.T) { EndPos: 3375, }, }, - UseType: &ast.Identifier{ + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 159, EndLine: 159, StartPos: 3356, - EndPos: 3364, + EndPos: 3374, }, }, - Value: []byte("function"), - }, - Uses: []ast.Vertex{ - &ast.StmtUse{ + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3356, + EndPos: 3364, + }, + }, + Value: []byte("function"), + }, + Use: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 159, EndLine: 159, StartPos: 3365, - EndPos: 3368, + EndPos: 3374, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3365, - EndPos: 3368, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3365, + EndPos: 3368, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 159, @@ -8887,31 +8945,31 @@ func TestPhp5(t *testing.T) { EndPos: 3368, }, }, - Value: []byte("Foo"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3365, + EndPos: 3368, + }, + }, + Value: []byte("Foo"), + }, + }, }, }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3371, - EndPos: 3374, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3371, - EndPos: 3374, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3371, + EndPos: 3374, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 159, @@ -8920,14 +8978,26 @@ func TestPhp5(t *testing.T) { EndPos: 3374, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3371, + EndPos: 3374, + }, + }, + Value: []byte("Bar"), + }, + }, }, }, }, }, }, }, - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 160, @@ -8936,38 +9006,46 @@ func TestPhp5(t *testing.T) { EndPos: 3413, }, }, - UseType: &ast.Identifier{ + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 160, EndLine: 160, StartPos: 3380, - EndPos: 3388, + EndPos: 3412, }, }, - Value: []byte("function"), - }, - Uses: []ast.Vertex{ - &ast.StmtUse{ + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3380, + EndPos: 3388, + }, + }, + Value: []byte("function"), + }, + Use: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 160, EndLine: 160, StartPos: 3389, - EndPos: 3399, + EndPos: 3412, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 160, - EndLine: 160, - StartPos: 3389, - EndPos: 3392, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3389, + EndPos: 3399, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 160, @@ -8976,42 +9054,42 @@ func TestPhp5(t *testing.T) { EndPos: 3392, }, }, - Value: []byte("Foo"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3389, + EndPos: 3392, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3396, + EndPos: 3399, + }, + }, + Value: []byte("foo"), }, }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 160, - EndLine: 160, - StartPos: 3396, - EndPos: 3399, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3402, + EndPos: 3412, + }, }, - }, - Value: []byte("foo"), - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 160, - EndLine: 160, - StartPos: 3402, - EndPos: 3412, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 160, - EndLine: 160, - StartPos: 3402, - EndPos: 3405, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 160, @@ -9020,25 +9098,37 @@ func TestPhp5(t *testing.T) { EndPos: 3405, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3402, + EndPos: 3405, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3409, + EndPos: 3412, + }, + }, + Value: []byte("bar"), }, }, }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 160, - EndLine: 160, - StartPos: 3409, - EndPos: 3412, - }, - }, - Value: []byte("bar"), - }, }, }, }, - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 161, @@ -9047,38 +9137,46 @@ func TestPhp5(t *testing.T) { EndPos: 3434, }, }, - UseType: &ast.Identifier{ + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 161, EndLine: 161, StartPos: 3418, - EndPos: 3423, + EndPos: 3433, }, }, - Value: []byte("const"), - }, - Uses: []ast.Vertex{ - &ast.StmtUse{ + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3418, + EndPos: 3423, + }, + }, + Value: []byte("const"), + }, + Use: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 161, EndLine: 161, StartPos: 3424, - EndPos: 3427, + EndPos: 3433, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3424, - EndPos: 3427, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3424, + EndPos: 3427, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 161, @@ -9087,31 +9185,31 @@ func TestPhp5(t *testing.T) { EndPos: 3427, }, }, - Value: []byte("Foo"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3424, + EndPos: 3427, + }, + }, + Value: []byte("Foo"), + }, + }, }, }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3430, - EndPos: 3433, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3430, - EndPos: 3433, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3430, + EndPos: 3433, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 161, @@ -9120,14 +9218,26 @@ func TestPhp5(t *testing.T) { EndPos: 3433, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3430, + EndPos: 3433, + }, + }, + Value: []byte("Bar"), + }, + }, }, }, }, }, }, }, - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 162, @@ -9136,38 +9246,46 @@ func TestPhp5(t *testing.T) { EndPos: 3469, }, }, - UseType: &ast.Identifier{ + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 162, EndLine: 162, StartPos: 3439, - EndPos: 3444, + EndPos: 3468, }, }, - Value: []byte("const"), - }, - Uses: []ast.Vertex{ - &ast.StmtUse{ + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3439, + EndPos: 3444, + }, + }, + Value: []byte("const"), + }, + Use: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 162, EndLine: 162, StartPos: 3445, - EndPos: 3455, + EndPos: 3468, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3445, - EndPos: 3448, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3445, + EndPos: 3455, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 162, @@ -9176,42 +9294,42 @@ func TestPhp5(t *testing.T) { EndPos: 3448, }, }, - Value: []byte("Foo"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3445, + EndPos: 3448, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3452, + EndPos: 3455, + }, + }, + Value: []byte("foo"), }, }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3452, - EndPos: 3455, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3458, + EndPos: 3468, + }, }, - }, - Value: []byte("foo"), - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3458, - EndPos: 3468, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3458, - EndPos: 3461, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 162, @@ -9220,21 +9338,33 @@ func TestPhp5(t *testing.T) { EndPos: 3461, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3458, + EndPos: 3461, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3465, + EndPos: 3468, + }, + }, + Value: []byte("bar"), }, }, }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3465, - EndPos: 3468, - }, - }, - Value: []byte("bar"), - }, }, }, }, diff --git a/internal/php7/parser_test.go b/internal/php7/parser_test.go index 47a0eca..22f0676 100644 --- a/internal/php7/parser_test.go +++ b/internal/php7/parser_test.go @@ -12422,7 +12422,7 @@ func TestStmtUse(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12431,17 +12431,17 @@ func TestStmtUse(t *testing.T) { EndPos: 11, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12450,17 +12450,27 @@ func TestStmtUse(t *testing.T) { EndPos: 10, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, }, @@ -12490,7 +12500,7 @@ func TestStmtUse_FullyQualified(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12499,17 +12509,17 @@ func TestStmtUse_FullyQualified(t *testing.T) { EndPos: 12, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 8, - EndPos: 11, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 11, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12518,17 +12528,27 @@ func TestStmtUse_FullyQualified(t *testing.T) { EndPos: 11, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 8, - EndPos: 11, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 11, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 11, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, }, @@ -12558,7 +12578,7 @@ func TestStmtUse_FullyQualifiedAlias(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12567,49 +12587,59 @@ func TestStmtUse_FullyQualifiedAlias(t *testing.T) { EndPos: 19, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 8, - EndPos: 18, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 18, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 8, - EndPos: 11, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 8, - EndPos: 11, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 15, EndPos: 18, }, }, - Value: []byte("Bar"), + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 11, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 11, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 15, + EndPos: 18, + }, + }, + Value: []byte("Bar"), + }, }, }, }, @@ -12637,7 +12667,7 @@ func TestStmtUse_List(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12646,17 +12676,17 @@ func TestStmtUse_List(t *testing.T) { EndPos: 16, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 15, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12665,31 +12695,31 @@ func TestStmtUse_List(t *testing.T) { EndPos: 10, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 15, - }, - }, - Use: &ast.NameName{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12698,17 +12728,27 @@ func TestStmtUse_List(t *testing.T) { EndPos: 15, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 15, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 15, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 15, + }, + }, + Value: []byte("Bar"), }, - Value: []byte("Bar"), }, }, }, @@ -12738,7 +12778,7 @@ func TestStmtUse_ListAlias(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12747,17 +12787,17 @@ func TestStmtUse_ListAlias(t *testing.T) { EndPos: 23, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 22, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12766,63 +12806,73 @@ func TestStmtUse_ListAlias(t *testing.T) { EndPos: 10, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 22, - }, - }, - Use: &ast.NameName{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 12, - EndPos: 15, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 15, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 19, EndPos: 22, }, }, - Value: []byte("Baz"), + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 15, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 15, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 19, + EndPos: 22, + }, + }, + Value: []byte("Baz"), + }, }, }, }, @@ -12850,7 +12900,7 @@ func TestStmtUse_ListFunctionType(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12859,38 +12909,46 @@ func TestStmtUse_ListFunctionType(t *testing.T) { EndPos: 26, }, }, - UseType: &ast.Identifier{ + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, - EndPos: 15, + EndPos: 25, }, }, - Value: []byte("function"), - }, - Uses: []ast.Vertex{ - &ast.StmtUse{ + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 15, + }, + }, + Value: []byte("function"), + }, + Use: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 16, - EndPos: 19, + EndPos: 25, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 16, - EndPos: 19, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 19, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12899,31 +12957,31 @@ func TestStmtUse_ListFunctionType(t *testing.T) { EndPos: 19, }, }, - Value: []byte("Foo"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 19, + }, + }, + Value: []byte("Foo"), + }, + }, }, }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 22, - EndPos: 25, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 22, - EndPos: 25, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 22, + EndPos: 25, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12932,7 +12990,19 @@ func TestStmtUse_ListFunctionType(t *testing.T) { EndPos: 25, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 22, + EndPos: 25, + }, + }, + Value: []byte("Bar"), + }, + }, }, }, }, @@ -12962,7 +13032,7 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12971,38 +13041,46 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { EndPos: 40, }, }, - UseType: &ast.Identifier{ + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, - EndPos: 15, + EndPos: 39, }, }, - Value: []byte("function"), - }, - Uses: []ast.Vertex{ - &ast.StmtUse{ + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 15, + }, + }, + Value: []byte("function"), + }, + Use: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 16, - EndPos: 26, + EndPos: 39, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 16, - EndPos: 19, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 26, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13011,42 +13089,42 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { EndPos: 19, }, }, - Value: []byte("Foo"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 19, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 23, + EndPos: 26, + }, + }, + Value: []byte("foo"), }, }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 23, - EndPos: 26, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 39, + }, }, - }, - Value: []byte("foo"), - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 39, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 32, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13055,21 +13133,33 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { EndPos: 32, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 32, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 36, + EndPos: 39, + }, + }, + Value: []byte("bar"), }, }, }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 36, - EndPos: 39, - }, - }, - Value: []byte("bar"), - }, }, }, }, @@ -13096,7 +13186,7 @@ func TestStmtUse_ListConstType(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13105,38 +13195,47 @@ func TestStmtUse_ListConstType(t *testing.T) { EndPos: 23, }, }, - UseType: &ast.Identifier{ + + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, - EndPos: 12, + EndPos: 22, }, }, - Value: []byte("const"), - }, - Uses: []ast.Vertex{ - &ast.StmtUse{ + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 12, + }, + }, + Value: []byte("const"), + }, + Use: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 13, - EndPos: 16, + EndPos: 22, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 13, - EndPos: 16, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 16, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13145,31 +13244,31 @@ func TestStmtUse_ListConstType(t *testing.T) { EndPos: 16, }, }, - Value: []byte("Foo"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 16, + }, + }, + Value: []byte("Foo"), + }, + }, }, }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 19, - EndPos: 22, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 19, - EndPos: 22, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 19, + EndPos: 22, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13178,7 +13277,19 @@ func TestStmtUse_ListConstType(t *testing.T) { EndPos: 22, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 19, + EndPos: 22, + }, + }, + Value: []byte("Bar"), + }, + }, }, }, }, @@ -13208,7 +13319,7 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13217,38 +13328,46 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { EndPos: 37, }, }, - UseType: &ast.Identifier{ + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, - EndPos: 12, + EndPos: 36, }, }, - Value: []byte("const"), - }, - Uses: []ast.Vertex{ - &ast.StmtUse{ + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 12, + }, + }, + Value: []byte("const"), + }, + Use: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 13, - EndPos: 23, + EndPos: 36, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 13, - EndPos: 16, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 23, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13257,42 +13376,42 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { EndPos: 16, }, }, - Value: []byte("Foo"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 16, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 20, + EndPos: 23, + }, + }, + Value: []byte("foo"), }, }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 20, - EndPos: 23, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 26, + EndPos: 36, + }, }, - }, - Value: []byte("foo"), - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 26, - EndPos: 36, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 26, - EndPos: 29, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13301,21 +13420,33 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { EndPos: 29, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 26, + EndPos: 29, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 33, + EndPos: 36, + }, + }, + Value: []byte("bar"), }, }, }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 33, - EndPos: 36, - }, - }, - Value: []byte("bar"), - }, }, }, }, @@ -13342,7 +13473,7 @@ func TestStmtUse_GroupUse(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtGroupUse{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13351,50 +13482,58 @@ func TestStmtUse_GroupUse(t *testing.T) { EndPos: 22, }, }, - Prefix: &ast.NameName{ + UseList: &ast.StmtGroupUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, - EndPos: 10, + EndPos: 21, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, + Prefix: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, - }, - UseList: []ast.Vertex{ - &ast.StmtUse{ + UseList: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 12, - EndPos: 15, + EndPos: 20, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 15, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 15, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13403,31 +13542,31 @@ func TestStmtUse_GroupUse(t *testing.T) { EndPos: 15, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 15, + }, + }, + Value: []byte("Bar"), + }, + }, }, }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 17, - EndPos: 20, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 17, - EndPos: 20, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 17, + EndPos: 20, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13436,7 +13575,19 @@ func TestStmtUse_GroupUse(t *testing.T) { EndPos: 20, }, }, - Value: []byte("Baz"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 17, + EndPos: 20, + }, + }, + Value: []byte("Baz"), + }, + }, }, }, }, @@ -13466,7 +13617,7 @@ func TestStmtUse_GroupUseAlias(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtGroupUse{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13475,50 +13626,58 @@ func TestStmtUse_GroupUseAlias(t *testing.T) { EndPos: 30, }, }, - Prefix: &ast.NameName{ + UseList: &ast.StmtGroupUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, - EndPos: 10, + EndPos: 29, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, + Prefix: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, - }, - UseList: []ast.Vertex{ - &ast.StmtUse{ + UseList: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 12, - EndPos: 15, + EndPos: 28, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 15, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 15, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13527,31 +13686,31 @@ func TestStmtUse_GroupUseAlias(t *testing.T) { EndPos: 15, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 15, + }, + }, + Value: []byte("Bar"), + }, + }, }, }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 17, - EndPos: 28, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 17, - EndPos: 20, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 17, + EndPos: 28, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13560,21 +13719,33 @@ func TestStmtUse_GroupUseAlias(t *testing.T) { EndPos: 20, }, }, - Value: []byte("Baz"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 17, + EndPos: 20, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 24, + EndPos: 28, + }, + }, + Value: []byte("quux"), }, }, }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 24, - EndPos: 28, - }, - }, - Value: []byte("quux"), - }, }, }, }, @@ -13601,7 +13772,7 @@ func TestStmtUse_FunctionGroupUse(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtGroupUse{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13610,28 +13781,36 @@ func TestStmtUse_FunctionGroupUse(t *testing.T) { EndPos: 31, }, }, - UseType: &ast.Identifier{ + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, - EndPos: 15, + EndPos: 30, }, }, - Value: []byte("function"), - }, - Prefix: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 16, - EndPos: 19, + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 15, + }, }, + Value: []byte("function"), }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.StmtGroupUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 30, + }, + }, + Prefix: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13640,31 +13819,31 @@ func TestStmtUse_FunctionGroupUse(t *testing.T) { EndPos: 19, }, }, - Value: []byte("Foo"), - }, - }, - }, - UseList: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 21, - EndPos: 24, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 19, + }, + }, + Value: []byte("Foo"), + }, }, }, - Use: &ast.NameName{ + UseList: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 21, - EndPos: 24, + EndPos: 29, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13673,31 +13852,31 @@ func TestStmtUse_FunctionGroupUse(t *testing.T) { EndPos: 24, }, }, - Value: []byte("Bar"), + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 21, + EndPos: 24, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 21, + EndPos: 24, + }, + }, + Value: []byte("Bar"), + }, + }, + }, }, - }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 26, - EndPos: 29, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 26, - EndPos: 29, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13706,7 +13885,29 @@ func TestStmtUse_FunctionGroupUse(t *testing.T) { EndPos: 29, }, }, - Value: []byte("Baz"), + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 26, + EndPos: 29, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 26, + EndPos: 29, + }, + }, + Value: []byte("Baz"), + }, + }, + }, }, }, }, @@ -13736,7 +13937,7 @@ func TestStmtUse_ConstGroupUse(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtGroupUse{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13745,28 +13946,36 @@ func TestStmtUse_ConstGroupUse(t *testing.T) { EndPos: 28, }, }, - UseType: &ast.Identifier{ + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, - EndPos: 12, + EndPos: 27, }, }, - Value: []byte("const"), - }, - Prefix: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 13, - EndPos: 16, + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 12, + }, }, + Value: []byte("const"), }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.StmtGroupUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 27, + }, + }, + Prefix: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13775,31 +13984,31 @@ func TestStmtUse_ConstGroupUse(t *testing.T) { EndPos: 16, }, }, - Value: []byte("Foo"), - }, - }, - }, - UseList: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 18, - EndPos: 21, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 16, + }, + }, + Value: []byte("Foo"), + }, }, }, - Use: &ast.NameName{ + UseList: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 18, - EndPos: 21, + EndPos: 26, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13808,31 +14017,31 @@ func TestStmtUse_ConstGroupUse(t *testing.T) { EndPos: 21, }, }, - Value: []byte("Bar"), + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 21, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 21, + }, + }, + Value: []byte("Bar"), + }, + }, + }, }, - }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 23, - EndPos: 26, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 23, - EndPos: 26, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13841,7 +14050,29 @@ func TestStmtUse_ConstGroupUse(t *testing.T) { EndPos: 26, }, }, - Value: []byte("Baz"), + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 23, + EndPos: 26, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 23, + EndPos: 26, + }, + }, + Value: []byte("Baz"), + }, + }, + }, }, }, }, @@ -13871,7 +14102,7 @@ func TestStmtUse_MixedGroupUse(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtGroupUse{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13880,61 +14111,69 @@ func TestStmtUse_MixedGroupUse(t *testing.T) { EndPos: 37, }, }, - Prefix: &ast.NameName{ + UseList: &ast.StmtGroupUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, - EndPos: 10, + EndPos: 36, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - UseList: []ast.Vertex{ - &ast.StmtUse{ + Prefix: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 18, - EndPos: 21, + StartPos: 7, + EndPos: 10, }, }, - UseType: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 17, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, }, + Value: []byte("Foo"), }, - Value: []byte("const"), }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 18, - EndPos: 21, - }, + }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 35, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseType{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 21, + }, + }, + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 17, + }, + }, + Value: []byte("const"), + }, + Use: &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13943,42 +14182,52 @@ func TestStmtUse_MixedGroupUse(t *testing.T) { EndPos: 21, }, }, - Value: []byte("Bar"), + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 21, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 21, + }, + }, + Value: []byte("Bar"), + }, + }, + }, }, }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 32, - EndPos: 35, - }, - }, - UseType: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 23, - EndPos: 31, + &ast.StmtUseType{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 23, + EndPos: 35, + }, }, - }, - Value: []byte("function"), - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 32, - EndPos: 35, + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 23, + EndPos: 31, + }, + }, + Value: []byte("function"), }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13987,7 +14236,29 @@ func TestStmtUse_MixedGroupUse(t *testing.T) { EndPos: 35, }, }, - Value: []byte("Baz"), + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 32, + EndPos: 35, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 32, + EndPos: 35, + }, + }, + Value: []byte("Baz"), + }, + }, + }, }, }, }, diff --git a/internal/php7/php7.go b/internal/php7/php7.go index e54c1a76bfc3d00ccdaa38d36a084062b596e527..33a3f5ef54ebc6ca6100e517ad066275e74f3b6d 100644 GIT binary patch delta 7409 zcmd5>dwk7Tw*RcPPZA*^ArjBz#G{JhBq5LSR+5O6ghXoy2@*{d@v29t*VR^)FvV(B zid(JTRx2pGy%QsCr}XJD##Nmn>NTZ^nOmKi^`}y2|=MT-k-4 z@7($_WXE4Z%6qh;xD}pO+S7`@?;^!z6e!cCQHb;(!eb?O1RazNty;)tH@}WC98&0vSi*Px4t!;`ZFcy z^)K)^lGP(ARo?5NTI=dFY7mJhi&CklEEz}rf33pz&0y=}9XLdeW>Eu`UN~D$yvboT zrYWo^;7{E-NFM9K9@(5j6J)?R6&_$zE1W$?4joo~Wb5xKNXqvqfB9fE4K_Xrs3914 zM75PK-=`)r;9<(BnWh2?mw$HQP^s?6ftx1N010}8lBt)GI8NNdRG`b)_?O1N@HZ7H z$H!67uZ7MrJ`AcWIk?@vOB3a@)6_u9#!ymy(I9)2bXgA3ZX8yPWIzVDkXQC$7&wVy z>yuh7a>mkx`U-$?m}DHI4u-m=c((8)i62KPoap&Cv;2tq`urc}Z<8AiA1`?g5nN@HDVyUwW)LTx@+k$%<&EK=q^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