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 162c382..7a695b7 100644 --- a/internal/php5/php5.go +++ b/internal/php5/php5.go @@ -347,7 +347,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -// line internal/php5/php5.y:7151 +// line internal/php5/php5.y:7134 type simpleIndirectReference struct { all []*ast.ExprVariable @@ -2488,59 +2488,66 @@ yydefault: yyDollar = yyS[yypt-3 : yypt+1] // line internal/php5/php5.y:430 { - yyVAL.node = &ast.StmtUseList{ast.Node{}, nil, yyDollar[2].list} + useList := &ast.StmtUseList{ast.Node{}, yyDollar[2].list} + yyVAL.node = &ast.StmtUse{ast.Node{}, useList} // save position + useList.GetNode().Position = position.NewNodeListPosition(yyDollar[2].list) yyVAL.node.GetNode().Position = position.NewTokensPosition(yyDollar[1].token, yyDollar[3].token) // save comments yylex.(*Parser).setFreeFloating(yyVAL.node, token.Start, yyDollar[1].token.Tokens) - yylex.(*Parser).setFreeFloating(yyVAL.node, token.UseDeclarationList, yyDollar[3].token.Tokens) - yylex.(*Parser).setToken(yyVAL.node, token.SemiColon, yyDollar[3].token.Tokens) + yylex.(*Parser).setFreeFloatingTokens(yyVAL.node, token.End, yyDollar[3].token.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 15: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:444 + // line internal/php5/php5.y:445 { - useType := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} - yyVAL.node = &ast.StmtUseList{ast.Node{}, useType, yyDollar[3].list} + identifier := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} + useList := &ast.StmtUseList{ast.Node{}, yyDollar[3].list} + useType := &ast.StmtUseType{ast.Node{}, identifier, useList} + yyVAL.node = &ast.StmtUse{ast.Node{}, useType} // save position - useType.GetNode().Position = position.NewTokenPosition(yyDollar[2].token) + identifier.GetNode().Position = position.NewTokenPosition(yyDollar[2].token) + useList.GetNode().Position = position.NewNodeListPosition(yyDollar[3].list) + useType.GetNode().Position = position.NewTokenNodePosition(yyDollar[2].token, useList) yyVAL.node.GetNode().Position = position.NewTokensPosition(yyDollar[1].token, yyDollar[4].token) // save comments + yylex.(*Parser).setFreeFloating(identifier, token.Start, yyDollar[2].token.Tokens) yylex.(*Parser).setFreeFloating(yyVAL.node, token.Start, yyDollar[1].token.Tokens) - yylex.(*Parser).setFreeFloating(useType, token.Start, yyDollar[2].token.Tokens) - yylex.(*Parser).setFreeFloating(yyVAL.node, token.UseDeclarationList, yyDollar[4].token.Tokens) - yylex.(*Parser).setToken(yyVAL.node, token.SemiColon, yyDollar[4].token.Tokens) + yylex.(*Parser).setFreeFloatingTokens(yyVAL.node, token.End, yyDollar[4].token.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 16: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:461 + // line internal/php5/php5.y:465 { - useType := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} - yyVAL.node = &ast.StmtUseList{ast.Node{}, useType, yyDollar[3].list} + identifier := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} + useList := &ast.StmtUseList{ast.Node{}, yyDollar[3].list} + useType := &ast.StmtUseType{ast.Node{}, identifier, useList} + yyVAL.node = &ast.StmtUse{ast.Node{}, useType} // save position - useType.GetNode().Position = position.NewTokenPosition(yyDollar[2].token) + identifier.GetNode().Position = position.NewTokenPosition(yyDollar[2].token) + useList.GetNode().Position = position.NewNodeListPosition(yyDollar[3].list) + useType.GetNode().Position = position.NewTokenNodePosition(yyDollar[2].token, useList) yyVAL.node.GetNode().Position = position.NewTokensPosition(yyDollar[1].token, yyDollar[4].token) // save comments + yylex.(*Parser).setFreeFloating(identifier, token.Start, yyDollar[2].token.Tokens) yylex.(*Parser).setFreeFloating(yyVAL.node, token.Start, yyDollar[1].token.Tokens) - yylex.(*Parser).setFreeFloating(useType, token.Start, yyDollar[2].token.Tokens) - yylex.(*Parser).setFreeFloating(yyVAL.node, token.UseDeclarationList, yyDollar[4].token.Tokens) - yylex.(*Parser).setToken(yyVAL.node, token.SemiColon, yyDollar[4].token.Tokens) + yylex.(*Parser).setFreeFloatingTokens(yyVAL.node, token.End, yyDollar[4].token.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 17: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:478 + // line internal/php5/php5.y:485 { yyVAL.node = yyDollar[1].node @@ -2555,7 +2562,7 @@ yydefault: } case 18: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:494 + // line internal/php5/php5.y:501 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -2566,7 +2573,7 @@ yydefault: } case 19: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:503 + // line internal/php5/php5.y:510 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -2574,27 +2581,24 @@ yydefault: } case 20: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:512 + // line internal/php5/php5.y:519 { name := &ast.NameName{ast.Node{}, yyDollar[1].list} - yyVAL.node = &ast.StmtUse{ast.Node{}, nil, name, nil} + yyVAL.node = &ast.StmtUseDeclaration{ast.Node{}, name, nil} // save position name.GetNode().Position = position.NewNodeListPosition(yyDollar[1].list) yyVAL.node.GetNode().Position = position.NewNodeListPosition(yyDollar[1].list) - // save comments - yylex.(*Parser).MoveFreeFloating(yyDollar[1].list[0], yyVAL.node) - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 21: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:526 + // line internal/php5/php5.y:530 { name := &ast.NameName{ast.Node{}, yyDollar[1].list} alias := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} - yyVAL.node = &ast.StmtUse{ast.Node{}, nil, name, alias} + yyVAL.node = &ast.StmtUseDeclaration{ast.Node{}, name, alias} // save position name.GetNode().Position = position.NewNodeListPosition(yyDollar[1].list) @@ -2602,7 +2606,6 @@ yydefault: yyVAL.node.GetNode().Position = position.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token) // save comments - yylex.(*Parser).MoveFreeFloating(yyDollar[1].list[0], yyVAL.node) yylex.(*Parser).setFreeFloating(name, token.End, yyDollar[2].token.Tokens) yylex.(*Parser).setFreeFloating(alias, token.Start, yyDollar[3].token.Tokens) @@ -2610,29 +2613,27 @@ yydefault: } case 22: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:544 + // line internal/php5/php5.y:547 { name := &ast.NameName{ast.Node{}, yyDollar[2].list} - yyVAL.node = &ast.StmtUse{ast.Node{}, nil, name, nil} + yyVAL.node = &ast.StmtUseDeclaration{ast.Node{}, name, nil} // save position name.GetNode().Position = position.NewNodeListPosition(yyDollar[2].list) yyVAL.node.GetNode().Position = position.NewNodeListPosition(yyDollar[2].list) // save comments - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Start, yyDollar[1].token.Tokens) - yylex.(*Parser).setToken(yyVAL.node, token.Slash, yyDollar[1].token.Tokens) - yylex.(*Parser).MoveFreeFloating(yyDollar[2].list[0], name) + yylex.(*Parser).setFreeFloatingTokens(yyVAL.node, token.Start, yyDollar[1].token.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 23: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:560 + // line internal/php5/php5.y:561 { name := &ast.NameName{ast.Node{}, yyDollar[2].list} alias := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} - yyVAL.node = &ast.StmtUse{ast.Node{}, nil, name, alias} + yyVAL.node = &ast.StmtUseDeclaration{ast.Node{}, name, alias} // save position name.GetNode().Position = position.NewNodeListPosition(yyDollar[2].list) @@ -2640,9 +2641,7 @@ yydefault: yyVAL.node.GetNode().Position = position.NewNodeListTokenPosition(yyDollar[2].list, yyDollar[4].token) // save comments - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Start, yyDollar[1].token.Tokens) - yylex.(*Parser).setToken(yyVAL.node, token.Slash, yyDollar[1].token.Tokens) - yylex.(*Parser).MoveFreeFloating(yyDollar[2].list[0], name) + yylex.(*Parser).setFreeFloatingTokens(yyVAL.node, token.Start, yyDollar[1].token.Tokens) yylex.(*Parser).setFreeFloating(name, token.End, yyDollar[3].token.Tokens) yylex.(*Parser).setFreeFloating(alias, token.Start, yyDollar[4].token.Tokens) @@ -2650,7 +2649,7 @@ yydefault: } case 24: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:583 + // line internal/php5/php5.y:582 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -2661,7 +2660,7 @@ yydefault: } case 25: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:592 + // line internal/php5/php5.y:591 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -2669,27 +2668,24 @@ yydefault: } case 26: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:601 + // line internal/php5/php5.y:600 { name := &ast.NameName{ast.Node{}, yyDollar[1].list} - yyVAL.node = &ast.StmtUse{ast.Node{}, nil, name, nil} + yyVAL.node = &ast.StmtUseDeclaration{ast.Node{}, name, nil} // save position name.GetNode().Position = position.NewNodeListPosition(yyDollar[1].list) yyVAL.node.GetNode().Position = position.NewNodeListPosition(yyDollar[1].list) - // save comments - yylex.(*Parser).MoveFreeFloating(yyDollar[1].list[0], yyVAL.node) - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 27: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:615 + // line internal/php5/php5.y:611 { name := &ast.NameName{ast.Node{}, yyDollar[1].list} alias := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} - yyVAL.node = &ast.StmtUse{ast.Node{}, nil, name, alias} + yyVAL.node = &ast.StmtUseDeclaration{ast.Node{}, name, alias} // save position name.GetNode().Position = position.NewNodeListPosition(yyDollar[1].list) @@ -2697,7 +2693,6 @@ yydefault: yyVAL.node.GetNode().Position = position.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token) // save comments - yylex.(*Parser).MoveFreeFloating(yyDollar[1].list[0], yyVAL.node) yylex.(*Parser).setFreeFloating(name, token.End, yyDollar[2].token.Tokens) yylex.(*Parser).setFreeFloating(alias, token.Start, yyDollar[3].token.Tokens) @@ -2705,29 +2700,27 @@ yydefault: } case 28: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:633 + // line internal/php5/php5.y:628 { name := &ast.NameName{ast.Node{}, yyDollar[2].list} - yyVAL.node = &ast.StmtUse{ast.Node{}, nil, name, nil} + yyVAL.node = &ast.StmtUseDeclaration{ast.Node{}, name, nil} // save position name.GetNode().Position = position.NewNodeListPosition(yyDollar[2].list) yyVAL.node.GetNode().Position = position.NewNodeListPosition(yyDollar[2].list) // save comments - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Start, yyDollar[1].token.Tokens) - yylex.(*Parser).setToken(yyVAL.node, token.Slash, yyDollar[1].token.Tokens) - yylex.(*Parser).MoveFreeFloating(yyDollar[2].list[0], name) + yylex.(*Parser).setFreeFloatingTokens(yyVAL.node, token.Start, yyDollar[1].token.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 29: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:649 + // line internal/php5/php5.y:642 { name := &ast.NameName{ast.Node{}, yyDollar[2].list} alias := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} - yyVAL.node = &ast.StmtUse{ast.Node{}, nil, name, alias} + yyVAL.node = &ast.StmtUseDeclaration{ast.Node{}, name, alias} // save position name.GetNode().Position = position.NewNodeListPosition(yyDollar[2].list) @@ -2735,9 +2728,7 @@ yydefault: yyVAL.node.GetNode().Position = position.NewNodeListTokenPosition(yyDollar[2].list, yyDollar[4].token) // save comments - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Start, yyDollar[1].token.Tokens) - yylex.(*Parser).setToken(yyVAL.node, token.Slash, yyDollar[1].token.Tokens) - yylex.(*Parser).MoveFreeFloating(yyDollar[2].list[0], name) + yylex.(*Parser).setFreeFloatingTokens(yyVAL.node, token.Start, yyDollar[1].token.Tokens) yylex.(*Parser).setFreeFloating(name, token.End, yyDollar[3].token.Tokens) yylex.(*Parser).setFreeFloating(alias, token.Start, yyDollar[4].token.Tokens) @@ -2745,7 +2736,7 @@ yydefault: } case 30: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:672 + // line internal/php5/php5.y:663 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -2756,7 +2747,7 @@ yydefault: } case 31: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:681 + // line internal/php5/php5.y:672 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -2764,27 +2755,24 @@ yydefault: } case 32: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:690 + // line internal/php5/php5.y:681 { name := &ast.NameName{ast.Node{}, yyDollar[1].list} - yyVAL.node = &ast.StmtUse{ast.Node{}, nil, name, nil} + yyVAL.node = &ast.StmtUseDeclaration{ast.Node{}, name, nil} // save position name.GetNode().Position = position.NewNodeListPosition(yyDollar[1].list) yyVAL.node.GetNode().Position = position.NewNodeListPosition(yyDollar[1].list) - // save comments - yylex.(*Parser).MoveFreeFloating(yyDollar[1].list[0], yyVAL.node) - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 33: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:704 + // line internal/php5/php5.y:692 { name := &ast.NameName{ast.Node{}, yyDollar[1].list} alias := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} - yyVAL.node = &ast.StmtUse{ast.Node{}, nil, name, alias} + yyVAL.node = &ast.StmtUseDeclaration{ast.Node{}, name, alias} // save position name.GetNode().Position = position.NewNodeListPosition(yyDollar[1].list) @@ -2792,7 +2780,6 @@ yydefault: yyVAL.node.GetNode().Position = position.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token) // save comments - yylex.(*Parser).MoveFreeFloating(yyDollar[1].list[0], yyVAL.node) yylex.(*Parser).setFreeFloating(name, token.End, yyDollar[2].token.Tokens) yylex.(*Parser).setFreeFloating(alias, token.Start, yyDollar[3].token.Tokens) @@ -2800,29 +2787,27 @@ yydefault: } case 34: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:722 + // line internal/php5/php5.y:709 { name := &ast.NameName{ast.Node{}, yyDollar[2].list} - yyVAL.node = &ast.StmtUse{ast.Node{}, nil, name, nil} + yyVAL.node = &ast.StmtUseDeclaration{ast.Node{}, name, nil} // save position name.GetNode().Position = position.NewNodeListPosition(yyDollar[2].list) yyVAL.node.GetNode().Position = position.NewNodeListPosition(yyDollar[2].list) // save comments - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Start, yyDollar[1].token.Tokens) - yylex.(*Parser).setToken(yyVAL.node, token.Slash, yyDollar[1].token.Tokens) - yylex.(*Parser).MoveFreeFloating(yyDollar[2].list[0], name) + yylex.(*Parser).setFreeFloatingTokens(yyVAL.node, token.Start, yyDollar[1].token.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 35: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:738 + // line internal/php5/php5.y:723 { name := &ast.NameName{ast.Node{}, yyDollar[2].list} alias := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} - yyVAL.node = &ast.StmtUse{ast.Node{}, nil, name, alias} + yyVAL.node = &ast.StmtUseDeclaration{ast.Node{}, name, alias} // save position name.GetNode().Position = position.NewNodeListPosition(yyDollar[2].list) @@ -2830,9 +2815,7 @@ yydefault: yyVAL.node.GetNode().Position = position.NewNodeListTokenPosition(yyDollar[2].list, yyDollar[4].token) // save comments - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Start, yyDollar[1].token.Tokens) - yylex.(*Parser).setToken(yyVAL.node, token.Slash, yyDollar[1].token.Tokens) - yylex.(*Parser).MoveFreeFloating(yyDollar[2].list[0], name) + yylex.(*Parser).setFreeFloatingTokens(yyVAL.node, token.Start, yyDollar[1].token.Tokens) yylex.(*Parser).setFreeFloating(name, token.End, yyDollar[3].token.Tokens) yylex.(*Parser).setFreeFloating(alias, token.Start, yyDollar[4].token.Tokens) @@ -2840,7 +2823,7 @@ yydefault: } case 36: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:761 + // line internal/php5/php5.y:744 { name := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} constant := &ast.StmtConstant{ast.Node{}, name, yyDollar[5].node} @@ -2863,7 +2846,7 @@ yydefault: } case 37: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:782 + // line internal/php5/php5.y:765 { name := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} constant := &ast.StmtConstant{ast.Node{}, name, yyDollar[4].node} @@ -2884,7 +2867,7 @@ yydefault: } case 38: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:804 + // line internal/php5/php5.y:787 { if inlineHtmlNode, ok := yyDollar[2].node.(*ast.StmtInlineHtml); ok && len(yyDollar[1].list) > 0 { prevNode := lastNode(yyDollar[1].list) @@ -2899,7 +2882,7 @@ yydefault: } case 39: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:817 + // line internal/php5/php5.y:800 { yyVAL.list = []ast.Vertex{} @@ -2907,7 +2890,7 @@ yydefault: } case 40: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:827 + // line internal/php5/php5.y:810 { // error yyVAL.node = nil @@ -2916,7 +2899,7 @@ yydefault: } case 41: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:834 + // line internal/php5/php5.y:817 { yyVAL.node = yyDollar[1].node @@ -2924,7 +2907,7 @@ yydefault: } case 42: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:840 + // line internal/php5/php5.y:823 { yyVAL.node = yyDollar[1].node @@ -2932,7 +2915,7 @@ yydefault: } case 43: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:846 + // line internal/php5/php5.y:829 { yyVAL.node = yyDollar[1].node @@ -2940,7 +2923,7 @@ yydefault: } case 44: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:852 + // line internal/php5/php5.y:835 { yyVAL.node = &ast.StmtHaltCompiler{ast.Node{}} @@ -2958,7 +2941,7 @@ yydefault: } case 45: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:872 + // line internal/php5/php5.y:855 { yyVAL.node = yyDollar[1].node @@ -2966,7 +2949,7 @@ yydefault: } case 46: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:878 + // line internal/php5/php5.y:861 { label := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.StmtLabel{ast.Node{}, label} @@ -2983,7 +2966,7 @@ yydefault: } case 47: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:896 + // line internal/php5/php5.y:879 { yyVAL.node = &ast.StmtStmtList{ast.Node{}, yyDollar[2].list} @@ -2998,7 +2981,7 @@ yydefault: } case 48: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:909 + // line internal/php5/php5.y:892 { yyVAL.node = &ast.StmtIf{ast.Node{}, yyDollar[2].node, yyDollar[3].node, yyDollar[4].list, yyDollar[5].node} @@ -3026,7 +3009,7 @@ yydefault: } case 49: yyDollar = yyS[yypt-8 : yypt+1] - // line internal/php5/php5.y:933 + // line internal/php5/php5.y:916 { stmts := &ast.StmtStmtList{ast.Node{}, yyDollar[4].list} yyVAL.node = &ast.StmtAltIf{ast.Node{}, yyDollar[2].node, stmts, yyDollar[5].list, yyDollar[6].node} @@ -3054,7 +3037,7 @@ yydefault: } case 50: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:957 + // line internal/php5/php5.y:940 { switch n := yyDollar[3].node.(type) { case *ast.StmtWhile: @@ -3083,7 +3066,7 @@ yydefault: } case 51: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:982 + // line internal/php5/php5.y:965 { yyVAL.node = &ast.StmtDo{ast.Node{}, yyDollar[2].node, yyDollar[4].node} @@ -3108,7 +3091,7 @@ yydefault: } case 52: yyDollar = yyS[yypt-9 : yypt+1] - // line internal/php5/php5.y:1003 + // line internal/php5/php5.y:986 { switch n := yyDollar[9].node.(type) { case *ast.StmtFor: @@ -3137,7 +3120,7 @@ yydefault: } case 53: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1030 + // line internal/php5/php5.y:1013 { switch n := yyDollar[3].node.(type) { case *ast.StmtSwitch: @@ -3168,7 +3151,7 @@ yydefault: } case 54: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1057 + // line internal/php5/php5.y:1040 { yyVAL.node = &ast.StmtBreak{ast.Node{}, nil} @@ -3184,7 +3167,7 @@ yydefault: } case 55: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1071 + // line internal/php5/php5.y:1054 { yyVAL.node = &ast.StmtBreak{ast.Node{}, yyDollar[2].node} @@ -3200,7 +3183,7 @@ yydefault: } case 56: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1085 + // line internal/php5/php5.y:1068 { yyVAL.node = &ast.StmtContinue{ast.Node{}, nil} @@ -3216,7 +3199,7 @@ yydefault: } case 57: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1099 + // line internal/php5/php5.y:1082 { yyVAL.node = &ast.StmtContinue{ast.Node{}, yyDollar[2].node} @@ -3232,7 +3215,7 @@ yydefault: } case 58: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1113 + // line internal/php5/php5.y:1096 { yyVAL.node = &ast.StmtReturn{ast.Node{}, nil} @@ -3248,7 +3231,7 @@ yydefault: } case 59: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1127 + // line internal/php5/php5.y:1110 { yyVAL.node = &ast.StmtReturn{ast.Node{}, yyDollar[2].node} @@ -3264,7 +3247,7 @@ yydefault: } case 60: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1141 + // line internal/php5/php5.y:1124 { yyVAL.node = &ast.StmtReturn{ast.Node{}, yyDollar[2].node} @@ -3280,7 +3263,7 @@ yydefault: } case 61: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1155 + // line internal/php5/php5.y:1138 { yyVAL.node = &ast.StmtExpression{ast.Node{}, yyDollar[1].node} @@ -3296,7 +3279,7 @@ yydefault: } case 62: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1169 + // line internal/php5/php5.y:1152 { yyVAL.node = &ast.StmtGlobal{ast.Node{}, yyDollar[2].list} @@ -3312,7 +3295,7 @@ yydefault: } case 63: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1183 + // line internal/php5/php5.y:1166 { yyVAL.node = &ast.StmtStatic{ast.Node{}, yyDollar[2].list} @@ -3328,7 +3311,7 @@ yydefault: } case 64: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1197 + // line internal/php5/php5.y:1180 { yyVAL.node = &ast.StmtEcho{ast.Node{}, yyDollar[2].list} @@ -3345,7 +3328,7 @@ yydefault: } case 65: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1212 + // line internal/php5/php5.y:1195 { yyVAL.node = &ast.StmtInlineHtml{ast.Node{}, yyDollar[1].token.Value} @@ -3359,7 +3342,7 @@ yydefault: } case 66: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1224 + // line internal/php5/php5.y:1207 { yyVAL.node = &ast.StmtExpression{ast.Node{}, yyDollar[1].node} @@ -3375,7 +3358,7 @@ yydefault: } case 67: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:1238 + // line internal/php5/php5.y:1221 { yyVAL.node = &ast.StmtUnset{ast.Node{}, yyDollar[3].list} @@ -3393,7 +3376,7 @@ yydefault: } case 68: yyDollar = yyS[yypt-8 : yypt+1] - // line internal/php5/php5.y:1254 + // line internal/php5/php5.y:1237 { if yyDollar[6].node == nil { switch n := yyDollar[8].node.(type) { @@ -3436,7 +3419,7 @@ yydefault: } case 69: yyDollar = yyS[yypt-8 : yypt+1] - // line internal/php5/php5.y:1294 + // line internal/php5/php5.y:1277 { if yyDollar[6].node == nil { switch n := yyDollar[8].node.(type) { @@ -3479,7 +3462,7 @@ yydefault: } case 70: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:1334 + // line internal/php5/php5.y:1317 { yyVAL.node = yyDollar[5].node yyVAL.node.(*ast.StmtDeclare).Consts = yyDollar[3].list @@ -3496,7 +3479,7 @@ yydefault: } case 71: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1349 + // line internal/php5/php5.y:1332 { yyVAL.node = &ast.StmtNop{ast.Node{}} @@ -3511,7 +3494,7 @@ yydefault: } case 72: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php5/php5.y:1362 + // line internal/php5/php5.y:1345 { yyVAL.node = &ast.StmtTry{ast.Node{}, yyDollar[3].list, yyDollar[5].list, yyDollar[6].node} @@ -3531,7 +3514,7 @@ yydefault: } case 73: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1380 + // line internal/php5/php5.y:1363 { yyVAL.node = &ast.StmtThrow{ast.Node{}, yyDollar[2].node} @@ -3547,7 +3530,7 @@ yydefault: } case 74: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1394 + // line internal/php5/php5.y:1377 { label := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} yyVAL.node = &ast.StmtGoto{ast.Node{}, label} @@ -3566,7 +3549,7 @@ yydefault: } case 75: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1414 + // line internal/php5/php5.y:1397 { yyVAL.list = []ast.Vertex{} @@ -3574,7 +3557,7 @@ yydefault: } case 76: yyDollar = yyS[yypt-9 : yypt+1] - // line internal/php5/php5.y:1420 + // line internal/php5/php5.y:1403 { identifier := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -3598,7 +3581,7 @@ yydefault: } case 77: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1445 + // line internal/php5/php5.y:1428 { yyVAL.node = nil @@ -3606,7 +3589,7 @@ yydefault: } case 78: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1451 + // line internal/php5/php5.y:1434 { yyVAL.node = &ast.StmtFinally{ast.Node{}, yyDollar[3].list} @@ -3622,7 +3605,7 @@ yydefault: } case 79: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1468 + // line internal/php5/php5.y:1451 { yyVAL.list = yyDollar[1].list @@ -3630,7 +3613,7 @@ yydefault: } case 80: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1474 + // line internal/php5/php5.y:1457 { yyVAL.list = []ast.Vertex{} @@ -3638,7 +3621,7 @@ yydefault: } case 81: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1483 + // line internal/php5/php5.y:1466 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -3646,7 +3629,7 @@ yydefault: } case 82: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1489 + // line internal/php5/php5.y:1472 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -3654,7 +3637,7 @@ yydefault: } case 83: yyDollar = yyS[yypt-8 : yypt+1] - // line internal/php5/php5.y:1498 + // line internal/php5/php5.y:1481 { identifier := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -3677,7 +3660,7 @@ yydefault: } case 84: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1522 + // line internal/php5/php5.y:1505 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -3685,7 +3668,7 @@ yydefault: } case 85: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1528 + // line internal/php5/php5.y:1511 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3696,7 +3679,7 @@ yydefault: } case 86: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1540 + // line internal/php5/php5.y:1523 { yyVAL.node = yyDollar[1].node @@ -3704,7 +3687,7 @@ yydefault: } case 87: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1549 + // line internal/php5/php5.y:1532 { yyVAL.node = yyDollar[1].node @@ -3712,7 +3695,7 @@ yydefault: } case 88: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1558 + // line internal/php5/php5.y:1541 { yyVAL.node = yyDollar[1].node @@ -3720,31 +3703,31 @@ yydefault: } case 89: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1567 + // line internal/php5/php5.y:1550 { yyVAL.token = nil } case 90: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1571 + // line internal/php5/php5.y:1554 { yyVAL.token = yyDollar[1].token } case 91: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1578 + // line internal/php5/php5.y:1561 { yyVAL.token = nil } case 92: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1582 + // line internal/php5/php5.y:1565 { yyVAL.token = yyDollar[1].token } case 93: yyDollar = yyS[yypt-9 : yypt+1] - // line internal/php5/php5.y:1589 + // line internal/php5/php5.y:1572 { name := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.StmtFunction{ast.Node{}, yyDollar[2].token != nil, name, yyDollar[5].list, nil, yyDollar[8].list} @@ -3770,7 +3753,7 @@ yydefault: } case 94: yyDollar = yyS[yypt-7 : yypt+1] - // line internal/php5/php5.y:1616 + // line internal/php5/php5.y:1599 { name := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} switch n := yyDollar[1].node.(type) { @@ -3800,7 +3783,7 @@ yydefault: } case 95: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php5/php5.y:1644 + // line internal/php5/php5.y:1627 { name := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} yyVAL.node = &ast.StmtInterface{ast.Node{}, name, yyDollar[3].InterfaceExtends, yyDollar[5].list} @@ -3819,7 +3802,7 @@ yydefault: } case 96: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1665 + // line internal/php5/php5.y:1648 { yyVAL.node = &ast.StmtClass{ast.Node{}, nil, nil, nil, nil, nil, nil} @@ -3833,7 +3816,7 @@ yydefault: } case 97: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1677 + // line internal/php5/php5.y:1660 { classModifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.StmtClass{ast.Node{}, nil, []ast.Vertex{classModifier}, nil, nil, nil, nil} @@ -3850,7 +3833,7 @@ yydefault: } case 98: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1692 + // line internal/php5/php5.y:1675 { yyVAL.node = &ast.StmtTrait{ast.Node{}, nil, nil} @@ -3864,7 +3847,7 @@ yydefault: } case 99: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1704 + // line internal/php5/php5.y:1687 { classModifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.StmtClass{ast.Node{}, nil, []ast.Vertex{classModifier}, nil, nil, nil, nil} @@ -3881,7 +3864,7 @@ yydefault: } case 100: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1722 + // line internal/php5/php5.y:1705 { yyVAL.ClassExtends = nil @@ -3889,7 +3872,7 @@ yydefault: } case 101: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1728 + // line internal/php5/php5.y:1711 { yyVAL.ClassExtends = &ast.StmtClassExtends{ast.Node{}, yyDollar[2].node} @@ -3903,13 +3886,13 @@ yydefault: } case 102: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1743 + // line internal/php5/php5.y:1726 { yyVAL.token = yyDollar[1].token } case 103: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1750 + // line internal/php5/php5.y:1733 { yyVAL.InterfaceExtends = nil @@ -3917,7 +3900,7 @@ yydefault: } case 104: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1756 + // line internal/php5/php5.y:1739 { yyVAL.InterfaceExtends = &ast.StmtInterfaceExtends{ast.Node{}, yyDollar[2].list} @@ -3931,7 +3914,7 @@ yydefault: } case 105: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1771 + // line internal/php5/php5.y:1754 { yyVAL.ClassImplements = nil @@ -3939,7 +3922,7 @@ yydefault: } case 106: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1777 + // line internal/php5/php5.y:1760 { yyVAL.ClassImplements = &ast.StmtClassImplements{ast.Node{}, yyDollar[2].list} @@ -3953,7 +3936,7 @@ yydefault: } case 107: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1792 + // line internal/php5/php5.y:1775 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -3961,7 +3944,7 @@ yydefault: } case 108: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1798 + // line internal/php5/php5.y:1781 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3972,7 +3955,7 @@ yydefault: } case 109: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1810 + // line internal/php5/php5.y:1793 { yyVAL.node = nil @@ -3980,7 +3963,7 @@ yydefault: } case 110: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1816 + // line internal/php5/php5.y:1799 { yyVAL.node = yyDollar[2].node @@ -3991,7 +3974,7 @@ yydefault: } case 111: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1828 + // line internal/php5/php5.y:1811 { yyVAL.node = yyDollar[1].node @@ -3999,7 +3982,7 @@ yydefault: } case 112: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1834 + // line internal/php5/php5.y:1817 { yyVAL.node = &ast.ExprReference{ast.Node{}, yyDollar[2].node} @@ -4013,7 +3996,7 @@ yydefault: } case 113: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1846 + // line internal/php5/php5.y:1829 { yyVAL.node = &ast.ExprList{ast.Node{}, yyDollar[3].list} @@ -4029,7 +4012,7 @@ yydefault: } case 114: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1863 + // line internal/php5/php5.y:1846 { yyVAL.node = &ast.StmtFor{ast.Node{}, nil, nil, nil, yyDollar[1].node} @@ -4040,7 +4023,7 @@ yydefault: } case 115: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1872 + // line internal/php5/php5.y:1855 { stmtList := &ast.StmtStmtList{ast.Node{}, yyDollar[2].list} yyVAL.node = &ast.StmtAltFor{ast.Node{}, nil, nil, nil, stmtList} @@ -4059,7 +4042,7 @@ yydefault: } case 116: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1892 + // line internal/php5/php5.y:1875 { yyVAL.node = &ast.StmtForeach{ast.Node{}, nil, nil, nil, yyDollar[1].node} @@ -4070,7 +4053,7 @@ yydefault: } case 117: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1901 + // line internal/php5/php5.y:1884 { stmtList := &ast.StmtStmtList{ast.Node{}, yyDollar[2].list} yyVAL.node = &ast.StmtAltForeach{ast.Node{}, nil, nil, nil, stmtList} @@ -4089,7 +4072,7 @@ yydefault: } case 118: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1922 + // line internal/php5/php5.y:1905 { yyVAL.node = &ast.StmtDeclare{ast.Node{}, false, nil, yyDollar[1].node} @@ -4100,7 +4083,7 @@ yydefault: } case 119: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1931 + // line internal/php5/php5.y:1914 { stmtList := &ast.StmtStmtList{ast.Node{}, yyDollar[2].list} yyVAL.node = &ast.StmtDeclare{ast.Node{}, true, nil, stmtList} @@ -4119,7 +4102,7 @@ yydefault: } case 120: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1952 + // line internal/php5/php5.y:1935 { name := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} constant := &ast.StmtConstant{ast.Node{}, name, yyDollar[3].node} @@ -4137,7 +4120,7 @@ yydefault: } case 121: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:1968 + // line internal/php5/php5.y:1951 { name := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} constant := &ast.StmtConstant{ast.Node{}, name, yyDollar[5].node} @@ -4156,7 +4139,7 @@ yydefault: } case 122: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1989 + // line internal/php5/php5.y:1972 { caseList := &ast.StmtCaseList{ast.Node{}, yyDollar[2].list} yyVAL.node = &ast.StmtSwitch{ast.Node{}, nil, caseList} @@ -4173,7 +4156,7 @@ yydefault: } case 123: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:2004 + // line internal/php5/php5.y:1987 { caseList := &ast.StmtCaseList{ast.Node{}, yyDollar[3].list} yyVAL.node = &ast.StmtSwitch{ast.Node{}, nil, caseList} @@ -4191,7 +4174,7 @@ yydefault: } case 124: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:2020 + // line internal/php5/php5.y:2003 { caseList := &ast.StmtCaseList{ast.Node{}, yyDollar[2].list} yyVAL.node = &ast.StmtAltSwitch{ast.Node{}, nil, caseList} @@ -4210,7 +4193,7 @@ yydefault: } case 125: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:2037 + // line internal/php5/php5.y:2020 { caseList := &ast.StmtCaseList{ast.Node{}, yyDollar[3].list} @@ -4231,7 +4214,7 @@ yydefault: } case 126: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:2060 + // line internal/php5/php5.y:2043 { yyVAL.list = []ast.Vertex{} @@ -4239,7 +4222,7 @@ yydefault: } case 127: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:2066 + // line internal/php5/php5.y:2049 { _case := &ast.StmtCase{ast.Node{}, yyDollar[3].node, yyDollar[5].list} yyVAL.list = append(yyDollar[1].list, _case) @@ -4256,7 +4239,7 @@ yydefault: } case 128: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:2081 + // line internal/php5/php5.y:2064 { _default := &ast.StmtDefault{ast.Node{}, yyDollar[4].list} yyVAL.list = append(yyDollar[1].list, _default) @@ -4273,19 +4256,19 @@ yydefault: } case 129: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2100 + // line internal/php5/php5.y:2083 { yyVAL.token = yyDollar[1].token } case 130: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2104 + // line internal/php5/php5.y:2087 { yyVAL.token = yyDollar[1].token } case 131: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2112 + // line internal/php5/php5.y:2095 { yyVAL.node = &ast.StmtWhile{ast.Node{}, nil, yyDollar[1].node} @@ -4296,7 +4279,7 @@ yydefault: } case 132: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:2121 + // line internal/php5/php5.y:2104 { stmtList := &ast.StmtStmtList{ast.Node{}, yyDollar[2].list} yyVAL.node = &ast.StmtAltWhile{ast.Node{}, nil, stmtList} @@ -4315,7 +4298,7 @@ yydefault: } case 133: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:2143 + // line internal/php5/php5.y:2126 { yyVAL.list = nil @@ -4323,7 +4306,7 @@ yydefault: } case 134: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:2149 + // line internal/php5/php5.y:2132 { _elseIf := &ast.StmtElseIf{ast.Node{}, yyDollar[3].node, yyDollar[4].node} yyVAL.list = append(yyDollar[1].list, _elseIf) @@ -4346,7 +4329,7 @@ yydefault: } case 135: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:2172 + // line internal/php5/php5.y:2155 { yyVAL.list = nil @@ -4354,7 +4337,7 @@ yydefault: } case 136: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:2178 + // line internal/php5/php5.y:2161 { stmts := &ast.StmtStmtList{ast.Node{}, yyDollar[5].list} _elseIf := &ast.StmtAltElseIf{ast.Node{}, yyDollar[3].node, stmts} @@ -4380,7 +4363,7 @@ yydefault: } case 137: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:2204 + // line internal/php5/php5.y:2187 { yyVAL.node = nil @@ -4388,7 +4371,7 @@ yydefault: } case 138: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2210 + // line internal/php5/php5.y:2193 { yyVAL.node = &ast.StmtElse{ast.Node{}, yyDollar[2].node} @@ -4402,7 +4385,7 @@ yydefault: } case 139: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:2226 + // line internal/php5/php5.y:2209 { yyVAL.node = nil @@ -4410,7 +4393,7 @@ yydefault: } case 140: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2232 + // line internal/php5/php5.y:2215 { stmts := &ast.StmtStmtList{ast.Node{}, yyDollar[3].list} yyVAL.node = &ast.StmtAltElse{ast.Node{}, stmts} @@ -4427,7 +4410,7 @@ yydefault: } case 141: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2251 + // line internal/php5/php5.y:2234 { yyVAL.list = yyDollar[1].list @@ -4435,7 +4418,7 @@ yydefault: } case 142: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:2257 + // line internal/php5/php5.y:2240 { yyVAL.list = nil @@ -4443,7 +4426,7 @@ yydefault: } case 143: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2266 + // line internal/php5/php5.y:2249 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -4451,7 +4434,7 @@ yydefault: } case 144: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2272 + // line internal/php5/php5.y:2255 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4462,7 +4445,7 @@ yydefault: } case 145: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:2284 + // line internal/php5/php5.y:2267 { identifier := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} identifier.GetNode().Position = position.NewTokenPosition(yyDollar[4].token) @@ -4500,7 +4483,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php5/php5.y:2320 + // line internal/php5/php5.y:2303 { identifier := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} identifier.GetNode().Position = position.NewTokenPosition(yyDollar[4].token) @@ -4539,7 +4522,7 @@ yydefault: } case 147: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:2361 + // line internal/php5/php5.y:2344 { yyVAL.node = nil @@ -4547,7 +4530,7 @@ yydefault: } case 148: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2367 + // line internal/php5/php5.y:2350 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -4561,7 +4544,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2379 + // line internal/php5/php5.y:2362 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -4575,7 +4558,7 @@ yydefault: } case 150: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2391 + // line internal/php5/php5.y:2374 { yyVAL.node = yyDollar[1].node @@ -4583,7 +4566,7 @@ yydefault: } case 151: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2401 + // line internal/php5/php5.y:2384 { yyVAL.node = &ast.ArgumentList{ast.Node{}, nil} @@ -4598,7 +4581,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2414 + // line internal/php5/php5.y:2397 { yyVAL.node = &ast.ArgumentList{ast.Node{}, yyDollar[2].list} @@ -4613,7 +4596,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2427 + // line internal/php5/php5.y:2410 { arg := &ast.Argument{ast.Node{}, false, false, yyDollar[2].node} yyVAL.node = &ast.ArgumentList{ast.Node{}, []ast.Vertex{arg}} @@ -4630,7 +4613,7 @@ yydefault: } case 154: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2446 + // line internal/php5/php5.y:2429 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -4638,7 +4621,7 @@ yydefault: } case 155: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2452 + // line internal/php5/php5.y:2435 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4649,7 +4632,7 @@ yydefault: } case 156: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2464 + // line internal/php5/php5.y:2447 { yyVAL.node = &ast.Argument{ast.Node{}, false, false, yyDollar[1].node} @@ -4663,7 +4646,7 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2476 + // line internal/php5/php5.y:2459 { yyVAL.node = &ast.Argument{ast.Node{}, false, false, yyDollar[1].node} @@ -4677,7 +4660,7 @@ yydefault: } case 158: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2488 + // line internal/php5/php5.y:2471 { yyVAL.node = &ast.Argument{ast.Node{}, false, true, yyDollar[2].node} @@ -4691,7 +4674,7 @@ yydefault: } case 159: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2500 + // line internal/php5/php5.y:2483 { yyVAL.node = &ast.Argument{ast.Node{}, true, false, yyDollar[2].node} @@ -4705,7 +4688,7 @@ yydefault: } case 160: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2515 + // line internal/php5/php5.y:2498 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4716,7 +4699,7 @@ yydefault: } case 161: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2524 + // line internal/php5/php5.y:2507 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -4724,7 +4707,7 @@ yydefault: } case 162: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2534 + // line internal/php5/php5.y:2517 { name := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.ExprVariable{ast.Node{}, name} @@ -4740,7 +4723,7 @@ yydefault: } case 163: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2548 + // line internal/php5/php5.y:2531 { yyVAL.node = &ast.ExprVariable{ast.Node{}, yyDollar[2].node} @@ -4754,7 +4737,7 @@ yydefault: } case 164: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:2560 + // line internal/php5/php5.y:2543 { yyVAL.node = &ast.ExprVariable{ast.Node{}, yyDollar[3].node} @@ -4770,7 +4753,7 @@ yydefault: } case 165: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2578 + // line internal/php5/php5.y:2561 { identifier := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -4790,7 +4773,7 @@ yydefault: } case 166: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:2596 + // line internal/php5/php5.y:2579 { identifier := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -4811,7 +4794,7 @@ yydefault: } case 167: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2615 + // line internal/php5/php5.y:2598 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -4830,7 +4813,7 @@ yydefault: } case 168: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2632 + // line internal/php5/php5.y:2615 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -4850,7 +4833,7 @@ yydefault: } case 169: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2654 + // line internal/php5/php5.y:2637 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -4858,7 +4841,7 @@ yydefault: } case 170: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:2660 + // line internal/php5/php5.y:2643 { yyVAL.list = []ast.Vertex{} @@ -4866,7 +4849,7 @@ yydefault: } case 171: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2670 + // line internal/php5/php5.y:2653 { yyVAL.node = &ast.StmtPropertyList{ast.Node{}, yyDollar[1].list, nil, yyDollar[2].list} @@ -4882,7 +4865,7 @@ yydefault: } case 172: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2684 + // line internal/php5/php5.y:2667 { yyVAL.node = yyDollar[1].node @@ -4897,7 +4880,7 @@ yydefault: } case 173: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2697 + // line internal/php5/php5.y:2680 { yyVAL.node = yyDollar[1].node @@ -4905,7 +4888,7 @@ yydefault: } case 174: yyDollar = yyS[yypt-8 : yypt+1] - // line internal/php5/php5.y:2703 + // line internal/php5/php5.y:2686 { name := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} yyVAL.node = &ast.StmtClassMethod{ast.Node{}, yyDollar[3].token != nil, name, yyDollar[1].list, yyDollar[6].list, nil, yyDollar[8].node} @@ -4938,7 +4921,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2737 + // line internal/php5/php5.y:2720 { yyVAL.node = &ast.StmtTraitUse{ast.Node{}, yyDollar[2].list, yyDollar[3].node} @@ -4952,7 +4935,7 @@ yydefault: } case 176: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2752 + // line internal/php5/php5.y:2735 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -4960,7 +4943,7 @@ yydefault: } case 177: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2758 + // line internal/php5/php5.y:2741 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4971,7 +4954,7 @@ yydefault: } case 178: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2770 + // line internal/php5/php5.y:2753 { yyVAL.node = &ast.StmtNop{ast.Node{}} @@ -4985,7 +4968,7 @@ yydefault: } case 179: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2782 + // line internal/php5/php5.y:2765 { yyVAL.node = &ast.StmtTraitAdaptationList{ast.Node{}, yyDollar[2].list} @@ -4999,7 +4982,7 @@ yydefault: } case 180: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:2797 + // line internal/php5/php5.y:2780 { yyVAL.list = nil @@ -5007,7 +4990,7 @@ yydefault: } case 181: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2803 + // line internal/php5/php5.y:2786 { yyVAL.list = yyDollar[1].list @@ -5015,7 +4998,7 @@ yydefault: } case 182: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2812 + // line internal/php5/php5.y:2795 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -5023,7 +5006,7 @@ yydefault: } case 183: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2818 + // line internal/php5/php5.y:2801 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -5031,7 +5014,7 @@ yydefault: } case 184: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2827 + // line internal/php5/php5.y:2810 { yyVAL.node = yyDollar[1].node @@ -5043,7 +5026,7 @@ yydefault: } case 185: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2837 + // line internal/php5/php5.y:2820 { yyVAL.node = yyDollar[1].node @@ -5055,7 +5038,7 @@ yydefault: } case 186: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2850 + // line internal/php5/php5.y:2833 { yyVAL.node = &ast.StmtTraitUsePrecedence{ast.Node{}, yyDollar[1].node, yyDollar[3].list} @@ -5070,7 +5053,7 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2866 + // line internal/php5/php5.y:2849 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -5078,7 +5061,7 @@ yydefault: } case 188: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2872 + // line internal/php5/php5.y:2855 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5089,7 +5072,7 @@ yydefault: } case 189: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2884 + // line internal/php5/php5.y:2867 { name := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.StmtTraitMethodRef{ast.Node{}, nil, name} @@ -5105,7 +5088,7 @@ yydefault: } case 190: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2898 + // line internal/php5/php5.y:2881 { yyVAL.node = yyDollar[1].node @@ -5113,7 +5096,7 @@ yydefault: } case 191: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2907 + // line internal/php5/php5.y:2890 { target := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.StmtTraitMethodRef{ast.Node{}, yyDollar[1].node, target} @@ -5131,7 +5114,7 @@ yydefault: } case 192: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:2926 + // line internal/php5/php5.y:2909 { alias := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} yyVAL.node = &ast.StmtTraitUseAlias{ast.Node{}, yyDollar[1].node, yyDollar[3].node, alias} @@ -5149,7 +5132,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2942 + // line internal/php5/php5.y:2925 { yyVAL.node = &ast.StmtTraitUseAlias{ast.Node{}, yyDollar[1].node, yyDollar[3].node, nil} @@ -5164,7 +5147,7 @@ yydefault: } case 194: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:2958 + // line internal/php5/php5.y:2941 { yyVAL.node = nil @@ -5172,7 +5155,7 @@ yydefault: } case 195: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2964 + // line internal/php5/php5.y:2947 { yyVAL.node = yyDollar[1].node @@ -5180,7 +5163,7 @@ yydefault: } case 196: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2973 + // line internal/php5/php5.y:2956 { yyVAL.node = &ast.StmtNop{ast.Node{}} @@ -5195,7 +5178,7 @@ yydefault: } case 197: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2986 + // line internal/php5/php5.y:2969 { yyVAL.node = &ast.StmtStmtList{ast.Node{}, yyDollar[2].list} @@ -5210,7 +5193,7 @@ yydefault: } case 198: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3002 + // line internal/php5/php5.y:2985 { yyVAL.list = yyDollar[1].list @@ -5218,7 +5201,7 @@ yydefault: } case 199: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3008 + // line internal/php5/php5.y:2991 { modifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.list = []ast.Vertex{modifier} @@ -5233,7 +5216,7 @@ yydefault: } case 200: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:3024 + // line internal/php5/php5.y:3007 { yyVAL.list = nil @@ -5241,7 +5224,7 @@ yydefault: } case 201: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3030 + // line internal/php5/php5.y:3013 { yyVAL.list = yyDollar[1].list @@ -5249,7 +5232,7 @@ yydefault: } case 202: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3039 + // line internal/php5/php5.y:3022 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -5257,7 +5240,7 @@ yydefault: } case 203: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3045 + // line internal/php5/php5.y:3028 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -5265,7 +5248,7 @@ yydefault: } case 204: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3054 + // line internal/php5/php5.y:3037 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -5279,7 +5262,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3066 + // line internal/php5/php5.y:3049 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -5293,7 +5276,7 @@ yydefault: } case 206: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3078 + // line internal/php5/php5.y:3061 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -5307,7 +5290,7 @@ yydefault: } case 207: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3090 + // line internal/php5/php5.y:3073 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -5321,7 +5304,7 @@ yydefault: } case 208: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3102 + // line internal/php5/php5.y:3085 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -5335,7 +5318,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3114 + // line internal/php5/php5.y:3097 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -5349,7 +5332,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3129 + // line internal/php5/php5.y:3112 { identifier := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -5369,7 +5352,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:3147 + // line internal/php5/php5.y:3130 { identifier := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -5390,7 +5373,7 @@ yydefault: } case 212: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3166 + // line internal/php5/php5.y:3149 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -5409,7 +5392,7 @@ yydefault: } case 213: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3183 + // line internal/php5/php5.y:3166 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -5429,7 +5412,7 @@ yydefault: } case 214: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:3204 + // line internal/php5/php5.y:3187 { name := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} constant := &ast.StmtConstant{ast.Node{}, name, yyDollar[5].node} @@ -5452,7 +5435,7 @@ yydefault: } case 215: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3225 + // line internal/php5/php5.y:3208 { name := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} constant := &ast.StmtConstant{ast.Node{}, name, yyDollar[4].node} @@ -5472,7 +5455,7 @@ yydefault: } case 216: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3246 + // line internal/php5/php5.y:3229 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5483,7 +5466,7 @@ yydefault: } case 217: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3255 + // line internal/php5/php5.y:3238 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -5491,7 +5474,7 @@ yydefault: } case 218: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:3265 + // line internal/php5/php5.y:3248 { yyVAL.list = nil @@ -5499,7 +5482,7 @@ yydefault: } case 219: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3271 + // line internal/php5/php5.y:3254 { yyVAL.list = yyDollar[1].list @@ -5507,7 +5490,7 @@ yydefault: } case 220: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3280 + // line internal/php5/php5.y:3263 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5518,7 +5501,7 @@ yydefault: } case 221: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3289 + // line internal/php5/php5.y:3272 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -5526,7 +5509,7 @@ yydefault: } case 222: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3298 + // line internal/php5/php5.y:3281 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -5534,7 +5517,7 @@ yydefault: } case 223: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3304 + // line internal/php5/php5.y:3287 { yyVAL.list = yyDollar[1].list @@ -5542,7 +5525,7 @@ yydefault: } case 224: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3313 + // line internal/php5/php5.y:3296 { fetch := &ast.ExprArrayDimFetch{ast.Node{}, nil, yyDollar[3].node} yyVAL.list = append(yyDollar[1].list, fetch) @@ -5558,7 +5541,7 @@ yydefault: } case 225: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3327 + // line internal/php5/php5.y:3310 { fetch := &ast.ExprArrayDimFetch{ast.Node{}, nil, yyDollar[2].node} yyVAL.list = []ast.Vertex{fetch} @@ -5574,7 +5557,7 @@ yydefault: } case 226: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3344 + // line internal/php5/php5.y:3327 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -5582,7 +5565,7 @@ yydefault: } case 227: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3350 + // line internal/php5/php5.y:3333 { yyVAL.list = yyDollar[1].list @@ -5590,7 +5573,7 @@ yydefault: } case 228: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3356 + // line internal/php5/php5.y:3339 { yyVAL.list = yyDollar[1].list @@ -5598,7 +5581,7 @@ yydefault: } case 229: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:3365 + // line internal/php5/php5.y:3348 { yyVAL.list = nil @@ -5606,7 +5589,7 @@ yydefault: } case 230: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3371 + // line internal/php5/php5.y:3354 { yyVAL.list = yyDollar[1].list @@ -5614,7 +5597,7 @@ yydefault: } case 231: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3380 + // line internal/php5/php5.y:3363 { if yyDollar[3].node != nil { @@ -5632,7 +5615,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php5/php5.y:3399 + // line internal/php5/php5.y:3382 { listNode := &ast.ExprList{ast.Node{}, yyDollar[3].list} yyVAL.node = &ast.ExprAssign{ast.Node{}, listNode, yyDollar[6].node} @@ -5651,7 +5634,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3416 + // line internal/php5/php5.y:3399 { yyVAL.node = &ast.ExprAssign{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5666,7 +5649,7 @@ yydefault: } case 234: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3429 + // line internal/php5/php5.y:3412 { yyVAL.node = &ast.ExprAssignReference{ast.Node{}, yyDollar[1].node, yyDollar[4].node} @@ -5682,7 +5665,7 @@ yydefault: } case 235: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php5/php5.y:3443 + // line internal/php5/php5.y:3426 { var _new *ast.ExprNew @@ -5711,7 +5694,7 @@ yydefault: } case 236: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3470 + // line internal/php5/php5.y:3453 { yyVAL.node = &ast.ExprClone{ast.Node{}, yyDollar[2].node} @@ -5725,7 +5708,7 @@ yydefault: } case 237: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3482 + // line internal/php5/php5.y:3465 { yyVAL.node = &ast.ExprAssignPlus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5739,7 +5722,7 @@ yydefault: } case 238: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3494 + // line internal/php5/php5.y:3477 { yyVAL.node = &ast.ExprAssignMinus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5754,7 +5737,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3507 + // line internal/php5/php5.y:3490 { yyVAL.node = &ast.ExprAssignMul{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5769,7 +5752,7 @@ yydefault: } case 240: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3520 + // line internal/php5/php5.y:3503 { yyVAL.node = &ast.ExprAssignPow{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5784,7 +5767,7 @@ yydefault: } case 241: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3533 + // line internal/php5/php5.y:3516 { yyVAL.node = &ast.ExprAssignDiv{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5799,7 +5782,7 @@ yydefault: } case 242: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3546 + // line internal/php5/php5.y:3529 { yyVAL.node = &ast.ExprAssignConcat{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5814,7 +5797,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3559 + // line internal/php5/php5.y:3542 { yyVAL.node = &ast.ExprAssignMod{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5829,7 +5812,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3572 + // line internal/php5/php5.y:3555 { yyVAL.node = &ast.ExprAssignBitwiseAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5844,7 +5827,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3585 + // line internal/php5/php5.y:3568 { yyVAL.node = &ast.ExprAssignBitwiseOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5859,7 +5842,7 @@ yydefault: } case 246: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3598 + // line internal/php5/php5.y:3581 { yyVAL.node = &ast.ExprAssignBitwiseXor{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5874,7 +5857,7 @@ yydefault: } case 247: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3611 + // line internal/php5/php5.y:3594 { yyVAL.node = &ast.ExprAssignShiftLeft{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5889,7 +5872,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3624 + // line internal/php5/php5.y:3607 { yyVAL.node = &ast.ExprAssignShiftRight{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5904,7 +5887,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3637 + // line internal/php5/php5.y:3620 { yyVAL.node = &ast.ExprPostInc{ast.Node{}, yyDollar[1].node} @@ -5919,7 +5902,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3650 + // line internal/php5/php5.y:3633 { yyVAL.node = &ast.ExprPreInc{ast.Node{}, yyDollar[2].node} @@ -5933,7 +5916,7 @@ yydefault: } case 251: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3662 + // line internal/php5/php5.y:3645 { yyVAL.node = &ast.ExprPostDec{ast.Node{}, yyDollar[1].node} @@ -5948,7 +5931,7 @@ yydefault: } case 252: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3675 + // line internal/php5/php5.y:3658 { yyVAL.node = &ast.ExprPreDec{ast.Node{}, yyDollar[2].node} @@ -5962,7 +5945,7 @@ yydefault: } case 253: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3687 + // line internal/php5/php5.y:3670 { yyVAL.node = &ast.ExprBinaryBooleanOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5977,7 +5960,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3700 + // line internal/php5/php5.y:3683 { yyVAL.node = &ast.ExprBinaryBooleanAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5992,7 +5975,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3713 + // line internal/php5/php5.y:3696 { yyVAL.node = &ast.ExprBinaryLogicalOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6007,7 +5990,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3726 + // line internal/php5/php5.y:3709 { yyVAL.node = &ast.ExprBinaryLogicalAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6022,7 +6005,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3739 + // line internal/php5/php5.y:3722 { yyVAL.node = &ast.ExprBinaryLogicalXor{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6037,7 +6020,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3752 + // line internal/php5/php5.y:3735 { yyVAL.node = &ast.ExprBinaryBitwiseOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6052,7 +6035,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3765 + // line internal/php5/php5.y:3748 { yyVAL.node = &ast.ExprBinaryBitwiseAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6067,7 +6050,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3778 + // line internal/php5/php5.y:3761 { yyVAL.node = &ast.ExprBinaryBitwiseXor{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6082,7 +6065,7 @@ yydefault: } case 261: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3791 + // line internal/php5/php5.y:3774 { yyVAL.node = &ast.ExprBinaryConcat{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6097,7 +6080,7 @@ yydefault: } case 262: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3804 + // line internal/php5/php5.y:3787 { yyVAL.node = &ast.ExprBinaryPlus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6112,7 +6095,7 @@ yydefault: } case 263: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3817 + // line internal/php5/php5.y:3800 { yyVAL.node = &ast.ExprBinaryMinus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6127,7 +6110,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3830 + // line internal/php5/php5.y:3813 { yyVAL.node = &ast.ExprBinaryMul{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6142,7 +6125,7 @@ yydefault: } case 265: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3843 + // line internal/php5/php5.y:3826 { yyVAL.node = &ast.ExprBinaryPow{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6157,7 +6140,7 @@ yydefault: } case 266: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3856 + // line internal/php5/php5.y:3839 { yyVAL.node = &ast.ExprBinaryDiv{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6172,7 +6155,7 @@ yydefault: } case 267: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3869 + // line internal/php5/php5.y:3852 { yyVAL.node = &ast.ExprBinaryMod{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6187,7 +6170,7 @@ yydefault: } case 268: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3882 + // line internal/php5/php5.y:3865 { yyVAL.node = &ast.ExprBinaryShiftLeft{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6202,7 +6185,7 @@ yydefault: } case 269: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3895 + // line internal/php5/php5.y:3878 { yyVAL.node = &ast.ExprBinaryShiftRight{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6217,7 +6200,7 @@ yydefault: } case 270: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3908 + // line internal/php5/php5.y:3891 { yyVAL.node = &ast.ExprUnaryPlus{ast.Node{}, yyDollar[2].node} @@ -6231,7 +6214,7 @@ yydefault: } case 271: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3920 + // line internal/php5/php5.y:3903 { yyVAL.node = &ast.ExprUnaryMinus{ast.Node{}, yyDollar[2].node} @@ -6245,7 +6228,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3932 + // line internal/php5/php5.y:3915 { yyVAL.node = &ast.ExprBooleanNot{ast.Node{}, yyDollar[2].node} @@ -6259,7 +6242,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3944 + // line internal/php5/php5.y:3927 { yyVAL.node = &ast.ExprBitwiseNot{ast.Node{}, yyDollar[2].node} @@ -6273,7 +6256,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3956 + // line internal/php5/php5.y:3939 { yyVAL.node = &ast.ExprBinaryIdentical{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6288,7 +6271,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3969 + // line internal/php5/php5.y:3952 { yyVAL.node = &ast.ExprBinaryNotIdentical{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6303,7 +6286,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3982 + // line internal/php5/php5.y:3965 { yyVAL.node = &ast.ExprBinaryEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6318,7 +6301,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3995 + // line internal/php5/php5.y:3978 { yyVAL.node = &ast.ExprBinaryNotEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6334,7 +6317,7 @@ yydefault: } case 278: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4009 + // line internal/php5/php5.y:3992 { yyVAL.node = &ast.ExprBinarySmaller{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6349,7 +6332,7 @@ yydefault: } case 279: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4022 + // line internal/php5/php5.y:4005 { yyVAL.node = &ast.ExprBinarySmallerOrEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6364,7 +6347,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4035 + // line internal/php5/php5.y:4018 { yyVAL.node = &ast.ExprBinaryGreater{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6379,7 +6362,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4048 + // line internal/php5/php5.y:4031 { yyVAL.node = &ast.ExprBinaryGreaterOrEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6394,7 +6377,7 @@ yydefault: } case 282: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4061 + // line internal/php5/php5.y:4044 { yyVAL.node = &ast.ExprInstanceOf{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6409,7 +6392,7 @@ yydefault: } case 283: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4074 + // line internal/php5/php5.y:4057 { yyVAL.node = yyDollar[1].node @@ -6422,7 +6405,7 @@ yydefault: } case 284: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4083 + // line internal/php5/php5.y:4066 { yyVAL.node = yyDollar[1].node @@ -6430,7 +6413,7 @@ yydefault: } case 285: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4089 + // line internal/php5/php5.y:4072 { yyVAL.node = yyDollar[2].node @@ -6464,7 +6447,7 @@ yydefault: } case 286: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:4121 + // line internal/php5/php5.y:4104 { yyVAL.node = &ast.ExprTernary{ast.Node{}, yyDollar[1].node, yyDollar[3].node, yyDollar[5].node} @@ -6480,7 +6463,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4135 + // line internal/php5/php5.y:4118 { yyVAL.node = &ast.ExprTernary{ast.Node{}, yyDollar[1].node, nil, yyDollar[4].node} @@ -6496,7 +6479,7 @@ yydefault: } case 288: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4149 + // line internal/php5/php5.y:4132 { yyVAL.node = yyDollar[1].node @@ -6504,7 +6487,7 @@ yydefault: } case 289: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4155 + // line internal/php5/php5.y:4138 { yyVAL.node = &ast.ExprCastInt{ast.Node{}, yyDollar[2].node} @@ -6519,7 +6502,7 @@ yydefault: } case 290: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4168 + // line internal/php5/php5.y:4151 { yyVAL.node = &ast.ExprCastDouble{ast.Node{}, yyDollar[2].node} @@ -6534,7 +6517,7 @@ yydefault: } case 291: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4181 + // line internal/php5/php5.y:4164 { yyVAL.node = &ast.ExprCastString{ast.Node{}, yyDollar[2].node} @@ -6549,7 +6532,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4194 + // line internal/php5/php5.y:4177 { yyVAL.node = &ast.ExprCastArray{ast.Node{}, yyDollar[2].node} @@ -6564,7 +6547,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4207 + // line internal/php5/php5.y:4190 { yyVAL.node = &ast.ExprCastObject{ast.Node{}, yyDollar[2].node} @@ -6579,7 +6562,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4220 + // line internal/php5/php5.y:4203 { yyVAL.node = &ast.ExprCastBool{ast.Node{}, yyDollar[2].node} @@ -6594,7 +6577,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4233 + // line internal/php5/php5.y:4216 { yyVAL.node = &ast.ExprCastUnset{ast.Node{}, yyDollar[2].node} @@ -6609,7 +6592,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4246 + // line internal/php5/php5.y:4229 { e := yyDollar[2].node.(*ast.ExprExit) yyVAL.node = yyDollar[2].node @@ -6632,7 +6615,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4267 + // line internal/php5/php5.y:4250 { yyVAL.node = &ast.ExprErrorSuppress{ast.Node{}, yyDollar[2].node} @@ -6646,7 +6629,7 @@ yydefault: } case 298: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4279 + // line internal/php5/php5.y:4262 { yyVAL.node = yyDollar[1].node @@ -6654,7 +6637,7 @@ yydefault: } case 299: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4285 + // line internal/php5/php5.y:4268 { yyVAL.node = yyDollar[1].node @@ -6662,7 +6645,7 @@ yydefault: } case 300: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4291 + // line internal/php5/php5.y:4274 { yyVAL.node = yyDollar[1].node @@ -6670,7 +6653,7 @@ yydefault: } case 301: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4297 + // line internal/php5/php5.y:4280 { yyVAL.node = &ast.ExprShellExec{ast.Node{}, yyDollar[2].list} @@ -6684,7 +6667,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4309 + // line internal/php5/php5.y:4292 { yyVAL.node = &ast.ExprPrint{ast.Node{}, yyDollar[2].node} @@ -6698,7 +6681,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4321 + // line internal/php5/php5.y:4304 { yyVAL.node = &ast.ExprYield{ast.Node{}, nil, nil} @@ -6712,7 +6695,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-9 : yypt+1] - // line internal/php5/php5.y:4333 + // line internal/php5/php5.y:4316 { yyVAL.node = &ast.ExprClosure{ast.Node{}, yyDollar[2].token != nil, false, yyDollar[4].list, yyDollar[6].ClosureUse, nil, yyDollar[8].list} @@ -6741,7 +6724,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-10 : yypt+1] - // line internal/php5/php5.y:4359 + // line internal/php5/php5.y:4342 { yyVAL.node = &ast.ExprClosure{ast.Node{}, yyDollar[3].token != nil, true, yyDollar[5].list, yyDollar[7].ClosureUse, nil, yyDollar[9].list} @@ -6771,7 +6754,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4389 + // line internal/php5/php5.y:4372 { yyVAL.node = &ast.ExprYield{ast.Node{}, nil, yyDollar[2].node} @@ -6785,7 +6768,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4401 + // line internal/php5/php5.y:4384 { yyVAL.node = &ast.ExprYield{ast.Node{}, nil, yyDollar[2].node} @@ -6799,7 +6782,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4413 + // line internal/php5/php5.y:4396 { yyVAL.node = &ast.ExprYield{ast.Node{}, yyDollar[2].node, yyDollar[4].node} @@ -6814,7 +6797,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4426 + // line internal/php5/php5.y:4409 { yyVAL.node = &ast.ExprYield{ast.Node{}, yyDollar[2].node, yyDollar[4].node} @@ -6829,7 +6812,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4442 + // line internal/php5/php5.y:4425 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6845,7 +6828,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4456 + // line internal/php5/php5.y:4439 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6861,7 +6844,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4470 + // line internal/php5/php5.y:4453 { str := &ast.ScalarString{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, str, yyDollar[3].node} @@ -6879,7 +6862,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4486 + // line internal/php5/php5.y:4469 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6895,7 +6878,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4503 + // line internal/php5/php5.y:4486 { yyVAL.node = &ast.ExprArray{ast.Node{}, yyDollar[3].list} @@ -6911,7 +6894,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4517 + // line internal/php5/php5.y:4500 { yyVAL.node = &ast.ExprShortArray{ast.Node{}, yyDollar[2].list} @@ -6926,13 +6909,13 @@ yydefault: } case 316: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4533 + // line internal/php5/php5.y:4516 { yyVAL.token = yyDollar[1].token } case 317: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:4540 + // line internal/php5/php5.y:4523 { yyVAL.ClosureUse = nil @@ -6940,7 +6923,7 @@ yydefault: } case 318: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4546 + // line internal/php5/php5.y:4529 { yyVAL.ClosureUse = &ast.ExprClosureUse{ast.Node{}, yyDollar[3].list} @@ -6956,7 +6939,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4563 + // line internal/php5/php5.y:4546 { identifier := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -6974,7 +6957,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4579 + // line internal/php5/php5.y:4562 { identifier := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -6995,7 +6978,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4598 + // line internal/php5/php5.y:4581 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -7012,7 +6995,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4613 + // line internal/php5/php5.y:4596 { identifier := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -7032,7 +7015,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4634 + // line internal/php5/php5.y:4617 { name := &ast.NameName{ast.Node{}, yyDollar[1].list} yyVAL.node = &ast.ExprFunctionCall{ast.Node{}, name, yyDollar[2].node.(*ast.ArgumentList)} @@ -7048,7 +7031,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4648 + // line internal/php5/php5.y:4631 { funcName := &ast.NameRelative{ast.Node{}, yyDollar[3].list} yyVAL.node = &ast.ExprFunctionCall{ast.Node{}, funcName, yyDollar[4].node.(*ast.ArgumentList)} @@ -7065,7 +7048,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4663 + // line internal/php5/php5.y:4646 { funcName := &ast.NameFullyQualified{ast.Node{}, yyDollar[2].list} yyVAL.node = &ast.ExprFunctionCall{ast.Node{}, funcName, yyDollar[3].node.(*ast.ArgumentList)} @@ -7081,7 +7064,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4677 + // line internal/php5/php5.y:4660 { yyVAL.node = &ast.ExprStaticCall{ast.Node{}, yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*ast.ArgumentList)} @@ -7096,7 +7079,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4690 + // line internal/php5/php5.y:4673 { yyVAL.node = &ast.ExprStaticCall{ast.Node{}, yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*ast.ArgumentList)} @@ -7111,7 +7094,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4703 + // line internal/php5/php5.y:4686 { yyVAL.node = &ast.ExprStaticCall{ast.Node{}, yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*ast.ArgumentList)} @@ -7126,7 +7109,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4716 + // line internal/php5/php5.y:4699 { yyVAL.node = &ast.ExprStaticCall{ast.Node{}, yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*ast.ArgumentList)} @@ -7141,7 +7124,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4729 + // line internal/php5/php5.y:4712 { yyVAL.node = &ast.ExprFunctionCall{ast.Node{}, yyDollar[1].node, yyDollar[2].node.(*ast.ArgumentList)} @@ -7155,7 +7138,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4744 + // line internal/php5/php5.y:4727 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -7169,7 +7152,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4756 + // line internal/php5/php5.y:4739 { yyVAL.node = &ast.NameName{ast.Node{}, yyDollar[1].list} @@ -7183,7 +7166,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4768 + // line internal/php5/php5.y:4751 { yyVAL.node = &ast.NameRelative{ast.Node{}, yyDollar[3].list} @@ -7198,7 +7181,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4781 + // line internal/php5/php5.y:4764 { yyVAL.node = &ast.NameFullyQualified{ast.Node{}, yyDollar[2].list} @@ -7212,7 +7195,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4796 + // line internal/php5/php5.y:4779 { yyVAL.node = &ast.NameName{ast.Node{}, yyDollar[1].list} @@ -7226,7 +7209,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4808 + // line internal/php5/php5.y:4791 { yyVAL.node = &ast.NameRelative{ast.Node{}, yyDollar[3].list} @@ -7241,7 +7224,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4821 + // line internal/php5/php5.y:4804 { yyVAL.node = &ast.NameFullyQualified{ast.Node{}, yyDollar[2].list} @@ -7255,7 +7238,7 @@ yydefault: } case 338: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4836 + // line internal/php5/php5.y:4819 { yyVAL.node = yyDollar[1].node @@ -7263,7 +7246,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4842 + // line internal/php5/php5.y:4825 { yyVAL.node = yyDollar[1].node @@ -7271,7 +7254,7 @@ yydefault: } case 340: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4851 + // line internal/php5/php5.y:4834 { yyVAL.node = yyDollar[1].node @@ -7314,7 +7297,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4892 + // line internal/php5/php5.y:4875 { yyVAL.node = yyDollar[1].node @@ -7322,7 +7305,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4902 + // line internal/php5/php5.y:4885 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -7330,7 +7313,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:4908 + // line internal/php5/php5.y:4891 { yyVAL.list = []ast.Vertex{} @@ -7338,7 +7321,7 @@ yydefault: } case 344: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4918 + // line internal/php5/php5.y:4901 { yyVAL.list = yyDollar[2].list @@ -7349,7 +7332,7 @@ yydefault: } case 345: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:4930 + // line internal/php5/php5.y:4913 { yyVAL.node = &ast.ExprExit{ast.Node{}, false, nil} @@ -7357,7 +7340,7 @@ yydefault: } case 346: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4936 + // line internal/php5/php5.y:4919 { yyVAL.node = &ast.ExprExit{ast.Node{}, false, nil} @@ -7372,7 +7355,7 @@ yydefault: } case 347: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4949 + // line internal/php5/php5.y:4932 { yyVAL.node = &ast.ExprExit{ast.Node{}, false, yyDollar[1].node} @@ -7393,7 +7376,7 @@ yydefault: } case 348: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:4969 + // line internal/php5/php5.y:4952 { yyVAL.list = []ast.Vertex{} @@ -7401,7 +7384,7 @@ yydefault: } case 349: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4975 + // line internal/php5/php5.y:4958 { part := &ast.ScalarEncapsedStringPart{ast.Node{}, yyDollar[1].token.Value} yyVAL.list = []ast.Vertex{part} @@ -7413,7 +7396,7 @@ yydefault: } case 350: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4985 + // line internal/php5/php5.y:4968 { yyVAL.list = yyDollar[1].list @@ -7421,7 +7404,7 @@ yydefault: } case 351: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:4994 + // line internal/php5/php5.y:4977 { yyVAL.node = nil @@ -7429,7 +7412,7 @@ yydefault: } case 352: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5000 + // line internal/php5/php5.y:4983 { yyVAL.node = yyDollar[1].node @@ -7437,7 +7420,7 @@ yydefault: } case 353: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5009 + // line internal/php5/php5.y:4992 { yyVAL.node = &ast.ScalarLnumber{ast.Node{}, yyDollar[1].token.Value} @@ -7451,7 +7434,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5021 + // line internal/php5/php5.y:5004 { yyVAL.node = &ast.ScalarDnumber{ast.Node{}, yyDollar[1].token.Value} @@ -7465,7 +7448,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5033 + // line internal/php5/php5.y:5016 { yyVAL.node = &ast.ScalarString{ast.Node{}, yyDollar[1].token.Value} @@ -7479,7 +7462,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5045 + // line internal/php5/php5.y:5028 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -7493,7 +7476,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5057 + // line internal/php5/php5.y:5040 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -7507,7 +7490,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5069 + // line internal/php5/php5.y:5052 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -7521,7 +7504,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5081 + // line internal/php5/php5.y:5064 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -7535,7 +7518,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5093 + // line internal/php5/php5.y:5076 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -7549,7 +7532,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5105 + // line internal/php5/php5.y:5088 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -7563,7 +7546,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5117 + // line internal/php5/php5.y:5100 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -7577,7 +7560,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5129 + // line internal/php5/php5.y:5112 { encapsed := &ast.ScalarEncapsedStringPart{ast.Node{}, yyDollar[2].token.Value} yyVAL.node = &ast.ScalarHeredoc{ast.Node{}, yyDollar[1].token.Value, []ast.Vertex{encapsed}} @@ -7593,7 +7576,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5143 + // line internal/php5/php5.y:5126 { yyVAL.node = &ast.ScalarHeredoc{ast.Node{}, yyDollar[1].token.Value, nil} @@ -7607,7 +7590,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5158 + // line internal/php5/php5.y:5141 { target := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.ExprClassConstFetch{ast.Node{}, yyDollar[1].node, target} @@ -7625,7 +7608,7 @@ yydefault: } case 366: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5177 + // line internal/php5/php5.y:5160 { yyVAL.node = yyDollar[1].node @@ -7633,7 +7616,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5186 + // line internal/php5/php5.y:5169 { yyVAL.node = yyDollar[1].node @@ -7641,7 +7624,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5192 + // line internal/php5/php5.y:5175 { yyVAL.node = yyDollar[1].node @@ -7649,7 +7632,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5198 + // line internal/php5/php5.y:5181 { name := &ast.NameName{ast.Node{}, yyDollar[1].list} yyVAL.node = &ast.ExprConstFetch{ast.Node{}, name} @@ -7665,7 +7648,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5212 + // line internal/php5/php5.y:5195 { name := &ast.NameRelative{ast.Node{}, yyDollar[3].list} yyVAL.node = &ast.ExprConstFetch{ast.Node{}, name} @@ -7682,7 +7665,7 @@ yydefault: } case 371: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5227 + // line internal/php5/php5.y:5210 { name := &ast.NameFullyQualified{ast.Node{}, yyDollar[2].list} yyVAL.node = &ast.ExprConstFetch{ast.Node{}, name} @@ -7698,7 +7681,7 @@ yydefault: } case 372: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5241 + // line internal/php5/php5.y:5224 { yyVAL.node = &ast.ExprArray{ast.Node{}, yyDollar[3].list} @@ -7714,7 +7697,7 @@ yydefault: } case 373: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5255 + // line internal/php5/php5.y:5238 { yyVAL.node = &ast.ExprShortArray{ast.Node{}, yyDollar[2].list} @@ -7729,7 +7712,7 @@ yydefault: } case 374: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5268 + // line internal/php5/php5.y:5251 { yyVAL.node = yyDollar[1].node @@ -7737,7 +7720,7 @@ yydefault: } case 375: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5274 + // line internal/php5/php5.y:5257 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -7751,7 +7734,7 @@ yydefault: } case 376: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5286 + // line internal/php5/php5.y:5269 { yyVAL.node = yyDollar[1].node @@ -7759,7 +7742,7 @@ yydefault: } case 377: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5295 + // line internal/php5/php5.y:5278 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7775,7 +7758,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5309 + // line internal/php5/php5.y:5292 { yyVAL.node = &ast.ExprBinaryPlus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7790,7 +7773,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5322 + // line internal/php5/php5.y:5305 { yyVAL.node = &ast.ExprBinaryMinus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7805,7 +7788,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5335 + // line internal/php5/php5.y:5318 { yyVAL.node = &ast.ExprBinaryMul{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7820,7 +7803,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5348 + // line internal/php5/php5.y:5331 { yyVAL.node = &ast.ExprBinaryPow{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7835,7 +7818,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5361 + // line internal/php5/php5.y:5344 { yyVAL.node = &ast.ExprBinaryDiv{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7850,7 +7833,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5374 + // line internal/php5/php5.y:5357 { yyVAL.node = &ast.ExprBinaryMod{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7865,7 +7848,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5387 + // line internal/php5/php5.y:5370 { yyVAL.node = &ast.ExprBooleanNot{ast.Node{}, yyDollar[2].node} @@ -7879,7 +7862,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5399 + // line internal/php5/php5.y:5382 { yyVAL.node = &ast.ExprBitwiseNot{ast.Node{}, yyDollar[2].node} @@ -7893,7 +7876,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5411 + // line internal/php5/php5.y:5394 { yyVAL.node = &ast.ExprBinaryBitwiseOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7908,7 +7891,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5424 + // line internal/php5/php5.y:5407 { yyVAL.node = &ast.ExprBinaryBitwiseAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7923,7 +7906,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5437 + // line internal/php5/php5.y:5420 { yyVAL.node = &ast.ExprBinaryBitwiseXor{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7938,7 +7921,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5450 + // line internal/php5/php5.y:5433 { yyVAL.node = &ast.ExprBinaryShiftLeft{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7953,7 +7936,7 @@ yydefault: } case 390: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5463 + // line internal/php5/php5.y:5446 { yyVAL.node = &ast.ExprBinaryShiftRight{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7968,7 +7951,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5476 + // line internal/php5/php5.y:5459 { yyVAL.node = &ast.ExprBinaryConcat{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7983,7 +7966,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5489 + // line internal/php5/php5.y:5472 { yyVAL.node = &ast.ExprBinaryLogicalXor{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7998,7 +7981,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5502 + // line internal/php5/php5.y:5485 { yyVAL.node = &ast.ExprBinaryLogicalAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -8013,7 +7996,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5515 + // line internal/php5/php5.y:5498 { yyVAL.node = &ast.ExprBinaryLogicalOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -8028,7 +8011,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5528 + // line internal/php5/php5.y:5511 { yyVAL.node = &ast.ExprBinaryBooleanAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -8043,7 +8026,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5541 + // line internal/php5/php5.y:5524 { yyVAL.node = &ast.ExprBinaryBooleanOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -8058,7 +8041,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5554 + // line internal/php5/php5.y:5537 { yyVAL.node = &ast.ExprBinaryIdentical{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -8073,7 +8056,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5567 + // line internal/php5/php5.y:5550 { yyVAL.node = &ast.ExprBinaryNotIdentical{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -8088,7 +8071,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5580 + // line internal/php5/php5.y:5563 { yyVAL.node = &ast.ExprBinaryEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -8103,7 +8086,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5593 + // line internal/php5/php5.y:5576 { yyVAL.node = &ast.ExprBinaryNotEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -8119,7 +8102,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5607 + // line internal/php5/php5.y:5590 { yyVAL.node = &ast.ExprBinarySmaller{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -8134,7 +8117,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5620 + // line internal/php5/php5.y:5603 { yyVAL.node = &ast.ExprBinaryGreater{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -8149,7 +8132,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5633 + // line internal/php5/php5.y:5616 { yyVAL.node = &ast.ExprBinarySmallerOrEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -8164,7 +8147,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5646 + // line internal/php5/php5.y:5629 { yyVAL.node = &ast.ExprBinaryGreaterOrEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -8179,7 +8162,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5659 + // line internal/php5/php5.y:5642 { yyVAL.node = &ast.ExprTernary{ast.Node{}, yyDollar[1].node, nil, yyDollar[4].node} @@ -8195,7 +8178,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:5673 + // line internal/php5/php5.y:5656 { yyVAL.node = &ast.ExprTernary{ast.Node{}, yyDollar[1].node, yyDollar[3].node, yyDollar[5].node} @@ -8211,7 +8194,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5687 + // line internal/php5/php5.y:5670 { yyVAL.node = &ast.ExprUnaryPlus{ast.Node{}, yyDollar[2].node} @@ -8225,7 +8208,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5699 + // line internal/php5/php5.y:5682 { yyVAL.node = &ast.ExprUnaryMinus{ast.Node{}, yyDollar[2].node} @@ -8239,7 +8222,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5711 + // line internal/php5/php5.y:5694 { yyVAL.node = yyDollar[2].node @@ -8251,7 +8234,7 @@ yydefault: } case 410: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5724 + // line internal/php5/php5.y:5707 { yyVAL.node = yyDollar[1].node @@ -8259,7 +8242,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5730 + // line internal/php5/php5.y:5713 { name := &ast.NameName{ast.Node{}, yyDollar[1].list} yyVAL.node = &ast.ExprConstFetch{ast.Node{}, name} @@ -8275,7 +8258,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5744 + // line internal/php5/php5.y:5727 { name := &ast.NameRelative{ast.Node{}, yyDollar[3].list} yyVAL.node = &ast.ExprConstFetch{ast.Node{}, name} @@ -8292,7 +8275,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5759 + // line internal/php5/php5.y:5742 { name := &ast.NameFullyQualified{ast.Node{}, yyDollar[2].list} yyVAL.node = &ast.ExprConstFetch{ast.Node{}, name} @@ -8308,7 +8291,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5776 + // line internal/php5/php5.y:5759 { name := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.ExprVariable{ast.Node{}, name} @@ -8324,7 +8307,7 @@ yydefault: } case 415: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5790 + // line internal/php5/php5.y:5773 { yyVAL.node = yyDollar[1].node @@ -8332,7 +8315,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5796 + // line internal/php5/php5.y:5779 { yyVAL.node = yyDollar[1].node @@ -8340,7 +8323,7 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5802 + // line internal/php5/php5.y:5785 { yyVAL.node = yyDollar[1].node @@ -8348,7 +8331,7 @@ yydefault: } case 418: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5808 + // line internal/php5/php5.y:5791 { yyVAL.node = &ast.ScalarEncapsed{ast.Node{}, yyDollar[2].list} @@ -8362,7 +8345,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5820 + // line internal/php5/php5.y:5803 { yyVAL.node = &ast.ScalarHeredoc{ast.Node{}, yyDollar[1].token.Value, yyDollar[2].list} @@ -8376,7 +8359,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5832 + // line internal/php5/php5.y:5815 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -8390,7 +8373,7 @@ yydefault: } case 421: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:5847 + // line internal/php5/php5.y:5830 { yyVAL.list = nil @@ -8398,7 +8381,7 @@ yydefault: } case 422: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5853 + // line internal/php5/php5.y:5836 { yyVAL.list = yyDollar[1].list @@ -8411,19 +8394,19 @@ yydefault: } case 423: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:5867 + // line internal/php5/php5.y:5850 { yyVAL.token = nil } case 424: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5871 + // line internal/php5/php5.y:5854 { yyVAL.token = yyDollar[1].token } case 425: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:5878 + // line internal/php5/php5.y:5861 { arrayItem := &ast.ExprArrayItem{ast.Node{}, false, yyDollar[3].node, yyDollar[5].node} yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8440,7 +8423,7 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5893 + // line internal/php5/php5.y:5876 { arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, yyDollar[3].node} yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8456,7 +8439,7 @@ yydefault: } case 427: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5907 + // line internal/php5/php5.y:5890 { arrayItem := &ast.ExprArrayItem{ast.Node{}, false, yyDollar[1].node, yyDollar[3].node} yyVAL.list = []ast.Vertex{arrayItem} @@ -8472,7 +8455,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5921 + // line internal/php5/php5.y:5904 { arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, yyDollar[1].node} yyVAL.list = []ast.Vertex{arrayItem} @@ -8487,7 +8470,7 @@ yydefault: } case 429: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5937 + // line internal/php5/php5.y:5920 { yyVAL.node = yyDollar[1].node @@ -8495,7 +8478,7 @@ yydefault: } case 430: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5943 + // line internal/php5/php5.y:5926 { yyVAL.node = yyDollar[1].node @@ -8503,7 +8486,7 @@ yydefault: } case 431: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5952 + // line internal/php5/php5.y:5935 { yyVAL.node = yyDollar[2].node @@ -8521,7 +8504,7 @@ yydefault: } case 432: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5968 + // line internal/php5/php5.y:5951 { yyVAL.node = yyDollar[2].node @@ -8539,7 +8522,7 @@ yydefault: } case 433: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5988 + // line internal/php5/php5.y:5971 { yyVAL.node = yyDollar[1].node @@ -8547,7 +8530,7 @@ yydefault: } case 434: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5998 + // line internal/php5/php5.y:5981 { yyVAL.node = yyDollar[1].node @@ -8555,7 +8538,7 @@ yydefault: } case 435: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6007 + // line internal/php5/php5.y:5990 { yyVAL.node = yyDollar[1].node @@ -8563,7 +8546,7 @@ yydefault: } case 436: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:6016 + // line internal/php5/php5.y:5999 { yyVAL.node = yyDollar[1].node @@ -8623,7 +8606,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6074 + // line internal/php5/php5.y:6057 { yyVAL.node = yyDollar[1].node @@ -8631,7 +8614,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:6083 + // line internal/php5/php5.y:6066 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) @@ -8639,7 +8622,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:6089 + // line internal/php5/php5.y:6072 { yyVAL.list = []ast.Vertex{} @@ -8647,7 +8630,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:6099 + // line internal/php5/php5.y:6082 { if yyDollar[3].list != nil { yyDollar[3].list[0].(*ast.ExprMethodCall).Method = yyDollar[2].list[len(yyDollar[2].list)-1].(*ast.ExprPropertyFetch).Property @@ -8663,7 +8646,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:6116 + // line internal/php5/php5.y:6099 { fetch := &ast.ExprArrayDimFetch{ast.Node{}, nil, yyDollar[3].node} yyVAL.list = append(yyDollar[1].list, fetch) @@ -8679,7 +8662,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:6130 + // line internal/php5/php5.y:6113 { fetch := &ast.ExprArrayDimFetch{ast.Node{}, nil, yyDollar[3].node} yyVAL.list = []ast.Vertex{yyDollar[1].node, fetch} @@ -8695,7 +8678,7 @@ yydefault: } case 443: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6147 + // line internal/php5/php5.y:6130 { yyVAL.node = &ast.ExprMethodCall{ast.Node{}, nil, nil, yyDollar[1].node.(*ast.ArgumentList)} @@ -8706,7 +8689,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6159 + // line internal/php5/php5.y:6142 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -8714,7 +8697,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6165 + // line internal/php5/php5.y:6148 { yyVAL.list = yyDollar[1].list @@ -8722,7 +8705,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:6171 + // line internal/php5/php5.y:6154 { yyVAL.list = nil @@ -8730,7 +8713,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6180 + // line internal/php5/php5.y:6163 { yyVAL.node = yyDollar[1].node @@ -8738,7 +8721,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:6186 + // line internal/php5/php5.y:6169 { yyDollar[1].simpleIndirectReference.last.VarName = yyDollar[2].node @@ -8752,7 +8735,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:6201 + // line internal/php5/php5.y:6184 { yyVAL.node = &ast.ExprStaticPropertyFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -8767,7 +8750,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:6214 + // line internal/php5/php5.y:6197 { yyVAL.node = &ast.ExprStaticPropertyFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -8782,7 +8765,7 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6230 + // line internal/php5/php5.y:6213 { yyVAL.node = yyDollar[1].node @@ -8790,7 +8773,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:6239 + // line internal/php5/php5.y:6222 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -8806,7 +8789,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:6253 + // line internal/php5/php5.y:6236 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -8822,7 +8805,7 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6270 + // line internal/php5/php5.y:6253 { yyVAL.node = yyDollar[1].node @@ -8830,7 +8813,7 @@ yydefault: } case 455: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6276 + // line internal/php5/php5.y:6259 { yyVAL.node = yyDollar[1].node @@ -8838,7 +8821,7 @@ yydefault: } case 456: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6282 + // line internal/php5/php5.y:6265 { yyVAL.node = yyDollar[1].node @@ -8846,7 +8829,7 @@ yydefault: } case 457: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6292 + // line internal/php5/php5.y:6275 { yyVAL.node = yyDollar[1].node @@ -8854,7 +8837,7 @@ yydefault: } case 458: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:6298 + // line internal/php5/php5.y:6281 { yyDollar[1].simpleIndirectReference.last.VarName = yyDollar[2].node @@ -8868,7 +8851,7 @@ yydefault: } case 459: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6310 + // line internal/php5/php5.y:6293 { yyVAL.node = yyDollar[1].node @@ -8876,7 +8859,7 @@ yydefault: } case 460: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:6319 + // line internal/php5/php5.y:6302 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -8892,7 +8875,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:6333 + // line internal/php5/php5.y:6316 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -8908,7 +8891,7 @@ yydefault: } case 462: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6347 + // line internal/php5/php5.y:6330 { yyVAL.node = yyDollar[1].node @@ -8916,7 +8899,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6357 + // line internal/php5/php5.y:6340 { name := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.ExprVariable{ast.Node{}, name} @@ -8932,7 +8915,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:6371 + // line internal/php5/php5.y:6354 { yyVAL.node = &ast.ExprVariable{ast.Node{}, yyDollar[3].node} @@ -8948,7 +8931,7 @@ yydefault: } case 465: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:6388 + // line internal/php5/php5.y:6371 { yyVAL.node = nil @@ -8956,7 +8939,7 @@ yydefault: } case 466: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6394 + // line internal/php5/php5.y:6377 { yyVAL.node = yyDollar[1].node @@ -8964,7 +8947,7 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6404 + // line internal/php5/php5.y:6387 { yyVAL.list = yyDollar[1].list @@ -8972,7 +8955,7 @@ yydefault: } case 468: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6410 + // line internal/php5/php5.y:6393 { fetch := &ast.ExprPropertyFetch{ast.Node{}, nil, yyDollar[1].node} yyVAL.list = []ast.Vertex{fetch} @@ -8984,7 +8967,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:6423 + // line internal/php5/php5.y:6406 { fetch := &ast.ExprArrayDimFetch{ast.Node{}, nil, yyDollar[3].node} yyVAL.list = append(yyDollar[1].list, fetch) @@ -9000,7 +8983,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:6437 + // line internal/php5/php5.y:6420 { fetch := &ast.ExprArrayDimFetch{ast.Node{}, nil, yyDollar[3].node} yyVAL.list = append(yyDollar[1].list, fetch) @@ -9016,7 +8999,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6451 + // line internal/php5/php5.y:6434 { fetch := &ast.ExprPropertyFetch{ast.Node{}, nil, yyDollar[1].node} yyVAL.list = []ast.Vertex{fetch} @@ -9028,7 +9011,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6464 + // line internal/php5/php5.y:6447 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -9042,7 +9025,7 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:6476 + // line internal/php5/php5.y:6459 { yyVAL.node = yyDollar[2].node @@ -9057,7 +9040,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6492 + // line internal/php5/php5.y:6475 { n := &ast.ExprVariable{ast.Node{}, nil} yyVAL.simpleIndirectReference = simpleIndirectReference{[]*ast.ExprVariable{n}, n} @@ -9072,7 +9055,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:6505 + // line internal/php5/php5.y:6488 { n := &ast.ExprVariable{ast.Node{}, nil} @@ -9091,7 +9074,7 @@ yydefault: } case 476: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:6525 + // line internal/php5/php5.y:6508 { if len(yyDollar[1].list) == 0 { yyDollar[1].list = []ast.Vertex{&ast.ExprArrayItem{ast.Node{}, false, nil, nil}} @@ -9106,7 +9089,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6538 + // line internal/php5/php5.y:6521 { if yyDollar[1].node.(*ast.ExprArrayItem).Key == nil && yyDollar[1].node.(*ast.ExprArrayItem).Val == nil { yyVAL.list = []ast.Vertex{} @@ -9118,7 +9101,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6552 + // line internal/php5/php5.y:6535 { yyVAL.node = &ast.ExprArrayItem{ast.Node{}, false, nil, yyDollar[1].node} @@ -9132,7 +9115,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:6564 + // line internal/php5/php5.y:6547 { listNode := &ast.ExprList{ast.Node{}, yyDollar[3].list} yyVAL.node = &ast.ExprArrayItem{ast.Node{}, false, nil, listNode} @@ -9150,7 +9133,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:6580 + // line internal/php5/php5.y:6563 { yyVAL.node = &ast.ExprArrayItem{ast.Node{}, false, nil, nil} @@ -9158,7 +9141,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:6590 + // line internal/php5/php5.y:6573 { yyVAL.list = []ast.Vertex{} @@ -9166,7 +9149,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:6596 + // line internal/php5/php5.y:6579 { yyVAL.list = yyDollar[1].list @@ -9183,7 +9166,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:6614 + // line internal/php5/php5.y:6597 { arrayItem := &ast.ExprArrayItem{ast.Node{}, false, yyDollar[3].node, yyDollar[5].node} yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -9200,7 +9183,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:6629 + // line internal/php5/php5.y:6612 { arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, yyDollar[3].node} yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -9216,7 +9199,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:6643 + // line internal/php5/php5.y:6626 { arrayItem := &ast.ExprArrayItem{ast.Node{}, false, yyDollar[1].node, yyDollar[3].node} yyVAL.list = []ast.Vertex{arrayItem} @@ -9232,7 +9215,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6657 + // line internal/php5/php5.y:6640 { arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, yyDollar[1].node} yyVAL.list = []ast.Vertex{arrayItem} @@ -9247,7 +9230,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php5/php5.y:6670 + // line internal/php5/php5.y:6653 { reference := &ast.ExprReference{ast.Node{}, yyDollar[6].node} arrayItem := &ast.ExprArrayItem{ast.Node{}, false, yyDollar[3].node, reference} @@ -9267,7 +9250,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:6688 + // line internal/php5/php5.y:6671 { reference := &ast.ExprReference{ast.Node{}, yyDollar[4].node} arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, reference} @@ -9285,7 +9268,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:6704 + // line internal/php5/php5.y:6687 { reference := &ast.ExprReference{ast.Node{}, yyDollar[4].node} arrayItem := &ast.ExprArrayItem{ast.Node{}, false, yyDollar[1].node, reference} @@ -9304,7 +9287,7 @@ yydefault: } case 490: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:6721 + // line internal/php5/php5.y:6704 { reference := &ast.ExprReference{ast.Node{}, yyDollar[2].node} arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, reference} @@ -9321,7 +9304,7 @@ yydefault: } case 491: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:6739 + // line internal/php5/php5.y:6722 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -9329,7 +9312,7 @@ yydefault: } case 492: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:6745 + // line internal/php5/php5.y:6728 { encapsed := &ast.ScalarEncapsedStringPart{ast.Node{}, yyDollar[2].token.Value} yyVAL.list = append(yyDollar[1].list, encapsed) @@ -9344,7 +9327,7 @@ yydefault: } case 493: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6758 + // line internal/php5/php5.y:6741 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -9352,7 +9335,7 @@ yydefault: } case 494: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:6764 + // line internal/php5/php5.y:6747 { encapsed := &ast.ScalarEncapsedStringPart{ast.Node{}, yyDollar[1].token.Value} yyVAL.list = []ast.Vertex{encapsed, yyDollar[2].node} @@ -9367,7 +9350,7 @@ yydefault: } case 495: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6780 + // line internal/php5/php5.y:6763 { name := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.ExprVariable{ast.Node{}, name} @@ -9383,7 +9366,7 @@ yydefault: } case 496: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:6794 + // line internal/php5/php5.y:6777 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -9402,7 +9385,7 @@ yydefault: } case 497: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:6811 + // line internal/php5/php5.y:6794 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -9423,7 +9406,7 @@ yydefault: } case 498: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:6830 + // line internal/php5/php5.y:6813 { variable := &ast.ExprVariable{ast.Node{}, yyDollar[2].node} @@ -9440,7 +9423,7 @@ yydefault: } case 499: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:6845 + // line internal/php5/php5.y:6828 { name := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} variable := &ast.ExprVariable{ast.Node{}, name} @@ -9459,7 +9442,7 @@ yydefault: } case 500: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php5/php5.y:6862 + // line internal/php5/php5.y:6845 { identifier := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -9480,7 +9463,7 @@ yydefault: } case 501: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:6881 + // line internal/php5/php5.y:6864 { yyVAL.node = yyDollar[2].node @@ -9492,7 +9475,7 @@ yydefault: } case 502: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6894 + // line internal/php5/php5.y:6877 { yyVAL.node = &ast.ScalarString{ast.Node{}, yyDollar[1].token.Value} @@ -9506,7 +9489,7 @@ yydefault: } case 503: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6906 + // line internal/php5/php5.y:6889 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(string(yyDollar[1].token.Value)); err == nil { @@ -9525,7 +9508,7 @@ yydefault: } case 504: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6923 + // line internal/php5/php5.y:6906 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.ExprVariable{ast.Node{}, identifier} @@ -9541,7 +9524,7 @@ yydefault: } case 505: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:6940 + // line internal/php5/php5.y:6923 { yyVAL.node = &ast.ExprIsset{ast.Node{}, yyDollar[3].list} @@ -9557,7 +9540,7 @@ yydefault: } case 506: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:6954 + // line internal/php5/php5.y:6937 { yyVAL.node = &ast.ExprEmpty{ast.Node{}, yyDollar[3].node} @@ -9573,7 +9556,7 @@ yydefault: } case 507: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:6968 + // line internal/php5/php5.y:6951 { yyVAL.node = &ast.ExprEmpty{ast.Node{}, yyDollar[3].node} @@ -9589,7 +9572,7 @@ yydefault: } case 508: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:6982 + // line internal/php5/php5.y:6965 { yyVAL.node = &ast.ExprInclude{ast.Node{}, yyDollar[2].node} @@ -9603,7 +9586,7 @@ yydefault: } case 509: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:6994 + // line internal/php5/php5.y:6977 { yyVAL.node = &ast.ExprIncludeOnce{ast.Node{}, yyDollar[2].node} @@ -9617,7 +9600,7 @@ yydefault: } case 510: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:7006 + // line internal/php5/php5.y:6989 { yyVAL.node = &ast.ExprEval{ast.Node{}, yyDollar[3].node} @@ -9633,7 +9616,7 @@ yydefault: } case 511: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:7020 + // line internal/php5/php5.y:7003 { yyVAL.node = &ast.ExprRequire{ast.Node{}, yyDollar[2].node} @@ -9647,7 +9630,7 @@ yydefault: } case 512: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:7032 + // line internal/php5/php5.y:7015 { yyVAL.node = &ast.ExprRequireOnce{ast.Node{}, yyDollar[2].node} @@ -9661,7 +9644,7 @@ yydefault: } case 513: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:7047 + // line internal/php5/php5.y:7030 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -9669,7 +9652,7 @@ yydefault: } case 514: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:7053 + // line internal/php5/php5.y:7036 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -9680,7 +9663,7 @@ yydefault: } case 515: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:7065 + // line internal/php5/php5.y:7048 { yyVAL.node = yyDollar[1].node @@ -9688,7 +9671,7 @@ yydefault: } case 516: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:7071 + // line internal/php5/php5.y:7054 { yyVAL.node = yyDollar[1].node @@ -9696,7 +9679,7 @@ yydefault: } case 517: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:7080 + // line internal/php5/php5.y:7063 { target := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.ExprClassConstFetch{ast.Node{}, yyDollar[1].node, target} @@ -9714,7 +9697,7 @@ yydefault: } case 518: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:7096 + // line internal/php5/php5.y:7079 { target := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.ExprClassConstFetch{ast.Node{}, yyDollar[1].node, target} @@ -9732,7 +9715,7 @@ yydefault: } case 519: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:7115 + // line internal/php5/php5.y:7098 { target := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.ExprClassConstFetch{ast.Node{}, yyDollar[1].node, target} @@ -9750,7 +9733,7 @@ yydefault: } case 520: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:7134 + // line internal/php5/php5.y:7117 { target := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.ExprClassConstFetch{ast.Node{}, yyDollar[1].node, target} diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 50aa2a5..3e87194 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.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 e54c1a7..33a3f5e 100644 --- a/internal/php7/php7.go +++ b/internal/php7/php7.go @@ -346,7 +346,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -// line internal/php7/php7.y:5626 +// line internal/php7/php7.y:5623 // line yacctab:1 var yyExca = [...]int{ @@ -2808,48 +2808,48 @@ yydefault: yyDollar = yyS[yypt-3 : yypt+1] // line internal/php7/php7.y:530 { - yyVAL.node = yyDollar[2].node + yyVAL.node = &ast.StmtUse{ast.Node{}, yyDollar[2].node} // save position yyVAL.node.GetNode().Position = position.NewTokensPosition(yyDollar[1].token, yyDollar[3].token) // save comments yylex.(*Parser).setFreeFloating(yyVAL.node, token.Start, yyDollar[1].token.Tokens) - yylex.(*Parser).setFreeFloating(yyVAL.node, token.UseDeclarationList, yyDollar[3].token.Tokens) - yylex.(*Parser).setToken(yyVAL.node, token.SemiColon, yyDollar[3].token.Tokens) + yylex.(*Parser).setFreeFloatingTokens(yyVAL.node, token.End, yyDollar[3].token.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 97: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:544 + // line internal/php7/php7.y:543 { - yyDollar[3].node.(*ast.StmtGroupUse).UseType = yyDollar[2].node - yyVAL.node = yyDollar[3].node + useType := &ast.StmtUseType{ast.Node{}, yyDollar[2].node, yyDollar[3].node} + yyVAL.node = &ast.StmtUse{ast.Node{}, useType} // save position + useType.GetNode().Position = position.NewNodesPosition(yyDollar[2].node, yyDollar[3].node) yyVAL.node.GetNode().Position = position.NewTokensPosition(yyDollar[1].token, yyDollar[4].token) // save comments yylex.(*Parser).setFreeFloating(yyVAL.node, token.Start, yyDollar[1].token.Tokens) - yylex.(*Parser).setFreeFloating(yyVAL.node, token.UseDeclarationList, yyDollar[4].token.Tokens) - yylex.(*Parser).setToken(yyVAL.node, token.SemiColon, yyDollar[4].token.Tokens) + yylex.(*Parser).setFreeFloatingTokens(yyVAL.node, token.End, yyDollar[4].token.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 98: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:559 + // line internal/php7/php7.y:558 { - yyVAL.node = &ast.StmtUseList{ast.Node{}, nil, yyDollar[2].list} + useList := &ast.StmtUseList{ast.Node{}, yyDollar[2].list} + yyVAL.node = &ast.StmtUse{ast.Node{}, useList} // save position + useList.GetNode().Position = position.NewNodeListPosition(yyDollar[2].list) yyVAL.node.GetNode().Position = position.NewTokensPosition(yyDollar[1].token, yyDollar[3].token) // save comments yylex.(*Parser).setFreeFloating(yyVAL.node, token.Start, yyDollar[1].token.Tokens) - yylex.(*Parser).setFreeFloating(yyVAL.node, token.UseDeclarationList, yyDollar[3].token.Tokens) - yylex.(*Parser).setToken(yyVAL.node, token.SemiColon, yyDollar[3].token.Tokens) + yylex.(*Parser).setFreeFloatingTokens(yyVAL.node, token.End, yyDollar[3].token.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2857,21 +2857,24 @@ yydefault: yyDollar = yyS[yypt-4 : yypt+1] // line internal/php7/php7.y:573 { - yyVAL.node = &ast.StmtUseList{ast.Node{}, yyDollar[2].node, yyDollar[3].list} + useList := &ast.StmtUseList{ast.Node{}, yyDollar[3].list} + useType := &ast.StmtUseType{ast.Node{}, yyDollar[2].node, useList} + yyVAL.node = &ast.StmtUse{ast.Node{}, useType} // save position + useList.GetNode().Position = position.NewNodeListPosition(yyDollar[3].list) + useType.GetNode().Position = position.NewNodesPosition(yyDollar[2].node, useList) yyVAL.node.GetNode().Position = position.NewTokensPosition(yyDollar[1].token, yyDollar[4].token) // save comments yylex.(*Parser).setFreeFloating(yyVAL.node, token.Start, yyDollar[1].token.Tokens) - yylex.(*Parser).setFreeFloating(yyVAL.node, token.UseDeclarationList, yyDollar[4].token.Tokens) - yylex.(*Parser).setToken(yyVAL.node, token.SemiColon, yyDollar[4].token.Tokens) + yylex.(*Parser).setFreeFloatingTokens(yyVAL.node, token.End, yyDollar[4].token.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 100: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:587 + // line internal/php7/php7.y:590 { yyVAL.node = &ast.StmtConstList{ast.Node{}, yyDollar[2].list} @@ -2887,7 +2890,7 @@ yydefault: } case 101: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:604 + // line internal/php7/php7.y:607 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -2901,7 +2904,7 @@ yydefault: } case 102: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:616 + // line internal/php7/php7.y:619 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -2915,113 +2918,113 @@ yydefault: } case 103: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php7/php7.y:631 + // line internal/php7/php7.y:634 { name := &ast.NameName{ast.Node{}, yyDollar[1].list} - yyVAL.node = &ast.StmtGroupUse{ast.Node{}, nil, name, yyDollar[4].list} + useList := &ast.StmtUseList{ast.Node{}, yyDollar[4].list} + yyVAL.node = &ast.StmtGroupUseList{ast.Node{}, name, useList} // save position name.GetNode().Position = position.NewNodeListPosition(yyDollar[1].list) + useList.GetNode().Position = position.NewNodeListPosition(yyDollar[4].list) yyVAL.node.GetNode().Position = position.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[6].token) // save comments - yylex.(*Parser).MoveFreeFloating(yyDollar[1].list[0], name) - yylex.(*Parser).setFreeFloating(name, token.End, yyDollar[2].token.Tokens) - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Slash, yyDollar[3].token.Tokens) + yylex.(*Parser).setFreeFloatingTokens(useList, token.Start, append(yyDollar[2].token.Tokens, yyDollar[3].token.Tokens...)) if yyDollar[5].token != nil { - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Stmts, append(yyDollar[5].token.Tokens, yyDollar[6].token.Tokens...)) + yylex.(*Parser).setFreeFloatingTokens(useList, token.End, append(yyDollar[5].token.Tokens, yyDollar[6].token.Tokens...)) } else { - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Stmts, yyDollar[6].token.Tokens) + yylex.(*Parser).setFreeFloating(useList, token.End, yyDollar[6].token.Tokens) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 104: yyDollar = yyS[yypt-7 : yypt+1] - // line internal/php7/php7.y:652 + // line internal/php7/php7.y:655 { name := &ast.NameName{ast.Node{}, yyDollar[2].list} - yyVAL.node = &ast.StmtGroupUse{ast.Node{}, nil, name, yyDollar[5].list} + useList := &ast.StmtUseList{ast.Node{}, yyDollar[5].list} + yyVAL.node = &ast.StmtGroupUseList{ast.Node{}, name, useList} // save position name.GetNode().Position = position.NewNodeListPosition(yyDollar[2].list) + useList.GetNode().Position = position.NewNodeListPosition(yyDollar[5].list) yyVAL.node.GetNode().Position = position.NewTokensPosition(yyDollar[1].token, yyDollar[7].token) // save comments - yylex.(*Parser).setFreeFloating(yyVAL.node, token.UseType, yyDollar[1].token.Tokens) - yylex.(*Parser).MoveFreeFloating(yyDollar[2].list[0], name) - yylex.(*Parser).setFreeFloating(name, token.End, yyDollar[3].token.Tokens) - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Slash, yyDollar[4].token.Tokens) + yylex.(*Parser).setFreeFloatingTokens(useList, token.Start, append(yyDollar[3].token.Tokens, yyDollar[4].token.Tokens...)) if yyDollar[6].token != nil { - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Stmts, append(yyDollar[6].token.Tokens, yyDollar[7].token.Tokens...)) + yylex.(*Parser).setFreeFloatingTokens(useList, token.End, append(yyDollar[6].token.Tokens, yyDollar[7].token.Tokens...)) } else { - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Stmts, yyDollar[7].token.Tokens) + yylex.(*Parser).setFreeFloating(useList, token.End, yyDollar[7].token.Tokens) } + yylex.(*Parser).setFreeFloatingTokens(yyVAL.node, token.Start, yyDollar[1].token.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 105: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php7/php7.y:677 + // line internal/php7/php7.y:680 { name := &ast.NameName{ast.Node{}, yyDollar[1].list} - yyVAL.node = &ast.StmtGroupUse{ast.Node{}, nil, name, yyDollar[4].list} + useList := &ast.StmtUseList{ast.Node{}, yyDollar[4].list} + yyVAL.node = &ast.StmtGroupUseList{ast.Node{}, name, useList} // save position name.GetNode().Position = position.NewNodeListPosition(yyDollar[1].list) + useList.GetNode().Position = position.NewNodeListPosition(yyDollar[4].list) yyVAL.node.GetNode().Position = position.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[6].token) // save comments - yylex.(*Parser).MoveFreeFloating(yyDollar[1].list[0], name) - yylex.(*Parser).setFreeFloating(name, token.End, yyDollar[2].token.Tokens) - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Slash, yyDollar[3].token.Tokens) + yylex.(*Parser).setFreeFloatingTokens(useList, token.Start, append(yyDollar[2].token.Tokens, yyDollar[3].token.Tokens...)) if yyDollar[5].token != nil { - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Stmts, append(yyDollar[5].token.Tokens, yyDollar[6].token.Tokens...)) + yylex.(*Parser).setFreeFloatingTokens(useList, token.End, append(yyDollar[5].token.Tokens, yyDollar[6].token.Tokens...)) } else { - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Stmts, yyDollar[6].token.Tokens) + yylex.(*Parser).setFreeFloatingTokens(useList, token.End, yyDollar[6].token.Tokens) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 106: yyDollar = yyS[yypt-7 : yypt+1] - // line internal/php7/php7.y:698 + // line internal/php7/php7.y:701 { name := &ast.NameName{ast.Node{}, yyDollar[2].list} - yyVAL.node = &ast.StmtGroupUse{ast.Node{}, nil, name, yyDollar[5].list} + useList := &ast.StmtUseList{ast.Node{}, yyDollar[5].list} + yyVAL.node = &ast.StmtGroupUseList{ast.Node{}, name, useList} // save position name.GetNode().Position = position.NewNodeListPosition(yyDollar[2].list) + useList.GetNode().Position = position.NewNodeListPosition(yyDollar[5].list) yyVAL.node.GetNode().Position = position.NewTokensPosition(yyDollar[1].token, yyDollar[7].token) // save comments - yylex.(*Parser).setFreeFloatingTokens(yyVAL.node, token.Use, yyDollar[1].token.Tokens) - yylex.(*Parser).MoveFreeFloating(yyDollar[2].list[0], name) - yylex.(*Parser).setFreeFloating(name, token.End, yyDollar[3].token.Tokens) - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Slash, yyDollar[4].token.Tokens) + yylex.(*Parser).setFreeFloatingTokens(useList, token.Start, append(yyDollar[3].token.Tokens, yyDollar[4].token.Tokens...)) if yyDollar[6].token != nil { - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Stmts, append(yyDollar[6].token.Tokens, yyDollar[7].token.Tokens...)) + yylex.(*Parser).setFreeFloatingTokens(useList, token.End, append(yyDollar[6].token.Tokens, yyDollar[7].token.Tokens...)) } else { - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Stmts, yyDollar[7].token.Tokens) + yylex.(*Parser).setFreeFloating(useList, token.End, yyDollar[7].token.Tokens) } + yylex.(*Parser).setFreeFloatingTokens(yyVAL.node, token.Start, yyDollar[1].token.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 107: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:723 + // line internal/php7/php7.y:726 { yyVAL.token = nil } case 108: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:727 + // line internal/php7/php7.y:730 { yyVAL.token = yyDollar[1].token } case 109: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:734 + // line internal/php7/php7.y:737 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3032,7 +3035,7 @@ yydefault: } case 110: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:743 + // line internal/php7/php7.y:746 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -3040,7 +3043,7 @@ yydefault: } case 111: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:752 + // line internal/php7/php7.y:755 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3051,7 +3054,7 @@ yydefault: } case 112: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:761 + // line internal/php7/php7.y:764 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -3059,7 +3062,7 @@ yydefault: } case 113: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:770 + // line internal/php7/php7.y:773 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3070,7 +3073,7 @@ yydefault: } case 114: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:779 + // line internal/php7/php7.y:782 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -3078,7 +3081,7 @@ yydefault: } case 115: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:788 + // line internal/php7/php7.y:791 { yyVAL.node = yyDollar[1].node @@ -3086,36 +3089,35 @@ yydefault: } case 116: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:794 + // line internal/php7/php7.y:797 { - yyDollar[2].node.(*ast.StmtUse).UseType = yyDollar[1].node - yyVAL.node = yyDollar[2].node + yyVAL.node = &ast.StmtUseType{ast.Node{}, yyDollar[1].node, yyDollar[2].node} + + // save position + yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[2].node) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 117: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:804 + // line internal/php7/php7.y:809 { name := &ast.NameName{ast.Node{}, yyDollar[1].list} - yyVAL.node = &ast.StmtUse{ast.Node{}, nil, name, nil} + yyVAL.node = &ast.StmtUseDeclaration{ast.Node{}, name, nil} // save position name.GetNode().Position = position.NewNodeListPosition(yyDollar[1].list) - yyVAL.node.GetNode().Position = position.NewNodeListPosition(yyDollar[1].list) - - // save comments - yylex.(*Parser).MoveFreeFloating(yyDollar[1].list[0], name) + yyVAL.node.GetNode().Position = position.NewNodePosition(name) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 118: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:818 + // line internal/php7/php7.y:820 { name := &ast.NameName{ast.Node{}, yyDollar[1].list} alias := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} - yyVAL.node = &ast.StmtUse{ast.Node{}, nil, name, alias} + yyVAL.node = &ast.StmtUseDeclaration{ast.Node{}, name, alias} // save position name.GetNode().Position = position.NewNodeListPosition(yyDollar[1].list) @@ -3123,7 +3125,6 @@ yydefault: yyVAL.node.GetNode().Position = position.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token) // save comments - yylex.(*Parser).MoveFreeFloating(yyDollar[1].list[0], name) yylex.(*Parser).setFreeFloating(name, token.End, yyDollar[2].token.Tokens) yylex.(*Parser).setFreeFloating(alias, token.Start, yyDollar[3].token.Tokens) @@ -3131,30 +3132,26 @@ yydefault: } case 119: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:839 + // line internal/php7/php7.y:840 { yyVAL.node = yyDollar[1].node - // save coments - yylex.(*Parser).MoveFreeFloating(yyDollar[1].node.(*ast.StmtUse).Use, yyVAL.node) - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 120: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:848 + // line internal/php7/php7.y:846 { yyVAL.node = yyDollar[2].node // save comments - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Start, yyDollar[1].token.Tokens) - yylex.(*Parser).setToken(yyVAL.node, token.Slash, yyDollar[1].token.Tokens) + yylex.(*Parser).setFreeFloatingTokens(yyVAL.node, token.Start, yyDollar[1].token.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } case 121: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:861 + // line internal/php7/php7.y:858 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3165,7 +3162,7 @@ yydefault: } case 122: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:870 + // line internal/php7/php7.y:867 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -3173,7 +3170,7 @@ yydefault: } case 123: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:879 + // line internal/php7/php7.y:876 { if inlineHtmlNode, ok := yyDollar[2].node.(*ast.StmtInlineHtml); ok && len(yyDollar[1].list) > 0 { prevNode := lastNode(yyDollar[1].list) @@ -3188,7 +3185,7 @@ yydefault: } case 124: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:892 + // line internal/php7/php7.y:889 { yyVAL.list = []ast.Vertex{} @@ -3196,7 +3193,7 @@ yydefault: } case 125: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:901 + // line internal/php7/php7.y:898 { // error yyVAL.node = nil @@ -3205,7 +3202,7 @@ yydefault: } case 126: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:908 + // line internal/php7/php7.y:905 { yyVAL.node = yyDollar[1].node @@ -3213,7 +3210,7 @@ yydefault: } case 127: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:914 + // line internal/php7/php7.y:911 { yyVAL.node = yyDollar[1].node @@ -3221,7 +3218,7 @@ yydefault: } case 128: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:920 + // line internal/php7/php7.y:917 { yyVAL.node = yyDollar[1].node @@ -3229,7 +3226,7 @@ yydefault: } case 129: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:926 + // line internal/php7/php7.y:923 { yyVAL.node = yyDollar[1].node @@ -3237,7 +3234,7 @@ yydefault: } case 130: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:932 + // line internal/php7/php7.y:929 { yyVAL.node = yyDollar[1].node @@ -3245,7 +3242,7 @@ yydefault: } case 131: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:938 + // line internal/php7/php7.y:935 { yyVAL.node = &ast.StmtHaltCompiler{ast.Node{}} @@ -3263,7 +3260,7 @@ yydefault: } case 132: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:956 + // line internal/php7/php7.y:953 { yyVAL.node = &ast.StmtStmtList{ast.Node{}, yyDollar[2].list} @@ -3278,7 +3275,7 @@ yydefault: } case 133: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:969 + // line internal/php7/php7.y:966 { yyVAL.node = yyDollar[1].node @@ -3286,7 +3283,7 @@ yydefault: } case 134: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:975 + // line internal/php7/php7.y:972 { yyVAL.node = yyDollar[1].node @@ -3294,7 +3291,7 @@ yydefault: } case 135: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php7/php7.y:981 + // line internal/php7/php7.y:978 { switch n := yyDollar[5].node.(type) { case *ast.StmtWhile: @@ -3317,7 +3314,7 @@ yydefault: } case 136: yyDollar = yyS[yypt-7 : yypt+1] - // line internal/php7/php7.y:1002 + // line internal/php7/php7.y:999 { yyVAL.node = &ast.StmtDo{ast.Node{}, yyDollar[2].node, yyDollar[5].node} @@ -3336,7 +3333,7 @@ yydefault: } case 137: yyDollar = yyS[yypt-9 : yypt+1] - // line internal/php7/php7.y:1019 + // line internal/php7/php7.y:1016 { switch n := yyDollar[9].node.(type) { case *ast.StmtFor: @@ -3365,7 +3362,7 @@ yydefault: } case 138: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php7/php7.y:1046 + // line internal/php7/php7.y:1043 { switch n := yyDollar[5].node.(type) { case *ast.StmtSwitch: @@ -3390,7 +3387,7 @@ yydefault: } case 139: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:1069 + // line internal/php7/php7.y:1066 { yyVAL.node = &ast.StmtBreak{ast.Node{}, yyDollar[2].node} @@ -3406,7 +3403,7 @@ yydefault: } case 140: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:1083 + // line internal/php7/php7.y:1080 { yyVAL.node = &ast.StmtContinue{ast.Node{}, yyDollar[2].node} @@ -3422,7 +3419,7 @@ yydefault: } case 141: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:1097 + // line internal/php7/php7.y:1094 { yyVAL.node = &ast.StmtReturn{ast.Node{}, yyDollar[2].node} @@ -3438,7 +3435,7 @@ yydefault: } case 142: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:1111 + // line internal/php7/php7.y:1108 { yyVAL.node = &ast.StmtGlobal{ast.Node{}, yyDollar[2].list} @@ -3454,7 +3451,7 @@ yydefault: } case 143: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:1125 + // line internal/php7/php7.y:1122 { yyVAL.node = &ast.StmtStatic{ast.Node{}, yyDollar[2].list} @@ -3470,7 +3467,7 @@ yydefault: } case 144: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:1139 + // line internal/php7/php7.y:1136 { yyVAL.node = &ast.StmtEcho{ast.Node{}, yyDollar[2].list} @@ -3487,7 +3484,7 @@ yydefault: } case 145: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1154 + // line internal/php7/php7.y:1151 { yyVAL.node = &ast.StmtInlineHtml{ast.Node{}, yyDollar[1].token.Value} @@ -3501,7 +3498,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:1166 + // line internal/php7/php7.y:1163 { yyVAL.node = &ast.StmtExpression{ast.Node{}, yyDollar[1].node} @@ -3517,7 +3514,7 @@ yydefault: } case 147: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php7/php7.y:1180 + // line internal/php7/php7.y:1177 { yyVAL.node = &ast.StmtUnset{ast.Node{}, yyDollar[3].list} @@ -3539,7 +3536,7 @@ yydefault: } case 148: yyDollar = yyS[yypt-7 : yypt+1] - // line internal/php7/php7.y:1200 + // line internal/php7/php7.y:1197 { switch n := yyDollar[7].node.(type) { case *ast.StmtForeach: @@ -3565,7 +3562,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-9 : yypt+1] - // line internal/php7/php7.y:1225 + // line internal/php7/php7.y:1222 { switch n := yyDollar[9].node.(type) { case *ast.StmtForeach: @@ -3594,7 +3591,7 @@ yydefault: } case 150: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php7/php7.y:1252 + // line internal/php7/php7.y:1249 { yyVAL.node = yyDollar[5].node yyVAL.node.(*ast.StmtDeclare).Consts = yyDollar[3].list @@ -3611,7 +3608,7 @@ yydefault: } case 151: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1267 + // line internal/php7/php7.y:1264 { yyVAL.node = &ast.StmtNop{ast.Node{}} @@ -3626,7 +3623,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php7/php7.y:1280 + // line internal/php7/php7.y:1277 { if yyDollar[6].node == nil { yyVAL.node = &ast.StmtTry{ast.Node{}, yyDollar[3].list, yyDollar[5].list, yyDollar[6].node} @@ -3645,7 +3642,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:1297 + // line internal/php7/php7.y:1294 { yyVAL.node = &ast.StmtThrow{ast.Node{}, yyDollar[2].node} @@ -3661,7 +3658,7 @@ yydefault: } case 154: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:1311 + // line internal/php7/php7.y:1308 { label := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} yyVAL.node = &ast.StmtGoto{ast.Node{}, label} @@ -3680,7 +3677,7 @@ yydefault: } case 155: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:1328 + // line internal/php7/php7.y:1325 { label := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.StmtLabel{ast.Node{}, label} @@ -3697,7 +3694,7 @@ yydefault: } case 156: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:1345 + // line internal/php7/php7.y:1342 { yyVAL.list = []ast.Vertex{} @@ -3705,7 +3702,7 @@ yydefault: } case 157: yyDollar = yyS[yypt-9 : yypt+1] - // line internal/php7/php7.y:1351 + // line internal/php7/php7.y:1348 { identifier := &ast.Identifier{ast.Node{}, yyDollar[5].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -3729,7 +3726,7 @@ yydefault: } case 158: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1375 + // line internal/php7/php7.y:1372 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -3737,7 +3734,7 @@ yydefault: } case 159: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:1381 + // line internal/php7/php7.y:1378 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3748,7 +3745,7 @@ yydefault: } case 160: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:1393 + // line internal/php7/php7.y:1390 { yyVAL.node = nil @@ -3756,7 +3753,7 @@ yydefault: } case 161: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:1399 + // line internal/php7/php7.y:1396 { yyVAL.node = &ast.StmtFinally{ast.Node{}, yyDollar[3].list} @@ -3772,7 +3769,7 @@ yydefault: } case 162: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1416 + // line internal/php7/php7.y:1413 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -3780,7 +3777,7 @@ yydefault: } case 163: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:1422 + // line internal/php7/php7.y:1419 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3791,7 +3788,7 @@ yydefault: } case 164: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1434 + // line internal/php7/php7.y:1431 { yyVAL.node = yyDollar[1].node @@ -3799,7 +3796,7 @@ yydefault: } case 165: yyDollar = yyS[yypt-11 : yypt+1] - // line internal/php7/php7.y:1443 + // line internal/php7/php7.y:1440 { name := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.StmtFunction{ast.Node{}, yyDollar[2].token != nil, name, yyDollar[6].list, yyDollar[8].node, yyDollar[10].list} @@ -3835,31 +3832,31 @@ yydefault: } case 166: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:1479 + // line internal/php7/php7.y:1476 { yyVAL.token = nil } case 167: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1483 + // line internal/php7/php7.y:1480 { yyVAL.token = yyDollar[1].token } case 168: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:1490 + // line internal/php7/php7.y:1487 { yyVAL.token = nil } case 169: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1494 + // line internal/php7/php7.y:1491 { yyVAL.token = yyDollar[1].token } case 170: yyDollar = yyS[yypt-9 : yypt+1] - // line internal/php7/php7.y:1501 + // line internal/php7/php7.y:1498 { name := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.StmtClass{ast.Node{}, name, yyDollar[1].list, nil, yyDollar[4].ClassExtends, yyDollar[5].ClassImplements, yyDollar[8].list} @@ -3879,7 +3876,7 @@ yydefault: } case 171: yyDollar = yyS[yypt-8 : yypt+1] - // line internal/php7/php7.y:1519 + // line internal/php7/php7.y:1516 { name := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} yyVAL.node = &ast.StmtClass{ast.Node{}, name, nil, nil, yyDollar[3].ClassExtends, yyDollar[4].ClassImplements, yyDollar[7].list} @@ -3898,7 +3895,7 @@ yydefault: } case 172: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1539 + // line internal/php7/php7.y:1536 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -3906,7 +3903,7 @@ yydefault: } case 173: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:1545 + // line internal/php7/php7.y:1542 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -3914,7 +3911,7 @@ yydefault: } case 174: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1554 + // line internal/php7/php7.y:1551 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -3928,7 +3925,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1566 + // line internal/php7/php7.y:1563 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -3942,7 +3939,7 @@ yydefault: } case 176: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php7/php7.y:1581 + // line internal/php7/php7.y:1578 { name := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} yyVAL.node = &ast.StmtTrait{ast.Node{}, name, yyDollar[5].list} @@ -3961,7 +3958,7 @@ yydefault: } case 177: yyDollar = yyS[yypt-7 : yypt+1] - // line internal/php7/php7.y:1601 + // line internal/php7/php7.y:1598 { name := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} yyVAL.node = &ast.StmtInterface{ast.Node{}, name, yyDollar[3].InterfaceExtends, yyDollar[6].list} @@ -3980,7 +3977,7 @@ yydefault: } case 178: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:1621 + // line internal/php7/php7.y:1618 { yyVAL.ClassExtends = nil @@ -3988,7 +3985,7 @@ yydefault: } case 179: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:1627 + // line internal/php7/php7.y:1624 { yyVAL.ClassExtends = &ast.StmtClassExtends{ast.Node{}, yyDollar[2].node} @@ -4002,7 +3999,7 @@ yydefault: } case 180: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:1642 + // line internal/php7/php7.y:1639 { yyVAL.InterfaceExtends = nil @@ -4010,7 +4007,7 @@ yydefault: } case 181: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:1648 + // line internal/php7/php7.y:1645 { yyVAL.InterfaceExtends = &ast.StmtInterfaceExtends{ast.Node{}, yyDollar[2].list} @@ -4024,7 +4021,7 @@ yydefault: } case 182: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:1663 + // line internal/php7/php7.y:1660 { yyVAL.ClassImplements = nil @@ -4032,7 +4029,7 @@ yydefault: } case 183: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:1669 + // line internal/php7/php7.y:1666 { yyVAL.ClassImplements = &ast.StmtClassImplements{ast.Node{}, yyDollar[2].list} @@ -4046,7 +4043,7 @@ yydefault: } case 184: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1684 + // line internal/php7/php7.y:1681 { yyVAL.node = yyDollar[1].node @@ -4054,7 +4051,7 @@ yydefault: } case 185: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:1690 + // line internal/php7/php7.y:1687 { yyVAL.node = &ast.ExprReference{ast.Node{}, yyDollar[2].node} @@ -4068,7 +4065,7 @@ yydefault: } case 186: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:1702 + // line internal/php7/php7.y:1699 { yyVAL.node = &ast.ExprList{ast.Node{}, yyDollar[3].list} @@ -4084,7 +4081,7 @@ yydefault: } case 187: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:1716 + // line internal/php7/php7.y:1713 { yyVAL.node = &ast.ExprShortList{ast.Node{}, yyDollar[2].list} @@ -4099,7 +4096,7 @@ yydefault: } case 188: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1732 + // line internal/php7/php7.y:1729 { yyVAL.node = &ast.StmtFor{ast.Node{}, nil, nil, nil, yyDollar[1].node} @@ -4110,7 +4107,7 @@ yydefault: } case 189: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:1741 + // line internal/php7/php7.y:1738 { stmtList := &ast.StmtStmtList{ast.Node{}, yyDollar[2].list} yyVAL.node = &ast.StmtAltFor{ast.Node{}, nil, nil, nil, stmtList} @@ -4129,7 +4126,7 @@ yydefault: } case 190: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1761 + // line internal/php7/php7.y:1758 { yyVAL.node = &ast.StmtForeach{ast.Node{}, nil, nil, nil, yyDollar[1].node} @@ -4140,7 +4137,7 @@ yydefault: } case 191: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:1770 + // line internal/php7/php7.y:1767 { stmtList := &ast.StmtStmtList{ast.Node{}, yyDollar[2].list} yyVAL.node = &ast.StmtAltForeach{ast.Node{}, nil, nil, nil, stmtList} @@ -4159,7 +4156,7 @@ yydefault: } case 192: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1790 + // line internal/php7/php7.y:1787 { yyVAL.node = &ast.StmtDeclare{ast.Node{}, false, nil, yyDollar[1].node} @@ -4170,7 +4167,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:1799 + // line internal/php7/php7.y:1796 { stmtList := &ast.StmtStmtList{ast.Node{}, yyDollar[2].list} yyVAL.node = &ast.StmtDeclare{ast.Node{}, true, nil, stmtList} @@ -4189,7 +4186,7 @@ yydefault: } case 194: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:1819 + // line internal/php7/php7.y:1816 { caseList := &ast.StmtCaseList{ast.Node{}, yyDollar[2].list} yyVAL.node = &ast.StmtSwitch{ast.Node{}, nil, caseList} @@ -4206,7 +4203,7 @@ yydefault: } case 195: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:1834 + // line internal/php7/php7.y:1831 { caseList := &ast.StmtCaseList{ast.Node{}, yyDollar[3].list} yyVAL.node = &ast.StmtSwitch{ast.Node{}, nil, caseList} @@ -4224,7 +4221,7 @@ yydefault: } case 196: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:1850 + // line internal/php7/php7.y:1847 { caseList := &ast.StmtCaseList{ast.Node{}, yyDollar[2].list} yyVAL.node = &ast.StmtAltSwitch{ast.Node{}, nil, caseList} @@ -4243,7 +4240,7 @@ yydefault: } case 197: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php7/php7.y:1867 + // line internal/php7/php7.y:1864 { caseList := &ast.StmtCaseList{ast.Node{}, yyDollar[3].list} @@ -4264,7 +4261,7 @@ yydefault: } case 198: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:1889 + // line internal/php7/php7.y:1886 { yyVAL.list = []ast.Vertex{} @@ -4272,7 +4269,7 @@ yydefault: } case 199: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php7/php7.y:1895 + // line internal/php7/php7.y:1892 { _case := &ast.StmtCase{ast.Node{}, yyDollar[3].node, yyDollar[5].list} yyVAL.list = append(yyDollar[1].list, _case) @@ -4289,7 +4286,7 @@ yydefault: } case 200: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:1910 + // line internal/php7/php7.y:1907 { _default := &ast.StmtDefault{ast.Node{}, yyDollar[4].list} yyVAL.list = append(yyDollar[1].list, _default) @@ -4306,19 +4303,19 @@ yydefault: } case 201: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1928 + // line internal/php7/php7.y:1925 { yyVAL.token = yyDollar[1].token } case 202: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1932 + // line internal/php7/php7.y:1929 { yyVAL.token = yyDollar[1].token } case 203: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1939 + // line internal/php7/php7.y:1936 { yyVAL.node = &ast.StmtWhile{ast.Node{}, nil, yyDollar[1].node} @@ -4329,7 +4326,7 @@ yydefault: } case 204: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:1948 + // line internal/php7/php7.y:1945 { stmtList := &ast.StmtStmtList{ast.Node{}, yyDollar[2].list} yyVAL.node = &ast.StmtAltWhile{ast.Node{}, nil, stmtList} @@ -4348,7 +4345,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php7/php7.y:1968 + // line internal/php7/php7.y:1965 { yyVAL.node = &ast.StmtIf{ast.Node{}, yyDollar[3].node, yyDollar[5].node, nil, nil} @@ -4364,7 +4361,7 @@ yydefault: } case 206: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php7/php7.y:1982 + // line internal/php7/php7.y:1979 { _elseIf := &ast.StmtElseIf{ast.Node{}, yyDollar[4].node, yyDollar[6].node} yyDollar[1].node.(*ast.StmtIf).ElseIf = append(yyDollar[1].node.(*ast.StmtIf).ElseIf, _elseIf) @@ -4384,7 +4381,7 @@ yydefault: } case 207: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2003 + // line internal/php7/php7.y:2000 { yyVAL.node = yyDollar[1].node @@ -4392,7 +4389,7 @@ yydefault: } case 208: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2009 + // line internal/php7/php7.y:2006 { _else := &ast.StmtElse{ast.Node{}, yyDollar[3].node} yyDollar[1].node.(*ast.StmtIf).Else = _else @@ -4410,7 +4407,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php7/php7.y:2028 + // line internal/php7/php7.y:2025 { stmts := &ast.StmtStmtList{ast.Node{}, yyDollar[6].list} yyVAL.node = &ast.StmtAltIf{ast.Node{}, yyDollar[3].node, stmts, nil, nil} @@ -4429,7 +4426,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-7 : yypt+1] - // line internal/php7/php7.y:2045 + // line internal/php7/php7.y:2042 { stmts := &ast.StmtStmtList{ast.Node{}, yyDollar[7].list} _elseIf := &ast.StmtAltElseIf{ast.Node{}, yyDollar[4].node, stmts} @@ -4451,7 +4448,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2068 + // line internal/php7/php7.y:2065 { yyVAL.node = yyDollar[1].node @@ -4467,7 +4464,7 @@ yydefault: } case 212: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php7/php7.y:2082 + // line internal/php7/php7.y:2079 { stmts := &ast.StmtStmtList{ast.Node{}, yyDollar[4].list} _else := &ast.StmtAltElse{ast.Node{}, stmts} @@ -4491,7 +4488,7 @@ yydefault: } case 213: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2107 + // line internal/php7/php7.y:2104 { yyVAL.list = yyDollar[1].list @@ -4499,7 +4496,7 @@ yydefault: } case 214: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:2113 + // line internal/php7/php7.y:2110 { yyVAL.list = nil @@ -4507,7 +4504,7 @@ yydefault: } case 215: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2122 + // line internal/php7/php7.y:2119 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -4515,7 +4512,7 @@ yydefault: } case 216: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2128 + // line internal/php7/php7.y:2125 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4526,7 +4523,7 @@ yydefault: } case 217: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:2140 + // line internal/php7/php7.y:2137 { identifier := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} identifier.GetNode().Position = position.NewTokenPosition(yyDollar[4].token) @@ -4564,7 +4561,7 @@ yydefault: } case 218: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php7/php7.y:2176 + // line internal/php7/php7.y:2173 { identifier := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} identifier.GetNode().Position = position.NewTokenPosition(yyDollar[4].token) @@ -4603,7 +4600,7 @@ yydefault: } case 219: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:2216 + // line internal/php7/php7.y:2213 { yyVAL.node = nil @@ -4611,7 +4608,7 @@ yydefault: } case 220: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2222 + // line internal/php7/php7.y:2219 { yyVAL.node = yyDollar[1].node @@ -4619,7 +4616,7 @@ yydefault: } case 221: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2231 + // line internal/php7/php7.y:2228 { yyVAL.node = yyDollar[1].node @@ -4627,7 +4624,7 @@ yydefault: } case 222: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:2237 + // line internal/php7/php7.y:2234 { yyVAL.node = &ast.Nullable{ast.Node{}, yyDollar[2].node} @@ -4641,7 +4638,7 @@ yydefault: } case 223: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2252 + // line internal/php7/php7.y:2249 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -4655,7 +4652,7 @@ yydefault: } case 224: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2264 + // line internal/php7/php7.y:2261 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -4669,7 +4666,7 @@ yydefault: } case 225: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2276 + // line internal/php7/php7.y:2273 { yyVAL.node = yyDollar[1].node @@ -4677,7 +4674,7 @@ yydefault: } case 226: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:2285 + // line internal/php7/php7.y:2282 { yyVAL.node = nil @@ -4685,7 +4682,7 @@ yydefault: } case 227: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:2291 + // line internal/php7/php7.y:2288 { yyVAL.node = yyDollar[2].node @@ -4696,7 +4693,7 @@ yydefault: } case 228: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:2303 + // line internal/php7/php7.y:2300 { yyVAL.node = &ast.ArgumentList{ast.Node{}, nil} @@ -4711,7 +4708,7 @@ yydefault: } case 229: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:2316 + // line internal/php7/php7.y:2313 { yyVAL.node = &ast.ArgumentList{ast.Node{}, yyDollar[2].list} @@ -4730,7 +4727,7 @@ yydefault: } case 230: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2336 + // line internal/php7/php7.y:2333 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -4738,7 +4735,7 @@ yydefault: } case 231: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2342 + // line internal/php7/php7.y:2339 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4749,7 +4746,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2354 + // line internal/php7/php7.y:2351 { yyVAL.node = &ast.Argument{ast.Node{}, false, false, yyDollar[1].node} @@ -4763,7 +4760,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:2366 + // line internal/php7/php7.y:2363 { yyVAL.node = &ast.Argument{ast.Node{}, true, false, yyDollar[2].node} @@ -4777,7 +4774,7 @@ yydefault: } case 234: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2381 + // line internal/php7/php7.y:2378 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4788,7 +4785,7 @@ yydefault: } case 235: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2390 + // line internal/php7/php7.y:2387 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -4796,7 +4793,7 @@ yydefault: } case 236: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2399 + // line internal/php7/php7.y:2396 { yyVAL.node = yyDollar[1].node @@ -4804,7 +4801,7 @@ yydefault: } case 237: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2408 + // line internal/php7/php7.y:2405 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4815,7 +4812,7 @@ yydefault: } case 238: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2417 + // line internal/php7/php7.y:2414 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -4823,7 +4820,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2426 + // line internal/php7/php7.y:2423 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -4841,7 +4838,7 @@ yydefault: } case 240: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2442 + // line internal/php7/php7.y:2439 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -4860,7 +4857,7 @@ yydefault: } case 241: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:2462 + // line internal/php7/php7.y:2459 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -4868,7 +4865,7 @@ yydefault: } case 242: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:2468 + // line internal/php7/php7.y:2465 { yyVAL.list = []ast.Vertex{} @@ -4876,7 +4873,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:2477 + // line internal/php7/php7.y:2474 { yyVAL.node = &ast.StmtPropertyList{ast.Node{}, yyDollar[1].list, yyDollar[2].node, yyDollar[3].list} @@ -4892,7 +4889,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:2491 + // line internal/php7/php7.y:2488 { yyVAL.node = &ast.StmtClassConstList{ast.Node{}, yyDollar[1].list, yyDollar[3].list} @@ -4913,7 +4910,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2510 + // line internal/php7/php7.y:2507 { yyVAL.node = &ast.StmtTraitUse{ast.Node{}, yyDollar[2].list, yyDollar[3].node} @@ -4927,7 +4924,7 @@ yydefault: } case 246: yyDollar = yyS[yypt-10 : yypt+1] - // line internal/php7/php7.y:2522 + // line internal/php7/php7.y:2519 { name := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} yyVAL.node = &ast.StmtClassMethod{ast.Node{}, yyDollar[3].token != nil, name, yyDollar[1].list, yyDollar[7].list, yyDollar[9].node, yyDollar[10].node} @@ -4964,7 +4961,7 @@ yydefault: } case 247: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2559 + // line internal/php7/php7.y:2556 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -4972,7 +4969,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2565 + // line internal/php7/php7.y:2562 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4983,7 +4980,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2577 + // line internal/php7/php7.y:2574 { yyVAL.node = &ast.StmtNop{ast.Node{}} @@ -4997,7 +4994,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:2590 + // line internal/php7/php7.y:2587 { yyVAL.node = &ast.StmtTraitAdaptationList{ast.Node{}, nil} @@ -5011,7 +5008,7 @@ yydefault: } case 251: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2602 + // line internal/php7/php7.y:2599 { yyVAL.node = &ast.StmtTraitAdaptationList{ast.Node{}, yyDollar[2].list} @@ -5025,7 +5022,7 @@ yydefault: } case 252: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2617 + // line internal/php7/php7.y:2614 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -5033,7 +5030,7 @@ yydefault: } case 253: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:2623 + // line internal/php7/php7.y:2620 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -5041,7 +5038,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:2632 + // line internal/php7/php7.y:2629 { yyVAL.node = yyDollar[1].node @@ -5053,7 +5050,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:2642 + // line internal/php7/php7.y:2639 { yyVAL.node = yyDollar[1].node @@ -5065,7 +5062,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2655 + // line internal/php7/php7.y:2652 { yyVAL.node = &ast.StmtTraitUsePrecedence{ast.Node{}, yyDollar[1].node, yyDollar[3].list} @@ -5080,7 +5077,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2671 + // line internal/php7/php7.y:2668 { alias := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.StmtTraitUseAlias{ast.Node{}, yyDollar[1].node, nil, alias} @@ -5098,7 +5095,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2687 + // line internal/php7/php7.y:2684 { alias := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.StmtTraitUseAlias{ast.Node{}, yyDollar[1].node, nil, alias} @@ -5116,7 +5113,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:2703 + // line internal/php7/php7.y:2700 { alias := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} yyVAL.node = &ast.StmtTraitUseAlias{ast.Node{}, yyDollar[1].node, yyDollar[3].node, alias} @@ -5134,7 +5131,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2719 + // line internal/php7/php7.y:2716 { yyVAL.node = &ast.StmtTraitUseAlias{ast.Node{}, yyDollar[1].node, yyDollar[3].node, nil} @@ -5149,7 +5146,7 @@ yydefault: } case 261: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2735 + // line internal/php7/php7.y:2732 { name := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.StmtTraitMethodRef{ast.Node{}, nil, name} @@ -5165,7 +5162,7 @@ yydefault: } case 262: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2749 + // line internal/php7/php7.y:2746 { yyVAL.node = yyDollar[1].node @@ -5173,7 +5170,7 @@ yydefault: } case 263: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2758 + // line internal/php7/php7.y:2755 { target := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.StmtTraitMethodRef{ast.Node{}, yyDollar[1].node, target} @@ -5191,7 +5188,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2777 + // line internal/php7/php7.y:2774 { yyVAL.node = &ast.StmtNop{ast.Node{}} @@ -5206,7 +5203,7 @@ yydefault: } case 265: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2790 + // line internal/php7/php7.y:2787 { yyVAL.node = &ast.StmtStmtList{ast.Node{}, yyDollar[2].list} @@ -5221,7 +5218,7 @@ yydefault: } case 266: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2806 + // line internal/php7/php7.y:2803 { yyVAL.list = yyDollar[1].list @@ -5229,7 +5226,7 @@ yydefault: } case 267: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2812 + // line internal/php7/php7.y:2809 { modifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.list = []ast.Vertex{modifier} @@ -5244,7 +5241,7 @@ yydefault: } case 268: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:2828 + // line internal/php7/php7.y:2825 { yyVAL.list = nil @@ -5252,7 +5249,7 @@ yydefault: } case 269: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2834 + // line internal/php7/php7.y:2831 { yyVAL.list = yyDollar[1].list @@ -5260,7 +5257,7 @@ yydefault: } case 270: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2843 + // line internal/php7/php7.y:2840 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -5268,7 +5265,7 @@ yydefault: } case 271: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:2849 + // line internal/php7/php7.y:2846 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -5276,7 +5273,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2858 + // line internal/php7/php7.y:2855 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -5290,7 +5287,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2870 + // line internal/php7/php7.y:2867 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -5304,7 +5301,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2882 + // line internal/php7/php7.y:2879 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -5318,7 +5315,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2894 + // line internal/php7/php7.y:2891 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -5332,7 +5329,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2906 + // line internal/php7/php7.y:2903 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -5346,7 +5343,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2918 + // line internal/php7/php7.y:2915 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -5360,7 +5357,7 @@ yydefault: } case 278: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2933 + // line internal/php7/php7.y:2930 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5371,7 +5368,7 @@ yydefault: } case 279: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2942 + // line internal/php7/php7.y:2939 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -5379,7 +5376,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:2951 + // line internal/php7/php7.y:2948 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -5397,7 +5394,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:2967 + // line internal/php7/php7.y:2964 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -5416,7 +5413,7 @@ yydefault: } case 282: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2987 + // line internal/php7/php7.y:2984 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5427,7 +5424,7 @@ yydefault: } case 283: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2996 + // line internal/php7/php7.y:2993 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -5435,7 +5432,7 @@ yydefault: } case 284: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:3005 + // line internal/php7/php7.y:3002 { name := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.StmtConstant{ast.Node{}, name, yyDollar[3].node} @@ -5452,7 +5449,7 @@ yydefault: } case 285: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:3023 + // line internal/php7/php7.y:3020 { name := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.StmtConstant{ast.Node{}, name, yyDollar[3].node} @@ -5469,7 +5466,7 @@ yydefault: } case 286: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3041 + // line internal/php7/php7.y:3038 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5480,7 +5477,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:3050 + // line internal/php7/php7.y:3047 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -5488,7 +5485,7 @@ yydefault: } case 288: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:3059 + // line internal/php7/php7.y:3056 { yyVAL.node = yyDollar[1].node @@ -5496,7 +5493,7 @@ yydefault: } case 289: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:3068 + // line internal/php7/php7.y:3065 { yyVAL.list = nil @@ -5504,7 +5501,7 @@ yydefault: } case 290: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:3074 + // line internal/php7/php7.y:3071 { yyVAL.list = yyDollar[1].list @@ -5512,7 +5509,7 @@ yydefault: } case 291: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3083 + // line internal/php7/php7.y:3080 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5523,7 +5520,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:3092 + // line internal/php7/php7.y:3089 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -5531,7 +5528,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-8 : yypt+1] - // line internal/php7/php7.y:3101 + // line internal/php7/php7.y:3098 { if yyDollar[2].node != nil { yyVAL.node = &ast.StmtClass{ast.Node{}, nil, nil, yyDollar[2].node.(*ast.ArgumentList), yyDollar[3].ClassExtends, yyDollar[4].ClassImplements, yyDollar[7].list} @@ -5551,7 +5548,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3122 + // line internal/php7/php7.y:3119 { if yyDollar[3].node != nil { yyVAL.node = &ast.ExprNew{ast.Node{}, yyDollar[2].node, yyDollar[3].node.(*ast.ArgumentList)} @@ -5568,7 +5565,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3137 + // line internal/php7/php7.y:3134 { yyVAL.node = &ast.ExprNew{ast.Node{}, yyDollar[2].node, nil} @@ -5582,7 +5579,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php7/php7.y:3152 + // line internal/php7/php7.y:3149 { listNode := &ast.ExprList{ast.Node{}, yyDollar[3].list} yyVAL.node = &ast.ExprAssign{ast.Node{}, listNode, yyDollar[6].node} @@ -5601,7 +5598,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php7/php7.y:3169 + // line internal/php7/php7.y:3166 { shortList := &ast.ExprShortList{ast.Node{}, yyDollar[2].list} yyVAL.node = &ast.ExprAssign{ast.Node{}, shortList, yyDollar[5].node} @@ -5619,7 +5616,7 @@ yydefault: } case 298: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3185 + // line internal/php7/php7.y:3182 { yyVAL.node = &ast.ExprAssign{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5634,7 +5631,7 @@ yydefault: } case 299: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:3198 + // line internal/php7/php7.y:3195 { yyVAL.node = &ast.ExprAssignReference{ast.Node{}, yyDollar[1].node, yyDollar[4].node} @@ -5650,7 +5647,7 @@ yydefault: } case 300: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3212 + // line internal/php7/php7.y:3209 { yyVAL.node = &ast.ExprClone{ast.Node{}, yyDollar[2].node} @@ -5664,7 +5661,7 @@ yydefault: } case 301: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3224 + // line internal/php7/php7.y:3221 { yyVAL.node = &ast.ExprAssignPlus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5679,7 +5676,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3237 + // line internal/php7/php7.y:3234 { yyVAL.node = &ast.ExprAssignMinus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5694,7 +5691,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3250 + // line internal/php7/php7.y:3247 { yyVAL.node = &ast.ExprAssignMul{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5709,7 +5706,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3263 + // line internal/php7/php7.y:3260 { yyVAL.node = &ast.ExprAssignPow{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5724,7 +5721,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3276 + // line internal/php7/php7.y:3273 { yyVAL.node = &ast.ExprAssignDiv{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5739,7 +5736,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3289 + // line internal/php7/php7.y:3286 { yyVAL.node = &ast.ExprAssignConcat{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5754,7 +5751,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3302 + // line internal/php7/php7.y:3299 { yyVAL.node = &ast.ExprAssignMod{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5769,7 +5766,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3315 + // line internal/php7/php7.y:3312 { yyVAL.node = &ast.ExprAssignBitwiseAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5784,7 +5781,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3328 + // line internal/php7/php7.y:3325 { yyVAL.node = &ast.ExprAssignBitwiseOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5799,7 +5796,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3341 + // line internal/php7/php7.y:3338 { yyVAL.node = &ast.ExprAssignBitwiseXor{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5814,7 +5811,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3354 + // line internal/php7/php7.y:3351 { yyVAL.node = &ast.ExprAssignShiftLeft{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5829,7 +5826,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3367 + // line internal/php7/php7.y:3364 { yyVAL.node = &ast.ExprAssignShiftRight{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5844,7 +5841,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3380 + // line internal/php7/php7.y:3377 { yyVAL.node = &ast.ExprAssignCoalesce{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5859,7 +5856,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3393 + // line internal/php7/php7.y:3390 { yyVAL.node = &ast.ExprPostInc{ast.Node{}, yyDollar[1].node} @@ -5874,7 +5871,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3406 + // line internal/php7/php7.y:3403 { yyVAL.node = &ast.ExprPreInc{ast.Node{}, yyDollar[2].node} @@ -5888,7 +5885,7 @@ yydefault: } case 316: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3418 + // line internal/php7/php7.y:3415 { yyVAL.node = &ast.ExprPostDec{ast.Node{}, yyDollar[1].node} @@ -5903,7 +5900,7 @@ yydefault: } case 317: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3431 + // line internal/php7/php7.y:3428 { yyVAL.node = &ast.ExprPreDec{ast.Node{}, yyDollar[2].node} @@ -5917,7 +5914,7 @@ yydefault: } case 318: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3443 + // line internal/php7/php7.y:3440 { yyVAL.node = &ast.ExprBinaryBooleanOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5932,7 +5929,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3456 + // line internal/php7/php7.y:3453 { yyVAL.node = &ast.ExprBinaryBooleanAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5947,7 +5944,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3469 + // line internal/php7/php7.y:3466 { yyVAL.node = &ast.ExprBinaryLogicalOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5962,7 +5959,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3482 + // line internal/php7/php7.y:3479 { yyVAL.node = &ast.ExprBinaryLogicalAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5977,7 +5974,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3495 + // line internal/php7/php7.y:3492 { yyVAL.node = &ast.ExprBinaryLogicalXor{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5992,7 +5989,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3508 + // line internal/php7/php7.y:3505 { yyVAL.node = &ast.ExprBinaryBitwiseOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6007,7 +6004,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3521 + // line internal/php7/php7.y:3518 { yyVAL.node = &ast.ExprBinaryBitwiseAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6022,7 +6019,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3534 + // line internal/php7/php7.y:3531 { yyVAL.node = &ast.ExprBinaryBitwiseXor{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6037,7 +6034,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3547 + // line internal/php7/php7.y:3544 { yyVAL.node = &ast.ExprBinaryConcat{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6052,7 +6049,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3560 + // line internal/php7/php7.y:3557 { yyVAL.node = &ast.ExprBinaryPlus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6067,7 +6064,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3573 + // line internal/php7/php7.y:3570 { yyVAL.node = &ast.ExprBinaryMinus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6082,7 +6079,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3586 + // line internal/php7/php7.y:3583 { yyVAL.node = &ast.ExprBinaryMul{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6097,7 +6094,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3599 + // line internal/php7/php7.y:3596 { yyVAL.node = &ast.ExprBinaryPow{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6112,7 +6109,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3612 + // line internal/php7/php7.y:3609 { yyVAL.node = &ast.ExprBinaryDiv{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6127,7 +6124,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3625 + // line internal/php7/php7.y:3622 { yyVAL.node = &ast.ExprBinaryMod{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6142,7 +6139,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3638 + // line internal/php7/php7.y:3635 { yyVAL.node = &ast.ExprBinaryShiftLeft{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6157,7 +6154,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3651 + // line internal/php7/php7.y:3648 { yyVAL.node = &ast.ExprBinaryShiftRight{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6172,7 +6169,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3664 + // line internal/php7/php7.y:3661 { yyVAL.node = &ast.ExprUnaryPlus{ast.Node{}, yyDollar[2].node} @@ -6186,7 +6183,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3676 + // line internal/php7/php7.y:3673 { yyVAL.node = &ast.ExprUnaryMinus{ast.Node{}, yyDollar[2].node} @@ -6200,7 +6197,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3688 + // line internal/php7/php7.y:3685 { yyVAL.node = &ast.ExprBooleanNot{ast.Node{}, yyDollar[2].node} @@ -6214,7 +6211,7 @@ yydefault: } case 338: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3700 + // line internal/php7/php7.y:3697 { yyVAL.node = &ast.ExprBitwiseNot{ast.Node{}, yyDollar[2].node} @@ -6228,7 +6225,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3712 + // line internal/php7/php7.y:3709 { yyVAL.node = &ast.ExprBinaryIdentical{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6243,7 +6240,7 @@ yydefault: } case 340: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3725 + // line internal/php7/php7.y:3722 { yyVAL.node = &ast.ExprBinaryNotIdentical{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6258,7 +6255,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3738 + // line internal/php7/php7.y:3735 { yyVAL.node = &ast.ExprBinaryEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6273,7 +6270,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3751 + // line internal/php7/php7.y:3748 { yyVAL.node = &ast.ExprBinaryNotEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6289,7 +6286,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3765 + // line internal/php7/php7.y:3762 { yyVAL.node = &ast.ExprBinarySmaller{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6304,7 +6301,7 @@ yydefault: } case 344: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3778 + // line internal/php7/php7.y:3775 { yyVAL.node = &ast.ExprBinarySmallerOrEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6319,7 +6316,7 @@ yydefault: } case 345: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3791 + // line internal/php7/php7.y:3788 { yyVAL.node = &ast.ExprBinaryGreater{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6334,7 +6331,7 @@ yydefault: } case 346: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3804 + // line internal/php7/php7.y:3801 { yyVAL.node = &ast.ExprBinaryGreaterOrEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6349,7 +6346,7 @@ yydefault: } case 347: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3817 + // line internal/php7/php7.y:3814 { yyVAL.node = &ast.ExprBinarySpaceship{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6364,7 +6361,7 @@ yydefault: } case 348: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3830 + // line internal/php7/php7.y:3827 { yyVAL.node = &ast.ExprInstanceOf{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6379,7 +6376,7 @@ yydefault: } case 349: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3843 + // line internal/php7/php7.y:3840 { yyVAL.node = yyDollar[2].node @@ -6391,7 +6388,7 @@ yydefault: } case 350: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:3853 + // line internal/php7/php7.y:3850 { yyVAL.node = yyDollar[1].node @@ -6399,7 +6396,7 @@ yydefault: } case 351: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php7/php7.y:3859 + // line internal/php7/php7.y:3856 { yyVAL.node = &ast.ExprTernary{ast.Node{}, yyDollar[1].node, yyDollar[3].node, yyDollar[5].node} @@ -6415,7 +6412,7 @@ yydefault: } case 352: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:3873 + // line internal/php7/php7.y:3870 { yyVAL.node = &ast.ExprTernary{ast.Node{}, yyDollar[1].node, nil, yyDollar[4].node} @@ -6431,7 +6428,7 @@ yydefault: } case 353: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3887 + // line internal/php7/php7.y:3884 { yyVAL.node = &ast.ExprBinaryCoalesce{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6446,7 +6443,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:3900 + // line internal/php7/php7.y:3897 { yyVAL.node = yyDollar[1].node @@ -6454,7 +6451,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3906 + // line internal/php7/php7.y:3903 { yyVAL.node = &ast.ExprCastInt{ast.Node{}, yyDollar[2].node} @@ -6469,7 +6466,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3919 + // line internal/php7/php7.y:3916 { yyVAL.node = &ast.ExprCastDouble{ast.Node{}, yyDollar[2].node} @@ -6484,7 +6481,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3932 + // line internal/php7/php7.y:3929 { yyVAL.node = &ast.ExprCastString{ast.Node{}, yyDollar[2].node} @@ -6499,7 +6496,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3945 + // line internal/php7/php7.y:3942 { yyVAL.node = &ast.ExprCastArray{ast.Node{}, yyDollar[2].node} @@ -6514,7 +6511,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3958 + // line internal/php7/php7.y:3955 { yyVAL.node = &ast.ExprCastObject{ast.Node{}, yyDollar[2].node} @@ -6529,7 +6526,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3971 + // line internal/php7/php7.y:3968 { yyVAL.node = &ast.ExprCastBool{ast.Node{}, yyDollar[2].node} @@ -6544,7 +6541,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3984 + // line internal/php7/php7.y:3981 { yyVAL.node = &ast.ExprCastUnset{ast.Node{}, yyDollar[2].node} @@ -6559,7 +6556,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3997 + // line internal/php7/php7.y:3994 { var e *ast.ExprExit if yyDollar[2].node != nil { @@ -6588,7 +6585,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:4024 + // line internal/php7/php7.y:4021 { yyVAL.node = &ast.ExprErrorSuppress{ast.Node{}, yyDollar[2].node} @@ -6602,7 +6599,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4036 + // line internal/php7/php7.y:4033 { yyVAL.node = yyDollar[1].node @@ -6610,7 +6607,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4042 + // line internal/php7/php7.y:4039 { yyVAL.node = &ast.ExprShellExec{ast.Node{}, yyDollar[2].list} @@ -6624,7 +6621,7 @@ yydefault: } case 366: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:4054 + // line internal/php7/php7.y:4051 { yyVAL.node = &ast.ExprPrint{ast.Node{}, yyDollar[2].node} @@ -6638,7 +6635,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4066 + // line internal/php7/php7.y:4063 { yyVAL.node = &ast.ExprYield{ast.Node{}, nil, nil} @@ -6652,7 +6649,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:4078 + // line internal/php7/php7.y:4075 { yyVAL.node = &ast.ExprYield{ast.Node{}, nil, yyDollar[2].node} @@ -6666,7 +6663,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:4090 + // line internal/php7/php7.y:4087 { yyVAL.node = &ast.ExprYield{ast.Node{}, yyDollar[2].node, yyDollar[4].node} @@ -6681,7 +6678,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:4103 + // line internal/php7/php7.y:4100 { yyVAL.node = &ast.ExprYieldFrom{ast.Node{}, yyDollar[2].node} @@ -6695,7 +6692,7 @@ yydefault: } case 371: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4115 + // line internal/php7/php7.y:4112 { yyVAL.node = yyDollar[1].node @@ -6703,7 +6700,7 @@ yydefault: } case 372: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:4121 + // line internal/php7/php7.y:4118 { yyVAL.node = yyDollar[2].node @@ -6726,7 +6723,7 @@ yydefault: } case 373: yyDollar = yyS[yypt-11 : yypt+1] - // line internal/php7/php7.y:4144 + // line internal/php7/php7.y:4141 { yyVAL.node = &ast.ExprClosure{ast.Node{}, yyDollar[2].token != nil, false, yyDollar[5].list, yyDollar[7].ClosureUse, yyDollar[8].node, yyDollar[10].list} @@ -6763,7 +6760,7 @@ yydefault: } case 374: yyDollar = yyS[yypt-9 : yypt+1] - // line internal/php7/php7.y:4176 + // line internal/php7/php7.y:4173 { yyVAL.node = &ast.ExprArrowFunction{ast.Node{}, yyDollar[2].token != nil, false, yyDollar[4].list, yyDollar[6].node, yyDollar[9].node} @@ -6795,19 +6792,19 @@ yydefault: } case 376: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:4211 + // line internal/php7/php7.y:4208 { yyVAL.token = nil } case 377: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4215 + // line internal/php7/php7.y:4212 { yyVAL.token = yyDollar[1].token } case 378: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:4222 + // line internal/php7/php7.y:4219 { yyVAL.ClosureUse = nil @@ -6815,7 +6812,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:4228 + // line internal/php7/php7.y:4225 { yyVAL.ClosureUse = &ast.ExprClosureUse{ast.Node{}, yyDollar[3].list} @@ -6831,7 +6828,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4245 + // line internal/php7/php7.y:4242 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -6842,7 +6839,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4254 + // line internal/php7/php7.y:4251 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -6850,7 +6847,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4263 + // line internal/php7/php7.y:4260 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.ExprVariable{ast.Node{}, identifier} @@ -6866,7 +6863,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:4277 + // line internal/php7/php7.y:4274 { identifier := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -6885,7 +6882,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:4297 + // line internal/php7/php7.y:4294 { yyVAL.node = &ast.ExprFunctionCall{ast.Node{}, yyDollar[1].node, yyDollar[2].node.(*ast.ArgumentList)} @@ -6899,7 +6896,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:4309 + // line internal/php7/php7.y:4306 { yyVAL.node = &ast.ExprStaticCall{ast.Node{}, yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*ast.ArgumentList)} @@ -6914,7 +6911,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:4322 + // line internal/php7/php7.y:4319 { yyVAL.node = &ast.ExprStaticCall{ast.Node{}, yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*ast.ArgumentList)} @@ -6929,7 +6926,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:4335 + // line internal/php7/php7.y:4332 { yyVAL.node = &ast.ExprFunctionCall{ast.Node{}, yyDollar[1].node, yyDollar[2].node.(*ast.ArgumentList)} @@ -6943,7 +6940,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4350 + // line internal/php7/php7.y:4347 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -6957,7 +6954,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4362 + // line internal/php7/php7.y:4359 { yyVAL.node = yyDollar[1].node @@ -6965,7 +6962,7 @@ yydefault: } case 390: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4371 + // line internal/php7/php7.y:4368 { yyVAL.node = yyDollar[1].node @@ -6973,7 +6970,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4377 + // line internal/php7/php7.y:4374 { yyVAL.node = yyDollar[1].node @@ -6981,7 +6978,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:4386 + // line internal/php7/php7.y:4383 { yyVAL.node = nil @@ -6989,7 +6986,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4392 + // line internal/php7/php7.y:4389 { yyVAL.node = &ast.ExprExit{ast.Node{}, false, yyDollar[2].node} @@ -7004,7 +7001,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:4408 + // line internal/php7/php7.y:4405 { yyVAL.list = []ast.Vertex{} @@ -7012,7 +7009,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4414 + // line internal/php7/php7.y:4411 { part := &ast.ScalarEncapsedStringPart{ast.Node{}, yyDollar[1].token.Value} yyVAL.list = []ast.Vertex{part} @@ -7024,7 +7021,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4424 + // line internal/php7/php7.y:4421 { yyVAL.list = yyDollar[1].list @@ -7032,7 +7029,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:4433 + // line internal/php7/php7.y:4430 { yyVAL.node = nil @@ -7040,7 +7037,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4439 + // line internal/php7/php7.y:4436 { yyVAL.node = yyDollar[1].node @@ -7048,7 +7045,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:4448 + // line internal/php7/php7.y:4445 { yyVAL.node = &ast.ExprArray{ast.Node{}, yyDollar[3].list} @@ -7064,7 +7061,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4462 + // line internal/php7/php7.y:4459 { yyVAL.node = &ast.ExprShortArray{ast.Node{}, yyDollar[2].list} @@ -7079,7 +7076,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4475 + // line internal/php7/php7.y:4472 { yyVAL.node = &ast.ScalarString{ast.Node{}, yyDollar[1].token.Value} @@ -7093,7 +7090,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4490 + // line internal/php7/php7.y:4487 { yyVAL.node = &ast.ScalarLnumber{ast.Node{}, yyDollar[1].token.Value} @@ -7107,7 +7104,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4502 + // line internal/php7/php7.y:4499 { yyVAL.node = &ast.ScalarDnumber{ast.Node{}, yyDollar[1].token.Value} @@ -7121,7 +7118,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4514 + // line internal/php7/php7.y:4511 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -7135,7 +7132,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4526 + // line internal/php7/php7.y:4523 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -7149,7 +7146,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4538 + // line internal/php7/php7.y:4535 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -7163,7 +7160,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4550 + // line internal/php7/php7.y:4547 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -7177,7 +7174,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4562 + // line internal/php7/php7.y:4559 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -7191,7 +7188,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4574 + // line internal/php7/php7.y:4571 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -7205,7 +7202,7 @@ yydefault: } case 410: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4586 + // line internal/php7/php7.y:4583 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -7219,7 +7216,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4598 + // line internal/php7/php7.y:4595 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -7233,7 +7230,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4610 + // line internal/php7/php7.y:4607 { encapsed := &ast.ScalarEncapsedStringPart{ast.Node{}, yyDollar[2].token.Value} yyVAL.node = &ast.ScalarHeredoc{ast.Node{}, yyDollar[1].token.Value, []ast.Vertex{encapsed}} @@ -7249,7 +7246,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:4624 + // line internal/php7/php7.y:4621 { yyVAL.node = &ast.ScalarHeredoc{ast.Node{}, yyDollar[1].token.Value, nil} @@ -7263,7 +7260,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4636 + // line internal/php7/php7.y:4633 { yyVAL.node = &ast.ScalarEncapsed{ast.Node{}, yyDollar[2].list} @@ -7277,7 +7274,7 @@ yydefault: } case 415: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4648 + // line internal/php7/php7.y:4645 { yyVAL.node = &ast.ScalarHeredoc{ast.Node{}, yyDollar[1].token.Value, yyDollar[2].list} @@ -7291,7 +7288,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4660 + // line internal/php7/php7.y:4657 { yyVAL.node = yyDollar[1].node @@ -7299,7 +7296,7 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4666 + // line internal/php7/php7.y:4663 { yyVAL.node = yyDollar[1].node @@ -7307,7 +7304,7 @@ yydefault: } case 418: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4675 + // line internal/php7/php7.y:4672 { yyVAL.node = &ast.ExprConstFetch{ast.Node{}, yyDollar[1].node} @@ -7321,7 +7318,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4687 + // line internal/php7/php7.y:4684 { target := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.ExprClassConstFetch{ast.Node{}, yyDollar[1].node, target} @@ -7339,7 +7336,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4703 + // line internal/php7/php7.y:4700 { target := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.ExprClassConstFetch{ast.Node{}, yyDollar[1].node, target} @@ -7357,7 +7354,7 @@ yydefault: } case 421: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4722 + // line internal/php7/php7.y:4719 { yyVAL.node = yyDollar[1].node @@ -7365,7 +7362,7 @@ yydefault: } case 422: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4728 + // line internal/php7/php7.y:4725 { yyVAL.node = yyDollar[1].node @@ -7373,7 +7370,7 @@ yydefault: } case 423: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:4737 + // line internal/php7/php7.y:4734 { yyVAL.node = nil @@ -7381,7 +7378,7 @@ yydefault: } case 424: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4743 + // line internal/php7/php7.y:4740 { yyVAL.node = yyDollar[1].node @@ -7389,7 +7386,7 @@ yydefault: } case 425: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4752 + // line internal/php7/php7.y:4749 { yyVAL.node = yyDollar[1].node @@ -7397,7 +7394,7 @@ yydefault: } case 426: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4761 + // line internal/php7/php7.y:4758 { yyVAL.node = yyDollar[1].node @@ -7405,7 +7402,7 @@ yydefault: } case 427: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4767 + // line internal/php7/php7.y:4764 { yyVAL.node = yyDollar[2].node @@ -7417,7 +7414,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4777 + // line internal/php7/php7.y:4774 { yyVAL.node = yyDollar[1].node @@ -7425,7 +7422,7 @@ yydefault: } case 429: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4786 + // line internal/php7/php7.y:4783 { yyVAL.node = yyDollar[1].node @@ -7433,7 +7430,7 @@ yydefault: } case 430: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4792 + // line internal/php7/php7.y:4789 { yyVAL.node = yyDollar[2].node @@ -7445,7 +7442,7 @@ yydefault: } case 431: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4802 + // line internal/php7/php7.y:4799 { yyVAL.node = yyDollar[1].node @@ -7453,7 +7450,7 @@ yydefault: } case 432: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4811 + // line internal/php7/php7.y:4808 { yyVAL.node = yyDollar[1].node @@ -7461,7 +7458,7 @@ yydefault: } case 433: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:4817 + // line internal/php7/php7.y:4814 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7477,7 +7474,7 @@ yydefault: } case 434: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:4831 + // line internal/php7/php7.y:4828 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7493,7 +7490,7 @@ yydefault: } case 435: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:4845 + // line internal/php7/php7.y:4842 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7509,7 +7506,7 @@ yydefault: } case 436: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:4859 + // line internal/php7/php7.y:4856 { yyVAL.node = &ast.ExprMethodCall{ast.Node{}, yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*ast.ArgumentList)} @@ -7524,7 +7521,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4872 + // line internal/php7/php7.y:4869 { yyVAL.node = yyDollar[1].node @@ -7532,7 +7529,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4881 + // line internal/php7/php7.y:4878 { yyVAL.node = yyDollar[1].node @@ -7540,7 +7537,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4887 + // line internal/php7/php7.y:4884 { yyVAL.node = yyDollar[1].node @@ -7548,7 +7545,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4893 + // line internal/php7/php7.y:4890 { yyVAL.node = &ast.ExprPropertyFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7563,7 +7560,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4909 + // line internal/php7/php7.y:4906 { name := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.ExprVariable{ast.Node{}, name} @@ -7579,7 +7576,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:4923 + // line internal/php7/php7.y:4920 { yyVAL.node = &ast.ExprVariable{ast.Node{}, yyDollar[3].node} @@ -7595,7 +7592,7 @@ yydefault: } case 443: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:4937 + // line internal/php7/php7.y:4934 { yyVAL.node = &ast.ExprVariable{ast.Node{}, yyDollar[2].node} @@ -7609,7 +7606,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4952 + // line internal/php7/php7.y:4949 { yyVAL.node = &ast.ExprStaticPropertyFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7624,7 +7621,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4965 + // line internal/php7/php7.y:4962 { yyVAL.node = &ast.ExprStaticPropertyFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7639,7 +7636,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4981 + // line internal/php7/php7.y:4978 { yyVAL.node = yyDollar[1].node @@ -7647,7 +7644,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:4987 + // line internal/php7/php7.y:4984 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7663,7 +7660,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:5001 + // line internal/php7/php7.y:4998 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7679,7 +7676,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:5015 + // line internal/php7/php7.y:5012 { yyVAL.node = &ast.ExprPropertyFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7694,7 +7691,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:5028 + // line internal/php7/php7.y:5025 { yyVAL.node = &ast.ExprStaticPropertyFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7709,7 +7706,7 @@ yydefault: } case 451: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:5041 + // line internal/php7/php7.y:5038 { yyVAL.node = &ast.ExprStaticPropertyFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7724,7 +7721,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:5057 + // line internal/php7/php7.y:5054 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -7738,7 +7735,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:5069 + // line internal/php7/php7.y:5066 { yyVAL.node = yyDollar[2].node @@ -7750,7 +7747,7 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:5079 + // line internal/php7/php7.y:5076 { yyVAL.node = yyDollar[1].node @@ -7758,7 +7755,7 @@ yydefault: } case 455: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:5088 + // line internal/php7/php7.y:5085 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -7772,7 +7769,7 @@ yydefault: } case 456: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:5100 + // line internal/php7/php7.y:5097 { yyVAL.node = yyDollar[2].node @@ -7784,7 +7781,7 @@ yydefault: } case 457: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:5110 + // line internal/php7/php7.y:5107 { yyVAL.node = yyDollar[1].node @@ -7792,7 +7789,7 @@ yydefault: } case 458: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:5119 + // line internal/php7/php7.y:5116 { yyVAL.list = yyDollar[1].list @@ -7800,7 +7797,7 @@ yydefault: } case 459: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:5128 + // line internal/php7/php7.y:5125 { yyVAL.node = &ast.ExprArrayItem{ast.Node{}, false, nil, nil} @@ -7808,7 +7805,7 @@ yydefault: } case 460: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:5134 + // line internal/php7/php7.y:5131 { yyVAL.node = yyDollar[1].node @@ -7816,7 +7813,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:5143 + // line internal/php7/php7.y:5140 { if len(yyDollar[1].list) == 0 { yyDollar[1].list = []ast.Vertex{&ast.ExprArrayItem{ast.Node{}, false, nil, nil}} @@ -7831,7 +7828,7 @@ yydefault: } case 462: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:5156 + // line internal/php7/php7.y:5153 { if yyDollar[1].node.(*ast.ExprArrayItem).Key == nil && yyDollar[1].node.(*ast.ExprArrayItem).Val == nil { yyVAL.list = []ast.Vertex{} @@ -7843,7 +7840,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:5169 + // line internal/php7/php7.y:5166 { yyVAL.node = &ast.ExprArrayItem{ast.Node{}, false, yyDollar[1].node, yyDollar[3].node} @@ -7858,7 +7855,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:5182 + // line internal/php7/php7.y:5179 { yyVAL.node = &ast.ExprArrayItem{ast.Node{}, false, nil, yyDollar[1].node} @@ -7872,7 +7869,7 @@ yydefault: } case 465: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:5194 + // line internal/php7/php7.y:5191 { reference := &ast.ExprReference{ast.Node{}, yyDollar[4].node} yyVAL.node = &ast.ExprArrayItem{ast.Node{}, false, yyDollar[1].node, reference} @@ -7890,7 +7887,7 @@ yydefault: } case 466: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:5210 + // line internal/php7/php7.y:5207 { reference := &ast.ExprReference{ast.Node{}, yyDollar[2].node} yyVAL.node = &ast.ExprArrayItem{ast.Node{}, false, nil, reference} @@ -7906,7 +7903,7 @@ yydefault: } case 467: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:5224 + // line internal/php7/php7.y:5221 { yyVAL.node = &ast.ExprArrayItem{ast.Node{}, true, nil, yyDollar[2].node} @@ -7920,7 +7917,7 @@ yydefault: } case 468: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php7/php7.y:5236 + // line internal/php7/php7.y:5233 { // TODO: Cannot use list() as standalone expression listNode := &ast.ExprList{ast.Node{}, yyDollar[5].list} @@ -7941,7 +7938,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:5255 + // line internal/php7/php7.y:5252 { // TODO: Cannot use list() as standalone expression listNode := &ast.ExprList{ast.Node{}, yyDollar[3].list} @@ -7960,7 +7957,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:5275 + // line internal/php7/php7.y:5272 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -7968,7 +7965,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:5281 + // line internal/php7/php7.y:5278 { encapsed := &ast.ScalarEncapsedStringPart{ast.Node{}, yyDollar[2].token.Value} yyVAL.list = append(yyDollar[1].list, encapsed) @@ -7983,7 +7980,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:5294 + // line internal/php7/php7.y:5291 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -7991,7 +7988,7 @@ yydefault: } case 473: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:5300 + // line internal/php7/php7.y:5297 { encapsed := &ast.ScalarEncapsedStringPart{ast.Node{}, yyDollar[1].token.Value} yyVAL.list = []ast.Vertex{encapsed, yyDollar[2].node} @@ -8006,7 +8003,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:5316 + // line internal/php7/php7.y:5313 { name := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.ExprVariable{ast.Node{}, name} @@ -8022,7 +8019,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:5330 + // line internal/php7/php7.y:5327 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -8041,7 +8038,7 @@ yydefault: } case 476: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:5347 + // line internal/php7/php7.y:5344 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -8062,7 +8059,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:5366 + // line internal/php7/php7.y:5363 { variable := &ast.ExprVariable{ast.Node{}, yyDollar[2].node} @@ -8079,7 +8076,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:5381 + // line internal/php7/php7.y:5378 { name := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} variable := &ast.ExprVariable{ast.Node{}, name} @@ -8098,7 +8095,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php7/php7.y:5398 + // line internal/php7/php7.y:5395 { identifier := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -8119,7 +8116,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:5417 + // line internal/php7/php7.y:5414 { yyVAL.node = yyDollar[2].node @@ -8131,7 +8128,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:5430 + // line internal/php7/php7.y:5427 { yyVAL.node = &ast.ScalarString{ast.Node{}, yyDollar[1].token.Value} @@ -8145,7 +8142,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:5442 + // line internal/php7/php7.y:5439 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(string(yyDollar[1].token.Value)); err == nil { @@ -8164,7 +8161,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:5459 + // line internal/php7/php7.y:5456 { var lnumber *ast.ScalarLnumber // TODO: add option to handle 64 bit integer @@ -8192,7 +8189,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:5485 + // line internal/php7/php7.y:5482 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.ExprVariable{ast.Node{}, identifier} @@ -8208,7 +8205,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php7/php7.y:5502 + // line internal/php7/php7.y:5499 { yyVAL.node = &ast.ExprIsset{ast.Node{}, yyDollar[3].list} @@ -8228,7 +8225,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:5520 + // line internal/php7/php7.y:5517 { yyVAL.node = &ast.ExprEmpty{ast.Node{}, yyDollar[3].node} @@ -8244,7 +8241,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:5534 + // line internal/php7/php7.y:5531 { yyVAL.node = &ast.ExprInclude{ast.Node{}, yyDollar[2].node} @@ -8258,7 +8255,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:5546 + // line internal/php7/php7.y:5543 { yyVAL.node = &ast.ExprIncludeOnce{ast.Node{}, yyDollar[2].node} @@ -8272,7 +8269,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:5558 + // line internal/php7/php7.y:5555 { yyVAL.node = &ast.ExprEval{ast.Node{}, yyDollar[3].node} @@ -8288,7 +8285,7 @@ yydefault: } case 490: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:5572 + // line internal/php7/php7.y:5569 { yyVAL.node = &ast.ExprRequire{ast.Node{}, yyDollar[2].node} @@ -8302,7 +8299,7 @@ yydefault: } case 491: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:5584 + // line internal/php7/php7.y:5581 { yyVAL.node = &ast.ExprRequireOnce{ast.Node{}, yyDollar[2].node} @@ -8316,7 +8313,7 @@ yydefault: } case 492: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:5599 + // line internal/php7/php7.y:5596 { yyVAL.list = []ast.Vertex{yyDollar[1].node} @@ -8324,7 +8321,7 @@ yydefault: } case 493: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:5605 + // line internal/php7/php7.y:5602 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -8335,7 +8332,7 @@ yydefault: } case 494: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:5617 + // line internal/php7/php7.y:5614 { yyVAL.node = yyDollar[1].node diff --git a/internal/php7/php7.y b/internal/php7/php7.y index c65b0f9..752de40 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -528,58 +528,61 @@ top_statement: } | T_USE mixed_group_use_declaration ';' { - $$ = $2 + $$ = &ast.StmtUse{ast.Node{}, $2} // save position $$.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 use_type group_use_declaration ';' { - $3.(*ast.StmtGroupUse).UseType = $2 - $$ = $3 + useType := &ast.StmtUseType{ast.Node{}, $2, $3} + $$ = &ast.StmtUse{ast.Node{}, useType} // save position + useType.GetNode().Position = position.NewNodesPosition($2, $3) $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.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 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 use_type use_declarations ';' { - $$ = &ast.StmtUseList{ast.Node{}, $2, $3} + useList := &ast.StmtUseList{ast.Node{}, $3} + useType := &ast.StmtUseType{ast.Node{}, $2, useList} + $$ = &ast.StmtUse{ast.Node{}, useType} // save position + useList.GetNode().Position = position.NewNodeListPosition($3) + useType.GetNode().Position = position.NewNodesPosition($2, useList) $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.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) } @@ -630,20 +633,20 @@ group_use_declaration: namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations possible_comma '}' { name := &ast.NameName{ast.Node{}, $1} - $$ = &ast.StmtGroupUse{ast.Node{}, nil, name, $4} + useList := &ast.StmtUseList{ast.Node{}, $4} + $$ = &ast.StmtGroupUseList{ast.Node{}, name, useList} // save position name.GetNode().Position = position.NewNodeListPosition($1) + useList.GetNode().Position = position.NewNodeListPosition($4) $$.GetNode().Position = position.NewNodeListTokenPosition($1, $6) // save comments - yylex.(*Parser).MoveFreeFloating($1[0], name) - yylex.(*Parser).setFreeFloating(name, token.End, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Slash, $3.Tokens) + yylex.(*Parser).setFreeFloatingTokens(useList, token.Start, append($2.Tokens, $3.Tokens...)) if $5 != nil { - yylex.(*Parser).setFreeFloating($$, token.Stmts, append($5.Tokens, $6.Tokens...)) + yylex.(*Parser).setFreeFloatingTokens(useList, token.End, append($5.Tokens, $6.Tokens...)) } else { - yylex.(*Parser).setFreeFloating($$, token.Stmts, $6.Tokens) + yylex.(*Parser).setFreeFloating(useList, token.End, $6.Tokens) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -651,22 +654,22 @@ group_use_declaration: | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations possible_comma '}' { name := &ast.NameName{ast.Node{}, $2} - $$ = &ast.StmtGroupUse{ast.Node{}, nil, name, $5} + useList := &ast.StmtUseList{ast.Node{}, $5} + $$ = &ast.StmtGroupUseList{ast.Node{}, name, useList} // save position name.GetNode().Position = position.NewNodeListPosition($2) + useList.GetNode().Position = position.NewNodeListPosition($5) $$.GetNode().Position = position.NewTokensPosition($1, $7) // save comments - yylex.(*Parser).setFreeFloating($$, token.UseType, $1.Tokens) - yylex.(*Parser).MoveFreeFloating($2[0], name) - yylex.(*Parser).setFreeFloating(name, token.End, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Slash, $4.Tokens) + yylex.(*Parser).setFreeFloatingTokens(useList, token.Start, append($3.Tokens, $4.Tokens...)) if $6 != nil { - yylex.(*Parser).setFreeFloating($$, token.Stmts, append($6.Tokens, $7.Tokens...)) + yylex.(*Parser).setFreeFloatingTokens(useList, token.End, append($6.Tokens, $7.Tokens...)) } else { - yylex.(*Parser).setFreeFloating($$, token.Stmts, $7.Tokens) + yylex.(*Parser).setFreeFloating(useList, token.End, $7.Tokens) } + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -676,20 +679,20 @@ mixed_group_use_declaration: namespace_name T_NS_SEPARATOR '{' inline_use_declarations possible_comma '}' { name := &ast.NameName{ast.Node{}, $1} - $$ = &ast.StmtGroupUse{ast.Node{}, nil, name, $4} + useList := &ast.StmtUseList{ast.Node{}, $4} + $$ = &ast.StmtGroupUseList{ast.Node{}, name, useList} // save position name.GetNode().Position = position.NewNodeListPosition($1) + useList.GetNode().Position = position.NewNodeListPosition($4) $$.GetNode().Position = position.NewNodeListTokenPosition($1, $6) // save comments - yylex.(*Parser).MoveFreeFloating($1[0], name) - yylex.(*Parser).setFreeFloating(name, token.End, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Slash, $3.Tokens) + yylex.(*Parser).setFreeFloatingTokens(useList, token.Start, append($2.Tokens, $3.Tokens...)) if $5 != nil { - yylex.(*Parser).setFreeFloating($$, token.Stmts, append($5.Tokens, $6.Tokens...)) + yylex.(*Parser).setFreeFloatingTokens(useList, token.End, append($5.Tokens, $6.Tokens...)) } else { - yylex.(*Parser).setFreeFloating($$, token.Stmts, $6.Tokens) + yylex.(*Parser).setFreeFloatingTokens(useList, token.End, $6.Tokens) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -697,22 +700,22 @@ mixed_group_use_declaration: | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' inline_use_declarations possible_comma '}' { name := &ast.NameName{ast.Node{}, $2} - $$ = &ast.StmtGroupUse{ast.Node{}, nil, name, $5} + useList := &ast.StmtUseList{ast.Node{}, $5} + $$ = &ast.StmtGroupUseList{ast.Node{}, name, useList} // save position name.GetNode().Position = position.NewNodeListPosition($2) + useList.GetNode().Position = position.NewNodeListPosition($5) $$.GetNode().Position = position.NewTokensPosition($1, $7) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Use, $1.Tokens) - yylex.(*Parser).MoveFreeFloating($2[0], name) - yylex.(*Parser).setFreeFloating(name, token.End, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Slash, $4.Tokens) + yylex.(*Parser).setFreeFloatingTokens(useList, token.Start, append($3.Tokens, $4.Tokens...)) if $6 != nil { - yylex.(*Parser).setFreeFloating($$, token.Stmts, append($6.Tokens, $7.Tokens...)) + yylex.(*Parser).setFreeFloatingTokens(useList, token.End, append($6.Tokens, $7.Tokens...)) } else { - yylex.(*Parser).setFreeFloating($$, token.Stmts, $7.Tokens) + yylex.(*Parser).setFreeFloating(useList, token.End, $7.Tokens) } + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -792,8 +795,10 @@ inline_use_declaration: } | use_type unprefixed_use_declaration { - $2.(*ast.StmtUse).UseType = $1 - $$ = $2 + $$ = &ast.StmtUseType{ast.Node{}, $1, $2} + + // save position + $$.GetNode().Position = position.NewNodesPosition($1, $2) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -803,14 +808,11 @@ unprefixed_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], name) + $$.GetNode().Position = position.NewNodePosition(name) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -818,7 +820,7 @@ unprefixed_use_declaration: { 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) @@ -826,7 +828,6 @@ unprefixed_use_declaration: $$.GetNode().Position = position.NewNodeListTokenPosition($1, $3) // save comments - yylex.(*Parser).MoveFreeFloating($1[0], name) yylex.(*Parser).setFreeFloating(name, token.End, $2.Tokens) yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Tokens) @@ -839,9 +840,6 @@ use_declaration: { $$ = $1 - // save coments - yylex.(*Parser).MoveFreeFloating($1.(*ast.StmtUse).Use, $$) - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NS_SEPARATOR unprefixed_use_declaration @@ -849,8 +847,7 @@ use_declaration: $$ = $2; // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.Slash, $1.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/internal/php7/php7_test.go b/internal/php7/php7_test.go index 88589ee..27e217a 100644 --- a/internal/php7/php7_test.go +++ b/internal/php7/php7_test.go @@ -9013,7 +9013,7 @@ func TestPhp7(t *testing.T) { }, }, }, - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 161, @@ -9022,17 +9022,17 @@ func TestPhp7(t *testing.T) { EndPos: 3370, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3366, - EndPos: 3369, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3366, + EndPos: 3369, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 161, @@ -9041,24 +9041,34 @@ func TestPhp7(t *testing.T) { EndPos: 3369, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3366, - EndPos: 3369, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3366, + EndPos: 3369, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3366, + EndPos: 3369, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, }, }, }, }, - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 162, @@ -9067,17 +9077,17 @@ func TestPhp7(t *testing.T) { EndPos: 3380, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3376, - EndPos: 3379, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3376, + EndPos: 3379, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 162, @@ -9086,24 +9096,34 @@ func TestPhp7(t *testing.T) { EndPos: 3379, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3376, - EndPos: 3379, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3376, + EndPos: 3379, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3376, + EndPos: 3379, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, }, }, }, }, - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 163, @@ -9112,54 +9132,64 @@ func TestPhp7(t *testing.T) { EndPos: 3397, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 163, - EndLine: 163, - StartPos: 3386, - EndPos: 3396, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 163, + EndLine: 163, + StartPos: 3386, + EndPos: 3396, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 163, EndLine: 163, StartPos: 3386, - EndPos: 3389, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 163, - EndLine: 163, - StartPos: 3386, - EndPos: 3389, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 163, - EndLine: 163, - StartPos: 3393, EndPos: 3396, }, }, - Value: []byte("Bar"), + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 163, + EndLine: 163, + StartPos: 3386, + EndPos: 3389, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 163, + EndLine: 163, + StartPos: 3386, + EndPos: 3389, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 163, + EndLine: 163, + StartPos: 3393, + EndPos: 3396, + }, + }, + Value: []byte("Bar"), + }, }, }, }, }, - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 164, @@ -9168,17 +9198,17 @@ func TestPhp7(t *testing.T) { EndPos: 3411, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3402, - EndPos: 3405, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3402, + EndPos: 3410, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 164, @@ -9187,31 +9217,31 @@ func TestPhp7(t *testing.T) { EndPos: 3405, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3402, - EndPos: 3405, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3402, + EndPos: 3405, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3402, + EndPos: 3405, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3407, - EndPos: 3410, - }, - }, - Use: &ast.NameName{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 164, @@ -9220,24 +9250,34 @@ func TestPhp7(t *testing.T) { EndPos: 3410, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3407, - EndPos: 3410, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3407, + EndPos: 3410, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3407, + EndPos: 3410, + }, + }, + Value: []byte("Bar"), }, - Value: []byte("Bar"), }, }, }, }, }, }, - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 165, @@ -9246,17 +9286,17 @@ func TestPhp7(t *testing.T) { EndPos: 3432, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3416, - EndPos: 3419, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3416, + EndPos: 3431, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 165, @@ -9265,68 +9305,78 @@ func TestPhp7(t *testing.T) { EndPos: 3419, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3416, - EndPos: 3419, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3416, + EndPos: 3419, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3416, + EndPos: 3419, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3421, - EndPos: 3431, - }, - }, - Use: &ast.NameName{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 165, EndLine: 165, StartPos: 3421, - EndPos: 3424, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3421, - EndPos: 3424, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3428, EndPos: 3431, }, }, - Value: []byte("Baz"), + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3421, + EndPos: 3424, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3421, + EndPos: 3424, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3428, + EndPos: 3431, + }, + }, + Value: []byte("Baz"), + }, }, }, }, }, - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 166, @@ -9335,38 +9385,46 @@ func TestPhp7(t *testing.T) { EndPos: 3456, }, }, - UseType: &ast.Identifier{ + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 166, EndLine: 166, StartPos: 3437, - EndPos: 3445, + EndPos: 3455, }, }, - Value: []byte("function"), - }, - Uses: []ast.Vertex{ - &ast.StmtUse{ + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3437, + EndPos: 3445, + }, + }, + Value: []byte("function"), + }, + Use: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 166, EndLine: 166, StartPos: 3446, - EndPos: 3449, + EndPos: 3455, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3446, - EndPos: 3449, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3446, + EndPos: 3449, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 166, @@ -9375,31 +9433,31 @@ func TestPhp7(t *testing.T) { EndPos: 3449, }, }, - Value: []byte("Foo"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3446, + EndPos: 3449, + }, + }, + Value: []byte("Foo"), + }, + }, }, }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3452, - EndPos: 3455, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3452, - EndPos: 3455, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3452, + EndPos: 3455, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 166, @@ -9408,14 +9466,26 @@ func TestPhp7(t *testing.T) { EndPos: 3455, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3452, + EndPos: 3455, + }, + }, + Value: []byte("Bar"), + }, + }, }, }, }, }, }, }, - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 167, @@ -9424,38 +9494,46 @@ func TestPhp7(t *testing.T) { EndPos: 3494, }, }, - UseType: &ast.Identifier{ + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 167, EndLine: 167, StartPos: 3461, - EndPos: 3469, + EndPos: 3493, }, }, - Value: []byte("function"), - }, - Uses: []ast.Vertex{ - &ast.StmtUse{ + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3461, + EndPos: 3469, + }, + }, + Value: []byte("function"), + }, + Use: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 167, EndLine: 167, StartPos: 3470, - EndPos: 3480, + EndPos: 3493, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3470, - EndPos: 3473, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3470, + EndPos: 3480, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 167, @@ -9464,42 +9542,42 @@ func TestPhp7(t *testing.T) { EndPos: 3473, }, }, - Value: []byte("Foo"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3470, + EndPos: 3473, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3477, + EndPos: 3480, + }, + }, + Value: []byte("foo"), }, }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3477, - EndPos: 3480, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3483, + EndPos: 3493, + }, }, - }, - Value: []byte("foo"), - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3483, - EndPos: 3493, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3483, - EndPos: 3486, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 167, @@ -9508,25 +9586,37 @@ func TestPhp7(t *testing.T) { EndPos: 3486, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3483, + EndPos: 3486, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3490, + EndPos: 3493, + }, + }, + Value: []byte("bar"), }, }, }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3490, - EndPos: 3493, - }, - }, - Value: []byte("bar"), - }, }, }, }, - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 168, @@ -9535,38 +9625,46 @@ func TestPhp7(t *testing.T) { EndPos: 3515, }, }, - UseType: &ast.Identifier{ + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 168, EndLine: 168, StartPos: 3499, - EndPos: 3504, + EndPos: 3514, }, }, - Value: []byte("const"), - }, - Uses: []ast.Vertex{ - &ast.StmtUse{ + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3499, + EndPos: 3504, + }, + }, + Value: []byte("const"), + }, + Use: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 168, EndLine: 168, StartPos: 3505, - EndPos: 3508, + EndPos: 3514, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3505, - EndPos: 3508, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3505, + EndPos: 3508, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 168, @@ -9575,31 +9673,31 @@ func TestPhp7(t *testing.T) { EndPos: 3508, }, }, - Value: []byte("Foo"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3505, + EndPos: 3508, + }, + }, + Value: []byte("Foo"), + }, + }, }, }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3511, - EndPos: 3514, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3511, - EndPos: 3514, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3511, + EndPos: 3514, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 168, @@ -9608,14 +9706,26 @@ func TestPhp7(t *testing.T) { EndPos: 3514, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3511, + EndPos: 3514, + }, + }, + Value: []byte("Bar"), + }, + }, }, }, }, }, }, }, - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 169, @@ -9624,38 +9734,46 @@ func TestPhp7(t *testing.T) { EndPos: 3550, }, }, - UseType: &ast.Identifier{ + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 169, EndLine: 169, StartPos: 3520, - EndPos: 3525, + EndPos: 3549, }, }, - Value: []byte("const"), - }, - Uses: []ast.Vertex{ - &ast.StmtUse{ + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3520, + EndPos: 3525, + }, + }, + Value: []byte("const"), + }, + Use: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 169, EndLine: 169, StartPos: 3526, - EndPos: 3536, + EndPos: 3549, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3526, - EndPos: 3529, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3526, + EndPos: 3536, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 169, @@ -9664,42 +9782,42 @@ func TestPhp7(t *testing.T) { EndPos: 3529, }, }, - Value: []byte("Foo"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3526, + EndPos: 3529, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3533, + EndPos: 3536, + }, + }, + Value: []byte("foo"), }, }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3533, - EndPos: 3536, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3539, + EndPos: 3549, + }, }, - }, - Value: []byte("foo"), - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3539, - EndPos: 3549, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3539, - EndPos: 3542, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 169, @@ -9708,25 +9826,37 @@ func TestPhp7(t *testing.T) { EndPos: 3542, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3539, + EndPos: 3542, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3546, + EndPos: 3549, + }, + }, + Value: []byte("bar"), }, }, }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3546, - EndPos: 3549, - }, - }, - Value: []byte("bar"), - }, }, }, }, - &ast.StmtGroupUse{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 171, @@ -9735,50 +9865,58 @@ func TestPhp7(t *testing.T) { EndPos: 3572, }, }, - Prefix: &ast.NameName{ + UseList: &ast.StmtGroupUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 171, EndLine: 171, - StartPos: 3557, - EndPos: 3560, + StartPos: 3556, + EndPos: 3571, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3557, - EndPos: 3560, - }, + Prefix: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3557, + EndPos: 3560, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3557, + EndPos: 3560, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, - }, - UseList: []ast.Vertex{ - &ast.StmtUse{ + UseList: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 171, EndLine: 171, StartPos: 3562, - EndPos: 3565, + EndPos: 3570, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3562, - EndPos: 3565, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3562, + EndPos: 3565, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 171, @@ -9787,31 +9925,31 @@ func TestPhp7(t *testing.T) { EndPos: 3565, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3562, + EndPos: 3565, + }, + }, + Value: []byte("Bar"), + }, + }, }, }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3567, - EndPos: 3570, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3567, - EndPos: 3570, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3567, + EndPos: 3570, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 171, @@ -9820,14 +9958,26 @@ func TestPhp7(t *testing.T) { EndPos: 3570, }, }, - Value: []byte("Baz"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3567, + EndPos: 3570, + }, + }, + Value: []byte("Baz"), + }, + }, }, }, }, }, }, }, - &ast.StmtGroupUse{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 172, @@ -9836,50 +9986,58 @@ func TestPhp7(t *testing.T) { EndPos: 3600, }, }, - Prefix: &ast.NameName{ + UseList: &ast.StmtGroupUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 172, EndLine: 172, StartPos: 3577, - EndPos: 3580, + EndPos: 3599, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3577, - EndPos: 3580, - }, + Prefix: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3577, + EndPos: 3580, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3577, + EndPos: 3580, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, - }, - UseList: []ast.Vertex{ - &ast.StmtUse{ + UseList: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 172, EndLine: 172, StartPos: 3582, - EndPos: 3585, + EndPos: 3598, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3582, - EndPos: 3585, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3582, + EndPos: 3585, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 172, @@ -9888,31 +10046,31 @@ func TestPhp7(t *testing.T) { EndPos: 3585, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3582, + EndPos: 3585, + }, + }, + Value: []byte("Bar"), + }, + }, }, }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3587, - EndPos: 3598, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3587, - EndPos: 3590, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3587, + EndPos: 3598, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 172, @@ -9921,25 +10079,37 @@ func TestPhp7(t *testing.T) { EndPos: 3590, }, }, - Value: []byte("Baz"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3587, + EndPos: 3590, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3594, + EndPos: 3598, + }, + }, + Value: []byte("quux"), }, }, }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3594, - EndPos: 3598, - }, - }, - Value: []byte("quux"), - }, }, }, }, - &ast.StmtGroupUse{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 173, @@ -9948,28 +10118,36 @@ func TestPhp7(t *testing.T) { EndPos: 3629, }, }, - UseType: &ast.Identifier{ + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 173, EndLine: 173, StartPos: 3605, - EndPos: 3613, + EndPos: 3628, }, }, - Value: []byte("function"), - }, - Prefix: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3614, - EndPos: 3617, + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3605, + EndPos: 3613, + }, }, + Value: []byte("function"), }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.StmtGroupUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3614, + EndPos: 3628, + }, + }, + Prefix: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 173, @@ -9978,31 +10156,31 @@ func TestPhp7(t *testing.T) { EndPos: 3617, }, }, - Value: []byte("Foo"), - }, - }, - }, - UseList: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3619, - EndPos: 3622, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3614, + EndPos: 3617, + }, + }, + Value: []byte("Foo"), + }, }, }, - Use: &ast.NameName{ + UseList: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 173, EndLine: 173, StartPos: 3619, - EndPos: 3622, + EndPos: 3627, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 173, @@ -10011,31 +10189,31 @@ func TestPhp7(t *testing.T) { EndPos: 3622, }, }, - Value: []byte("Bar"), + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3619, + EndPos: 3622, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3619, + EndPos: 3622, + }, + }, + Value: []byte("Bar"), + }, + }, + }, }, - }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3624, - EndPos: 3627, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3624, - EndPos: 3627, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 173, @@ -10044,14 +10222,36 @@ func TestPhp7(t *testing.T) { EndPos: 3627, }, }, - Value: []byte("Baz"), + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3624, + EndPos: 3627, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3624, + EndPos: 3627, + }, + }, + Value: []byte("Baz"), + }, + }, + }, }, }, }, }, }, }, - &ast.StmtGroupUse{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 174, @@ -10060,28 +10260,36 @@ func TestPhp7(t *testing.T) { EndPos: 3656, }, }, - UseType: &ast.Identifier{ + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 174, EndLine: 174, StartPos: 3634, - EndPos: 3639, + EndPos: 3655, }, }, - Value: []byte("const"), - }, - Prefix: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3641, - EndPos: 3644, + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3634, + EndPos: 3639, + }, }, + Value: []byte("const"), }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.StmtGroupUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3640, + EndPos: 3655, + }, + }, + Prefix: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 174, @@ -10090,31 +10298,31 @@ func TestPhp7(t *testing.T) { EndPos: 3644, }, }, - Value: []byte("Foo"), - }, - }, - }, - UseList: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3646, - EndPos: 3649, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3641, + EndPos: 3644, + }, + }, + Value: []byte("Foo"), + }, }, }, - Use: &ast.NameName{ + UseList: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 174, EndLine: 174, StartPos: 3646, - EndPos: 3649, + EndPos: 3654, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 174, @@ -10123,31 +10331,31 @@ func TestPhp7(t *testing.T) { EndPos: 3649, }, }, - Value: []byte("Bar"), + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3646, + EndPos: 3649, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3646, + EndPos: 3649, + }, + }, + Value: []byte("Bar"), + }, + }, + }, }, - }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3651, - EndPos: 3654, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3651, - EndPos: 3654, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 174, @@ -10156,14 +10364,36 @@ func TestPhp7(t *testing.T) { EndPos: 3654, }, }, - Value: []byte("Baz"), + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3651, + EndPos: 3654, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3651, + EndPos: 3654, + }, + }, + Value: []byte("Baz"), + }, + }, + }, }, }, }, }, }, }, - &ast.StmtGroupUse{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 175, @@ -10172,61 +10402,69 @@ func TestPhp7(t *testing.T) { EndPos: 3691, }, }, - Prefix: &ast.NameName{ + UseList: &ast.StmtGroupUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 175, EndLine: 175, StartPos: 3661, - EndPos: 3664, + EndPos: 3690, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3661, - EndPos: 3664, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - UseList: []ast.Vertex{ - &ast.StmtUse{ + Prefix: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 175, EndLine: 175, - StartPos: 3672, - EndPos: 3675, + StartPos: 3661, + EndPos: 3664, }, }, - UseType: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3666, - EndPos: 3671, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3661, + EndPos: 3664, + }, }, + Value: []byte("Foo"), }, - Value: []byte("const"), }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3672, - EndPos: 3675, - }, + }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3666, + EndPos: 3689, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseType{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3666, + EndPos: 3675, + }, + }, + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3666, + EndPos: 3671, + }, + }, + Value: []byte("const"), + }, + Use: &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 175, @@ -10235,42 +10473,52 @@ func TestPhp7(t *testing.T) { EndPos: 3675, }, }, - Value: []byte("Bar"), + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3672, + EndPos: 3675, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3672, + EndPos: 3675, + }, + }, + Value: []byte("Bar"), + }, + }, + }, }, }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3686, - EndPos: 3689, - }, - }, - UseType: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3677, - EndPos: 3685, + &ast.StmtUseType{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3677, + EndPos: 3689, + }, }, - }, - Value: []byte("function"), - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3686, - EndPos: 3689, + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3677, + EndPos: 3685, + }, + }, + Value: []byte("function"), }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 175, @@ -10279,7 +10527,29 @@ func TestPhp7(t *testing.T) { EndPos: 3689, }, }, - Value: []byte("Baz"), + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3686, + EndPos: 3689, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3686, + EndPos: 3689, + }, + }, + Value: []byte("Baz"), + }, + }, + }, }, }, }, diff --git a/pkg/ast/ast.go b/pkg/ast/ast.go index 41b540b..4513b11 100644 --- a/pkg/ast/ast.go +++ b/pkg/ast/ast.go @@ -59,7 +59,6 @@ type NodeVisitor interface { StmtFunction(n *StmtFunction) StmtGlobal(n *StmtGlobal) StmtGoto(n *StmtGoto) - StmtGroupUse(n *StmtGroupUse) StmtHaltCompiler(n *StmtHaltCompiler) StmtIf(n *StmtIf) StmtInlineHtml(n *StmtInlineHtml) @@ -85,7 +84,10 @@ type NodeVisitor interface { StmtTry(n *StmtTry) StmtUnset(n *StmtUnset) StmtUse(n *StmtUse) + StmtGroupUseList(n *StmtGroupUseList) StmtUseList(n *StmtUseList) + StmtUseDeclaration(n *StmtUseDeclaration) + StmtUseType(n *StmtUseType) StmtWhile(n *StmtWhile) ExprArray(n *ExprArray) diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 0435c7c..b609578 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -532,18 +532,6 @@ func (n *StmtGoto) Accept(v NodeVisitor) { v.StmtGoto(n) } -// StmtGroupUse node -type StmtGroupUse struct { - Node - UseType Vertex - Prefix Vertex - UseList []Vertex -} - -func (n *StmtGroupUse) Accept(v NodeVisitor) { - v.StmtGroupUse(n) -} - // StmtHaltCompiler node type StmtHaltCompiler struct { Node @@ -804,26 +792,56 @@ func (n *StmtUnset) Accept(v NodeVisitor) { // StmtUse node type StmtUse struct { Node - UseType Vertex - Use Vertex - Alias Vertex + UseList Vertex } func (n *StmtUse) Accept(v NodeVisitor) { v.StmtUse(n) } +// StmtGroupUseList node +type StmtGroupUseList struct { + Node + Prefix Vertex + UseList Vertex +} + +func (n *StmtGroupUseList) Accept(v NodeVisitor) { + v.StmtGroupUseList(n) +} + // StmtUseList node type StmtUseList struct { Node - UseType Vertex - Uses []Vertex + UseDeclarations []Vertex } func (n *StmtUseList) Accept(v NodeVisitor) { v.StmtUseList(n) } +// StmtUseDeclaration node +type StmtUseDeclaration struct { + Node + Use Vertex + Alias Vertex +} + +func (n *StmtUseDeclaration) Accept(v NodeVisitor) { + v.StmtUseDeclaration(n) +} + +// StmtUseType node +type StmtUseType struct { + Node + Type Vertex + Use Vertex +} + +func (n *StmtUseType) Accept(v NodeVisitor) { + v.StmtUseType(n) +} + // StmtWhile node type StmtWhile struct { Node diff --git a/pkg/ast/traverser/dfs.go b/pkg/ast/traverser/dfs.go index d25b426..a71c83b 100644 --- a/pkg/ast/traverser/dfs.go +++ b/pkg/ast/traverser/dfs.go @@ -745,30 +745,6 @@ func (t *DFS) Traverse(n ast.Vertex) { t.Traverse(nn.Label) t.visitor.Leave("Label", true) } - case *ast.StmtGroupUse: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.UseType != nil { - t.visitor.Enter("UseType", true) - t.Traverse(nn.UseType) - t.visitor.Leave("UseType", true) - } - if nn.Prefix != nil { - t.visitor.Enter("Prefix", true) - t.Traverse(nn.Prefix) - t.visitor.Leave("Prefix", true) - } - if nn.UseList != nil { - t.visitor.Enter("UseList", false) - for _, c := range nn.UseList { - t.Traverse(c) - } - t.visitor.Leave("UseList", false) - } case *ast.StmtHaltCompiler: if nn == nil { return @@ -1174,10 +1150,48 @@ func (t *DFS) Traverse(n ast.Vertex) { if !t.visitor.EnterNode(nn) { return } - if nn.UseType != nil { - t.visitor.Enter("UseType", true) - t.Traverse(nn.UseType) - t.visitor.Leave("UseType", true) + if nn.UseList != nil { + t.visitor.Enter("UseList", true) + t.Traverse(nn.UseList) + t.visitor.Leave("UseList", true) + } + case *ast.StmtGroupUseList: + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Prefix != nil { + t.visitor.Enter("Prefix", true) + t.Traverse(nn.Prefix) + t.visitor.Leave("Prefix", true) + } + if nn.UseList != nil { + t.visitor.Enter("UseList", true) + t.Traverse(nn.UseList) + t.visitor.Leave("UseList", true) + } + case *ast.StmtUseList: + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.UseDeclarations != nil { + t.visitor.Enter("UseDeclarations", false) + for _, c := range nn.UseDeclarations { + t.Traverse(c) + } + t.visitor.Leave("UseDeclarations", false) + } + case *ast.StmtUseDeclaration: + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return } if nn.Use != nil { t.visitor.Enter("Use", true) @@ -1189,24 +1203,22 @@ func (t *DFS) Traverse(n ast.Vertex) { t.Traverse(nn.Alias) t.visitor.Leave("Alias", true) } - case *ast.StmtUseList: + case *ast.StmtUseType: if nn == nil { return } if !t.visitor.EnterNode(nn) { return } - if nn.UseType != nil { - t.visitor.Enter("UseType", true) - t.Traverse(nn.UseType) - t.visitor.Leave("UseType", true) + if nn.Type != nil { + t.visitor.Enter("Type", true) + t.Traverse(nn.Type) + t.visitor.Leave("Type", true) } - if nn.Uses != nil { - t.visitor.Enter("Uses", false) - for _, c := range nn.Uses { - t.Traverse(c) - } - t.visitor.Leave("Uses", false) + if nn.Use != nil { + t.visitor.Enter("Use", true) + t.Traverse(nn.Use) + t.visitor.Leave("Use", true) } case *ast.StmtWhile: if nn == nil { diff --git a/pkg/ast/visitor/dump.go b/pkg/ast/visitor/dump.go index 9346d75..fd9e253 100644 --- a/pkg/ast/visitor/dump.go +++ b/pkg/ast/visitor/dump.go @@ -437,12 +437,6 @@ func (v *Dump) StmtGoto(n *ast.StmtGoto) { v.printNode(n.GetNode()) } -func (v *Dump) StmtGroupUse(n *ast.StmtGroupUse) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtGroupUse{\n") - v.printNode(n.GetNode()) -} - func (v *Dump) StmtHaltCompiler(n *ast.StmtHaltCompiler) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtHaltCompiler{\n") @@ -596,12 +590,30 @@ func (v *Dump) StmtUse(n *ast.StmtUse) { v.printNode(n.GetNode()) } +func (v *Dump) StmtGroupUseList(n *ast.StmtGroupUseList) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtGroupUseList{\n") + v.printNode(n.GetNode()) +} + func (v *Dump) StmtUseList(n *ast.StmtUseList) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtUseList{\n") v.printNode(n.GetNode()) } +func (v *Dump) StmtUseDeclaration(n *ast.StmtUseDeclaration) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtUseDeclaration{\n") + v.printNode(n.GetNode()) +} + +func (v *Dump) StmtUseType(n *ast.StmtUseType) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtUseType{\n") + v.printNode(n.GetNode()) +} + func (v *Dump) StmtWhile(n *ast.StmtWhile) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtWhile{\n") diff --git a/pkg/ast/visitor/namespace_resolver.go b/pkg/ast/visitor/namespace_resolver.go index 9438971..65f0f54 100644 --- a/pkg/ast/visitor/namespace_resolver.go +++ b/pkg/ast/visitor/namespace_resolver.go @@ -13,7 +13,9 @@ type NamespaceResolver struct { Namespace *Namespace ResolvedNames map[ast.Vertex]string - goDeep bool + goDeep bool + useType string + usePrefix []ast.Vertex } // NewNamespaceResolver NamespaceResolver type constructor @@ -45,28 +47,28 @@ func (nsr *NamespaceResolver) StmtNamespace(n *ast.StmtNamespace) { } } -func (nsr *NamespaceResolver) StmtUseList(n *ast.StmtUseList) { - useType := "" - if n.UseType != nil { - useType = string(n.UseType.(*ast.Identifier).Value) +func (nsr *NamespaceResolver) StmtUseType(n *ast.StmtUseType) { + if n.Type != nil { + nsr.useType = string(n.Type.(*ast.Identifier).Value) } - - for _, nn := range n.Uses { - nsr.AddAlias(useType, nn, nil) - } - - nsr.goDeep = false } -func (nsr *NamespaceResolver) StmtGroupUse(n *ast.StmtGroupUse) { - useType := "" - if n.UseType != nil { - useType = string(n.UseType.(*ast.Identifier).Value) +func (nsr *NamespaceResolver) StmtGroupUseList(n *ast.StmtGroupUseList) { + if n.Prefix != nil { + nsr.usePrefix = n.Prefix.(*ast.NameName).Parts + } +} + +func (nsr *NamespaceResolver) StmtUseDeclaration(n *ast.StmtUseDeclaration) { + useNameParts := n.Use.(*ast.NameName).Parts + var alias string + if n.Alias == nil { + alias = string(useNameParts[len(useNameParts)-1].(*ast.NameNamePart).Value) + } else { + alias = string(n.Alias.(*ast.Identifier).Value) } - for _, nn := range n.UseList { - nsr.AddAlias(useType, nn, n.Prefix.(*ast.NameName).Parts) - } + nsr.Namespace.AddAlias(nsr.useType, concatNameParts(nsr.usePrefix, useNameParts), alias) nsr.goDeep = false } @@ -213,26 +215,10 @@ func (nsr *NamespaceResolver) LeaveNode(n ast.Vertex) { if nn.Stmts != nil { nsr.Namespace = NewNamespace("") } - } -} - -// AddAlias adds a new alias -func (nsr *NamespaceResolver) AddAlias(useType string, nn ast.Vertex, prefix []ast.Vertex) { - switch use := nn.(type) { - case *ast.StmtUse: - if use.UseType != nil { - useType = string(use.UseType.(*ast.Identifier).Value) - } - - useNameParts := use.Use.(*ast.NameName).Parts - var alias string - if use.Alias == nil { - alias = string(useNameParts[len(useNameParts)-1].(*ast.NameNamePart).Value) - } else { - alias = string(use.Alias.(*ast.Identifier).Value) - } - - nsr.Namespace.AddAlias(useType, concatNameParts(prefix, useNameParts), alias) + case *ast.StmtUseType: + nsr.useType = "" + case *ast.StmtGroupUseList: + nsr.usePrefix = nil } } diff --git a/pkg/ast/visitor/namespace_resolver_test.go b/pkg/ast/visitor/namespace_resolver_test.go index d52d635..22eb8bc 100644 --- a/pkg/ast/visitor/namespace_resolver_test.go +++ b/pkg/ast/visitor/namespace_resolver_test.go @@ -16,10 +16,12 @@ func TestResolveStaticCall(t *testing.T) { stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ - &ast.StmtUseList{ - Uses: []ast.Vertex{ - &ast.StmtUse{ - Use: nameAB, + &ast.StmtUse{ + UseList: &ast.StmtUseList{ + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Use: nameAB, + }, }, }, }, @@ -48,10 +50,12 @@ func TestResolveStaticPropertyFetch(t *testing.T) { stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ - &ast.StmtUseList{ - Uses: []ast.Vertex{ - &ast.StmtUse{ - Use: nameAB, + &ast.StmtUse{ + UseList: &ast.StmtUseList{ + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Use: nameAB, + }, }, }, }, @@ -79,10 +83,12 @@ func TestResolveClassConstFetch(t *testing.T) { stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ - &ast.StmtUseList{ - Uses: []ast.Vertex{ - &ast.StmtUse{ - Use: nameAB, + &ast.StmtUse{ + UseList: &ast.StmtUseList{ + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Use: nameAB, + }, }, }, }, @@ -110,10 +116,12 @@ func TestResolveNew(t *testing.T) { stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ - &ast.StmtUseList{ - Uses: []ast.Vertex{ - &ast.StmtUse{ - Use: nameAB, + &ast.StmtUse{ + UseList: &ast.StmtUseList{ + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Use: nameAB, + }, }, }, }, @@ -141,10 +149,12 @@ func TestResolveInstanceOf(t *testing.T) { stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ - &ast.StmtUseList{ - Uses: []ast.Vertex{ - &ast.StmtUse{ - Use: nameAB, + &ast.StmtUse{ + UseList: &ast.StmtUseList{ + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Use: nameAB, + }, }, }, }, @@ -175,14 +185,15 @@ func TestResolveInstanceCatch(t *testing.T) { stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ - &ast.StmtUseList{ - Uses: []ast.Vertex{ - &ast.StmtUse{ - Use: nameAB, - }, - &ast.StmtUse{ - Use: nameDE, - Alias: &ast.Identifier{Value: []byte("F")}, + &ast.StmtUse{ + UseList: &ast.StmtUseList{ + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Use: nameAB, + }, &ast.StmtUseDeclaration{ + Use: nameDE, + Alias: &ast.Identifier{Value: []byte("F")}, + }, }, }, }, @@ -220,11 +231,15 @@ func TestResolveFunctionCall(t *testing.T) { stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ - &ast.StmtUseList{ - UseType: &ast.Identifier{Value: []byte("function")}, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Use: nameAB, + &ast.StmtUse{ + UseList: &ast.StmtUseType{ + Type: &ast.Identifier{Value: []byte("function")}, + Use: &ast.StmtUseList{ + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Use: nameAB, + }, + }, }, }, }, @@ -252,11 +267,15 @@ func TestResolveConstFetch(t *testing.T) { stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ - &ast.StmtUseList{ - UseType: &ast.Identifier{Value: []byte("const")}, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Use: nameAB, + &ast.StmtUse{ + UseList: &ast.StmtUseType{ + Type: &ast.Identifier{Value: []byte("const")}, + Use: &ast.StmtUseList{ + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Use: nameAB, + }, + }, }, }, }, @@ -286,25 +305,39 @@ func TestResolveGroupUse(t *testing.T) { stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ - &ast.StmtGroupUse{ - Prefix: nameAB, - UseList: []ast.Vertex{ - &ast.StmtUse{ - UseType: &ast.Identifier{Value: []byte("Function")}, - Use: nameF, - }, - &ast.StmtUse{ - UseType: &ast.Identifier{Value: []byte("const")}, - Use: nameC, + &ast.StmtUse{ + UseList: &ast.StmtGroupUseList{ + Prefix: nameAB, + UseList: &ast.StmtUseList{ + UseDeclarations: []ast.Vertex{ + &ast.StmtUseType{ + Type: &ast.Identifier{Value: []byte("Function")}, + Use: &ast.StmtUseDeclaration{ + Use: nameF, + }, + }, + &ast.StmtUseType{ + Type: &ast.Identifier{Value: []byte("const")}, + Use: &ast.StmtUseDeclaration{ + Use: nameC, + }, + }, + }, }, }, }, - &ast.StmtGroupUse{ - Prefix: nameBD, - UseType: &ast.Identifier{Value: []byte("Function")}, - UseList: []ast.Vertex{ - &ast.StmtUse{ - Use: nameE, + &ast.StmtUse{ + UseList: &ast.StmtUseType{ + Type: &ast.Identifier{Value: []byte("Function")}, + Use: &ast.StmtGroupUseList{ + Prefix: nameBD, + UseList: &ast.StmtUseList{ + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Use: nameE, + }, + }, + }, }, }, }, @@ -347,10 +380,12 @@ func TestResolveTraitUse(t *testing.T) { stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ - &ast.StmtUseList{ - Uses: []ast.Vertex{ - &ast.StmtUse{ - Use: nameAB, + &ast.StmtUse{ + UseList: &ast.StmtUseList{ + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Use: nameAB, + }, }, }, }, @@ -668,10 +703,12 @@ func TestResolveNamespaces(t *testing.T) { &ast.StmtNamespace{ NamespaceName: namespaceCD, Stmts: []ast.Vertex{ - &ast.StmtUseList{ - Uses: []ast.Vertex{ - &ast.StmtUse{ - Use: nameAC, + &ast.StmtUse{ + UseList: &ast.StmtUseList{ + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Use: nameAC, + }, }, }, }, diff --git a/pkg/ast/visitor/null.go b/pkg/ast/visitor/null.go index 6fd6261..e291500 100644 --- a/pkg/ast/visitor/null.go +++ b/pkg/ast/visitor/null.go @@ -182,10 +182,6 @@ func (v *Null) StmtGoto(_ *ast.StmtGoto) { // do nothing } -func (v *Null) StmtGroupUse(_ *ast.StmtGroupUse) { - // do nothing -} - func (v *Null) StmtHaltCompiler(_ *ast.StmtHaltCompiler) { // do nothing } @@ -286,10 +282,22 @@ func (v *Null) StmtUse(_ *ast.StmtUse) { // do nothing } +func (v *Null) StmtGroupUseList(_ *ast.StmtGroupUseList) { + // do nothing +} + func (v *Null) StmtUseList(_ *ast.StmtUseList) { // do nothing } +func (v *Null) StmtUseDeclaration(_ *ast.StmtUseDeclaration) { + // do nothing +} + +func (v *Null) StmtUseType(_ *ast.StmtUseType) { + // do nothing +} + func (v *Null) StmtWhile(_ *ast.StmtWhile) { // do nothing } diff --git a/pkg/printer/pretty_printer.go b/pkg/printer/pretty_printer.go index 0948cdd..71a89a8 100644 --- a/pkg/printer/pretty_printer.go +++ b/pkg/printer/pretty_printer.go @@ -353,8 +353,6 @@ func (p *PrettyPrinter) printNode(n ast.Vertex) { p.printStmtGlobal(n) case *ast.StmtGoto: p.printStmtGoto(n) - case *ast.StmtGroupUse: - p.printStmtGroupUse(n) case *ast.StmtHaltCompiler: p.printStmtHaltCompiler(n) case *ast.StmtIf: @@ -399,10 +397,16 @@ func (p *PrettyPrinter) printNode(n ast.Vertex) { p.printStmtTry(n) case *ast.StmtUnset: p.printStmtUnset(n) - case *ast.StmtUseList: - p.printStmtUseList(n) case *ast.StmtUse: p.printStmtUse(n) + case *ast.StmtGroupUseList: + p.printStmtGroupUseList(n) + case *ast.StmtUseList: + p.printStmtUseList(n) + case *ast.StmtUseDeclaration: + p.printStmtUseDeclaration(n) + case *ast.StmtUseType: + p.printStmtUseType(n) case *ast.StmtWhile: p.printStmtWhile(n) } @@ -1847,22 +1851,6 @@ func (p *PrettyPrinter) printStmtGoto(n ast.Vertex) { io.WriteString(p.w, ";") } -func (p *PrettyPrinter) printStmtGroupUse(n ast.Vertex) { - nn := n.(*ast.StmtGroupUse) - - io.WriteString(p.w, "use ") - - if nn.UseType != nil { - p.Print(nn.UseType) - io.WriteString(p.w, " ") - } - - p.Print(nn.Prefix) - io.WriteString(p.w, "\\{") - p.joinPrint(", ", nn.UseList) - io.WriteString(p.w, "};") -} - func (p *PrettyPrinter) printStmtHaltCompiler(n ast.Vertex) { io.WriteString(p.w, "__halt_compiler();") } @@ -2146,27 +2134,34 @@ func (p *PrettyPrinter) printStmtUnset(n ast.Vertex) { io.WriteString(p.w, ");") } -func (p *PrettyPrinter) printStmtUseList(n ast.Vertex) { - nn := n.(*ast.StmtUseList) - - io.WriteString(p.w, "use ") - - if nn.UseType != nil { - p.Print(nn.UseType) - io.WriteString(p.w, " ") - } - - p.joinPrint(", ", nn.Uses) - io.WriteString(p.w, ";") -} - func (p *PrettyPrinter) printStmtUse(n ast.Vertex) { nn := n.(*ast.StmtUse) - if nn.UseType != nil { - p.Print(nn.UseType) - io.WriteString(p.w, " ") - } + io.WriteString(p.w, "use ") + + p.Print(nn.UseList) + + io.WriteString(p.w, ";") +} + +func (p *PrettyPrinter) printStmtGroupUseList(n ast.Vertex) { + nn := n.(*ast.StmtGroupUseList) + + p.Print(nn.Prefix) + + io.WriteString(p.w, "\\{") + p.Print(nn.UseList) + io.WriteString(p.w, "}") +} + +func (p *PrettyPrinter) printStmtUseList(n ast.Vertex) { + nn := n.(*ast.StmtUseList) + + p.joinPrint(", ", nn.UseDeclarations) +} + +func (p *PrettyPrinter) printStmtUseDeclaration(n ast.Vertex) { + nn := n.(*ast.StmtUseDeclaration) p.Print(nn.Use) @@ -2176,6 +2171,15 @@ func (p *PrettyPrinter) printStmtUse(n ast.Vertex) { } } +func (p *PrettyPrinter) printStmtUseType(n ast.Vertex) { + nn := n.(*ast.StmtUseType) + + p.Print(nn.Type) + io.WriteString(p.w, " ") + + p.Print(nn.Use) +} + func (p *PrettyPrinter) printStmtWhile(n ast.Vertex) { nn := n.(*ast.StmtWhile) diff --git a/pkg/printer/pretty_printer_test.go b/pkg/printer/pretty_printer_test.go index dd20c5d..72f4988 100644 --- a/pkg/printer/pretty_printer_test.go +++ b/pkg/printer/pretty_printer_test.go @@ -3256,32 +3256,6 @@ func TestPrintStmtGoto(t *testing.T) { } } -func TestPrintStmtGroupUse(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtGroupUse{ - UseType: &ast.Identifier{Value: []byte("function")}, - Prefix: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, - UseList: []ast.Vertex{ - &ast.StmtUse{ - Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Bar")}}}, - Alias: &ast.Identifier{Value: []byte("Baz")}, - }, - &ast.StmtUse{ - Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Quuz")}}}, - }, - }, - }) - - expected := `use function Foo\{Bar as Baz, Quuz};` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - func TestPrintHaltCompiler(t *testing.T) { o := bytes.NewBufferString("") @@ -3975,24 +3949,15 @@ func TestPrintStmtUset(t *testing.T) { } } -func TestPrintStmtUseList(t *testing.T) { +func TestPrintUse(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtUseList{ - UseType: &ast.Identifier{Value: []byte("function")}, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, - Alias: &ast.Identifier{Value: []byte("Bar")}, - }, - &ast.StmtUse{ - Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Baz")}}}, - }, - }, + p.Print(&ast.StmtUse{ + UseList: &ast.StmtUseList{}, }) - expected := `use function Foo as Bar, Baz;` + expected := `use ;` actual := o.String() if expected != actual { @@ -4000,14 +3965,74 @@ func TestPrintStmtUseList(t *testing.T) { } } -func TestPrintUse(t *testing.T) { +func TestPrintStmtGroupUseList(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtUse{ - UseType: &ast.Identifier{Value: []byte("function")}, - Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, - Alias: &ast.Identifier{Value: []byte("Bar")}, + p.Print(&ast.StmtGroupUseList{ + Prefix: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + UseList: &ast.StmtUseList{}, + }) + + expected := `Foo\{}` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtUseList(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&ast.StmtUseList{ + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Alias: &ast.Identifier{Value: []byte("Bar")}, + }, + &ast.StmtUseDeclaration{ + Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Baz")}}}, + }, + }, + }) + + expected := `Foo as Bar, Baz` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintUseDeclaration(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&ast.StmtUseDeclaration{ + Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Alias: &ast.Identifier{Value: []byte("Bar")}, + }) + + expected := `Foo as Bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintUseType(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&ast.StmtUseType{ + Type: &ast.Identifier{Value: []byte("function")}, + Use: &ast.StmtUseDeclaration{ + Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Alias: &ast.Identifier{Value: []byte("Bar")}, + }, }) expected := `function Foo as Bar` diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index 47a82fb..4eff938 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -16,8 +16,10 @@ const ( ) type Printer struct { - w io.Writer - s printerState + w io.Writer + s printerState + bufStart string + bufEnd string } // NewPrinter - Constructor for Printer @@ -60,6 +62,21 @@ func (p *Printer) printNodes(nn []ast.Vertex) { } } +func (p *Printer) printFreeFloatingOrDefault(n ast.Vertex, pos token.Position, def string) { + if n == nil { + return + } + + if len(n.GetNode().Tokens[pos]) == 0 { + io.WriteString(p.w, def) + return + } + + for _, m := range n.GetNode().Tokens[pos] { + io.WriteString(p.w, string(m.Value)) + } +} + func (p *Printer) printFreeFloating(n ast.Vertex, pos token.Position) { if n == nil { return @@ -374,8 +391,6 @@ func (p *Printer) printNode(n ast.Vertex) { p.printStmtGlobal(n) case *ast.StmtGoto: p.printStmtGoto(n) - case *ast.StmtGroupUse: - p.printStmtGroupUse(n) case *ast.StmtHaltCompiler: p.printStmtHaltCompiler(n) case *ast.StmtIf: @@ -422,10 +437,16 @@ func (p *Printer) printNode(n ast.Vertex) { p.printStmtTry(n) case *ast.StmtUnset: p.printStmtUnset(n) - case *ast.StmtUseList: - p.printStmtUseList(n) case *ast.StmtUse: p.printStmtUse(n) + case *ast.StmtGroupUseList: + p.printStmtGroupUseList(n) + case *ast.StmtUseList: + p.printStmtUseList(n) + case *ast.StmtUseDeclaration: + p.printStmtUseDeclaration(n) + case *ast.StmtUseType: + p.printStmtUseType(n) case *ast.StmtWhile: p.printStmtWhile(n) } @@ -443,8 +464,11 @@ func (p *Printer) printNodeRoot(n ast.Vertex) { func (p *Printer) printNodeIdentifier(n ast.Vertex) { nn := n.(*ast.Identifier) - p.printFreeFloating(nn, token.Start) + p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) + p.bufStart = "" + io.WriteString(p.w, string(nn.Value)) + p.printFreeFloating(nn, token.End) } @@ -519,7 +543,8 @@ func (p *Printer) printNodeArgument(n ast.Vertex) { func (p *Printer) printNameNamePart(n ast.Vertex) { nn := n.(*ast.NameNamePart) - p.printFreeFloating(nn, token.Start) + p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) + p.bufStart = "" io.WriteString(p.w, string(nn.Value)) @@ -532,22 +557,26 @@ func (p *Printer) printNameName(n ast.Vertex) { p.joinPrint("\\", nn.Parts) - p.printFreeFloating(nn, token.End) + p.printFreeFloatingOrDefault(nn, token.End, p.bufEnd) + p.bufEnd = "" } func (p *Printer) printNameFullyQualified(n ast.Vertex) { nn := n.(*ast.NameFullyQualified) - p.printFreeFloating(nn, token.Start) + p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) + p.bufStart = "" io.WriteString(p.w, "\\") p.joinPrint("\\", nn.Parts) - p.printFreeFloating(nn, token.End) + p.printFreeFloatingOrDefault(nn, token.End, p.bufEnd) + p.bufEnd = "" } func (p *Printer) printNameRelative(n ast.Vertex) { nn := n.(*ast.NameRelative) - p.printFreeFloating(nn, token.Start) + p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) + p.bufStart = "" io.WriteString(p.w, "namespace") p.printFreeFloating(nn, token.Namespace) @@ -557,7 +586,8 @@ func (p *Printer) printNameRelative(n ast.Vertex) { p.Print(part) } - p.printFreeFloating(nn, token.End) + p.printFreeFloatingOrDefault(nn, token.End, p.bufEnd) + p.bufEnd = "" } // scalar @@ -2710,41 +2740,6 @@ func (p *Printer) printStmtGoto(n ast.Vertex) { p.printFreeFloating(nn, token.End) } -func (p *Printer) printStmtGroupUse(n ast.Vertex) { - nn := n.(*ast.StmtGroupUse) - p.printFreeFloating(nn, token.Start) - - io.WriteString(p.w, "use") - p.printFreeFloating(nn, token.Use) - - if nn.UseType != nil { - if nn.UseType.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.UseType) - } - - if nn.Prefix.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.Prefix) - io.WriteString(p.w, "\\") - p.printFreeFloating(nn, token.Slash) - - io.WriteString(p.w, "{") - p.joinPrint(",", nn.UseList) - p.printFreeFloating(nn, token.Stmts) - io.WriteString(p.w, "}") - p.printFreeFloating(nn, token.UseDeclarationList) - - p.printFreeFloating(nn, token.SemiColon) - if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, token.End) -} - func (p *Printer) printStmtHaltCompiler(n ast.Vertex) { nn := n.(*ast.StmtHaltCompiler) p.printFreeFloating(nn, token.Start) @@ -3197,59 +3192,78 @@ func (p *Printer) printStmtUnset(n ast.Vertex) { p.printFreeFloating(nn, token.End) } -func (p *Printer) printStmtUseList(n ast.Vertex) { - nn := n.(*ast.StmtUseList) +func (p *Printer) printStmtUse(n ast.Vertex) { + nn := n.(*ast.StmtUse) p.printFreeFloating(nn, token.Start) io.WriteString(p.w, "use") - if nn.UseType != nil { - if nn.UseType.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.UseType) + p.bufStart = " " + p.Print(nn.UseList) + + p.printFreeFloatingOrDefault(nn, token.End, ";") +} + +func (p *Printer) printStmtGroupUseList(n ast.Vertex) { + nn := n.(*ast.StmtGroupUseList) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Prefix) + + p.bufStart = "\\{" + p.bufEnd = "}" + p.Print(nn.UseList) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtUseList(n ast.Vertex) { + nn := n.(*ast.StmtUseList) + + bufEnd := p.bufEnd + p.bufEnd = "" + + if p.bufStart == "\\{" { + p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) + p.bufStart = "" + } else { + p.printFreeFloating(nn, token.Start) } - if nn.Uses[0].GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") - } - p.joinPrint(",", nn.Uses) - p.printFreeFloating(nn, token.UseDeclarationList) + p.joinPrint(",", nn.UseDeclarations) - p.printFreeFloating(nn, token.SemiColon) - if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, ";") + p.printFreeFloatingOrDefault(nn, token.End, bufEnd) +} + +func (p *Printer) printStmtUseDeclaration(n ast.Vertex) { + nn := n.(*ast.StmtUseDeclaration) + p.printFreeFloating(nn, token.Start) + + if nn.Alias != nil { + p.bufEnd = " " + } + + p.Print(nn.Use) + + if nn.Alias != nil { + io.WriteString(p.w, "as") + + p.bufStart = " " + p.Print(nn.Alias) } p.printFreeFloating(nn, token.End) } -func (p *Printer) printStmtUse(n ast.Vertex) { - nn := n.(*ast.StmtUse) +func (p *Printer) printStmtUseType(n ast.Vertex) { + nn := n.(*ast.StmtUseType) p.printFreeFloating(nn, token.Start) - if nn.UseType != nil { - p.Print(nn.UseType) - if nn.UseType.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") - } - } - - p.printFreeFloating(nn, token.Slash) + p.Print(nn.Type) + p.bufStart = " " p.Print(nn.Use) - if nn.Alias != nil { - if nn.Alias.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") - } - io.WriteString(p.w, "as") - if nn.Alias.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.Alias) - } - p.printFreeFloating(nn, token.End) } diff --git a/pkg/printer/printer_test.go b/pkg/printer/printer_test.go index c7a8303..8e85ac0 100644 --- a/pkg/printer/printer_test.go +++ b/pkg/printer/printer_test.go @@ -3673,32 +3673,6 @@ func TestPrinterPrintStmtGoto(t *testing.T) { } } -func TestPrinterPrintStmtGroupUse(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrinter(o) - p.Print(&ast.StmtGroupUse{ - UseType: &ast.Identifier{Value: []byte("function")}, - Prefix: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, - UseList: []ast.Vertex{ - &ast.StmtUse{ - Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Bar")}}}, - Alias: &ast.Identifier{Value: []byte("Baz")}, - }, - &ast.StmtUse{ - Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Quuz")}}}, - }, - }, - }) - - expected := `use function Foo\{Bar as Baz,Quuz};` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - func TestPrinterPrintHaltCompiler(t *testing.T) { o := bytes.NewBufferString("") @@ -4412,24 +4386,21 @@ func TestPrinterPrintStmtUnset(t *testing.T) { } } -func TestPrinterPrintStmtUseList(t *testing.T) { +func TestPrinterPrintUse(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&ast.StmtUseList{ - UseType: &ast.Identifier{Value: []byte("function")}, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, - Alias: &ast.Identifier{Value: []byte("Bar")}, - }, - &ast.StmtUse{ - Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Baz")}}}, + p.Print(&ast.StmtUse{ + UseList: &ast.StmtUseList{ + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + }, }, }, }) - expected := `use function Foo as Bar,Baz;` + expected := `use Foo;` actual := o.String() if expected != actual { @@ -4437,14 +4408,74 @@ func TestPrinterPrintStmtUseList(t *testing.T) { } } -func TestPrinterPrintUse(t *testing.T) { +func TestPrinterPrintStmtGroupUseList(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&ast.StmtUse{ - UseType: &ast.Identifier{Value: []byte("function")}, - Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, - Alias: &ast.Identifier{Value: []byte("Bar")}, + p.Print(&ast.StmtGroupUseList{ + Prefix: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + UseList: &ast.StmtUseList{}, + }) + + expected := `Foo\{}` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrinterPrintStmtUseList(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrinter(o) + p.Print(&ast.StmtUseList{ + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Alias: &ast.Identifier{Value: []byte("Bar")}, + }, + &ast.StmtUseDeclaration{ + Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Baz")}}}, + }, + }, + }) + + expected := `Foo as Bar,Baz` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrinterPrintUseDeclaration(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrinter(o) + p.Print(&ast.StmtUseDeclaration{ + Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Alias: &ast.Identifier{Value: []byte("Bar")}, + }) + + expected := `Foo as Bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrinterPrintUseType(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrinter(o) + p.Print(&ast.StmtUseType{ + Type: &ast.Identifier{Value: []byte("function")}, + Use: &ast.StmtUseDeclaration{ + Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Alias: &ast.Identifier{Value: []byte("Bar")}, + }, }) expected := `function Foo as Bar` diff --git a/pkg/token/position.go b/pkg/token/position.go index 7032e5a..1a3b02d 100644 --- a/pkg/token/position.go +++ b/pkg/token/position.go @@ -6,7 +6,6 @@ type Position int const ( Start Position = iota End - Slash Colon SemiColon AltEnd diff --git a/pkg/token/position_string.go b/pkg/token/position_string.go index cc51fe2..a2f713a 100644 --- a/pkg/token/position_string.go +++ b/pkg/token/position_string.go @@ -10,85 +10,84 @@ func _() { var x [1]struct{} _ = x[Start-0] _ = x[End-1] - _ = x[Slash-2] - _ = x[Colon-3] - _ = x[SemiColon-4] - _ = x[AltEnd-5] - _ = x[Dollar-6] - _ = x[Ampersand-7] - _ = x[Name-8] - _ = x[Prefix-9] - _ = x[Key-10] - _ = x[Var-11] - _ = x[UseType-12] - _ = x[ReturnType-13] - _ = x[OptionalType-14] - _ = x[CaseSeparator-15] - _ = x[LexicalVars-16] - _ = x[Params-17] - _ = x[Ref-18] - _ = x[Cast-19] - _ = x[Expr-20] - _ = x[InitExpr-21] - _ = x[CondExpr-22] - _ = x[IncExpr-23] - _ = x[True-24] - _ = x[Cond-25] - _ = x[HaltCompiller-26] - _ = x[Namespace-27] - _ = x[Static-28] - _ = x[Class-29] - _ = x[Use-30] - _ = x[While-31] - _ = x[For-32] - _ = x[Switch-33] - _ = x[Break-34] - _ = x[Foreach-35] - _ = x[Declare-36] - _ = x[Label-37] - _ = x[Finally-38] - _ = x[List-39] - _ = x[Default-40] - _ = x[If-41] - _ = x[ElseIf-42] - _ = x[Else-43] - _ = x[Variadic-44] - _ = x[Function-45] - _ = x[DoubleArrow-46] - _ = x[Alias-47] - _ = x[As-48] - _ = x[Equal-49] - _ = x[Exit-50] - _ = x[Array-51] - _ = x[Isset-52] - _ = x[Empty-53] - _ = x[Eval-54] - _ = x[Echo-55] - _ = x[Try-56] - _ = x[Catch-57] - _ = x[Unset-58] - _ = x[Stmts-59] - _ = x[VarList-60] - _ = x[ConstList-61] - _ = x[NameList-62] - _ = x[ParamList-63] - _ = x[ModifierList-64] - _ = x[ArrayPairList-65] - _ = x[CaseListStart-66] - _ = x[CaseListEnd-67] - _ = x[ArgumentList-68] - _ = x[PropertyList-69] - _ = x[ParameterList-70] - _ = x[AdaptationList-71] - _ = x[LexicalVarList-72] - _ = x[UseDeclarationList-73] - _ = x[OpenParenthesisToken-74] - _ = x[CloseParenthesisToken-75] + _ = x[Colon-2] + _ = x[SemiColon-3] + _ = x[AltEnd-4] + _ = x[Dollar-5] + _ = x[Ampersand-6] + _ = x[Name-7] + _ = x[Prefix-8] + _ = x[Key-9] + _ = x[Var-10] + _ = x[UseType-11] + _ = x[ReturnType-12] + _ = x[OptionalType-13] + _ = x[CaseSeparator-14] + _ = x[LexicalVars-15] + _ = x[Params-16] + _ = x[Ref-17] + _ = x[Cast-18] + _ = x[Expr-19] + _ = x[InitExpr-20] + _ = x[CondExpr-21] + _ = x[IncExpr-22] + _ = x[True-23] + _ = x[Cond-24] + _ = x[HaltCompiller-25] + _ = x[Namespace-26] + _ = x[Static-27] + _ = x[Class-28] + _ = x[Use-29] + _ = x[While-30] + _ = x[For-31] + _ = x[Switch-32] + _ = x[Break-33] + _ = x[Foreach-34] + _ = x[Declare-35] + _ = x[Label-36] + _ = x[Finally-37] + _ = x[List-38] + _ = x[Default-39] + _ = x[If-40] + _ = x[ElseIf-41] + _ = x[Else-42] + _ = x[Variadic-43] + _ = x[Function-44] + _ = x[DoubleArrow-45] + _ = x[Alias-46] + _ = x[As-47] + _ = x[Equal-48] + _ = x[Exit-49] + _ = x[Array-50] + _ = x[Isset-51] + _ = x[Empty-52] + _ = x[Eval-53] + _ = x[Echo-54] + _ = x[Try-55] + _ = x[Catch-56] + _ = x[Unset-57] + _ = x[Stmts-58] + _ = x[VarList-59] + _ = x[ConstList-60] + _ = x[NameList-61] + _ = x[ParamList-62] + _ = x[ModifierList-63] + _ = x[ArrayPairList-64] + _ = x[CaseListStart-65] + _ = x[CaseListEnd-66] + _ = x[ArgumentList-67] + _ = x[PropertyList-68] + _ = x[ParameterList-69] + _ = x[AdaptationList-70] + _ = x[LexicalVarList-71] + _ = x[UseDeclarationList-72] + _ = x[OpenParenthesisToken-73] + _ = x[CloseParenthesisToken-74] } -const _Position_name = "StartEndSlashColonSemiColonAltEndDollarAmpersandNamePrefixKeyVarUseTypeReturnTypeOptionalTypeCaseSeparatorLexicalVarsParamsRefCastExprInitExprCondExprIncExprTrueCondHaltCompillerNamespaceStaticClassUseWhileForSwitchBreakForeachDeclareLabelFinallyListDefaultIfElseIfElseVariadicFunctionDoubleArrowAliasAsEqualExitArrayIssetEmptyEvalEchoTryCatchUnsetStmtsVarListConstListNameListParamListModifierListArrayPairListCaseListStartCaseListEndArgumentListPropertyListParameterListAdaptationListLexicalVarListUseDeclarationListOpenParenthesisTokenCloseParenthesisToken" +const _Position_name = "StartEndColonSemiColonAltEndDollarAmpersandNamePrefixKeyVarUseTypeReturnTypeOptionalTypeCaseSeparatorLexicalVarsParamsRefCastExprInitExprCondExprIncExprTrueCondHaltCompillerNamespaceStaticClassUseWhileForSwitchBreakForeachDeclareLabelFinallyListDefaultIfElseIfElseVariadicFunctionDoubleArrowAliasAsEqualExitArrayIssetEmptyEvalEchoTryCatchUnsetStmtsVarListConstListNameListParamListModifierListArrayPairListCaseListStartCaseListEndArgumentListPropertyListParameterListAdaptationListLexicalVarListUseDeclarationListOpenParenthesisTokenCloseParenthesisToken" -var _Position_index = [...]uint16{0, 5, 8, 13, 18, 27, 33, 39, 48, 52, 58, 61, 64, 71, 81, 93, 106, 117, 123, 126, 130, 134, 142, 150, 157, 161, 165, 178, 187, 193, 198, 201, 206, 209, 215, 220, 227, 234, 239, 246, 250, 257, 259, 265, 269, 277, 285, 296, 301, 303, 308, 312, 317, 322, 327, 331, 335, 338, 343, 348, 353, 360, 369, 377, 386, 398, 411, 424, 435, 447, 459, 472, 486, 500, 518, 538, 559} +var _Position_index = [...]uint16{0, 5, 8, 13, 22, 28, 34, 43, 47, 53, 56, 59, 66, 76, 88, 101, 112, 118, 121, 125, 129, 137, 145, 152, 156, 160, 173, 182, 188, 193, 196, 201, 204, 210, 215, 222, 229, 234, 241, 245, 252, 254, 260, 264, 272, 280, 291, 296, 298, 303, 307, 312, 317, 322, 326, 330, 333, 338, 343, 348, 355, 364, 372, 381, 393, 406, 419, 430, 442, 454, 467, 481, 495, 513, 533, 554} func (i Position) String() string { if i < 0 || i >= Position(len(_Position_index)-1) {