rename meta to freefloating; refactoring

This commit is contained in:
z7zmey
2019-02-13 22:18:07 +02:00
parent a7082117d9
commit b3800a2595
309 changed files with 9671 additions and 10115 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -463,9 +463,11 @@ func TestParseAndPrintPhp5Exit(t *testing.T) {
src := `<?php
exit ;
exit ( ) ;
exit (1) ;
exit ( 1 ) ;
die ;
die ( ) ;
die (1) ;
die ( 1 ) ;
`
@@ -1152,10 +1154,15 @@ func TestParseAndPrintPhp5Return(t *testing.T) {
}
}
function baz ( )
function foo ( )
{
return $a ;
}
function bar ( )
{
return ;
}
`
actual := printPhp5(parsePhp5(src))

View File

@@ -533,9 +533,11 @@ func TestParseAndPrintExit(t *testing.T) {
src := `<?php
exit ;
exit ( ) ;
exit (1) ;
exit ( 1 );
die ;
die ( ) ;
die (1) ;
die ( 1 );
`
@@ -1261,10 +1263,15 @@ func TestParseAndPrintReturn(t *testing.T) {
}
}
function baz ( )
function foo ( )
{
return $a ;
}
function bar ( )
{
return ;
}
`
actual := print(parse(src))

View File

@@ -4,8 +4,7 @@ import (
"bytes"
"testing"
"github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/node/expr"
"github.com/z7zmey/php-parser/node/expr/assign"
@@ -80,11 +79,12 @@ func TestPrinterPrintFileInlineHtml(t *testing.T) {
&stmt.InlineHtml{Value: "<div>HTML</div>"},
&stmt.Expression{
Expr: &expr.Variable{
Meta: meta.Collection{
&meta.Data{
Type: meta.TokenType,
Value: "$",
TokenName: meta.NodeStart,
FreeFloating: freefloating.Collection{
freefloating.Start: []freefloating.String{
{
StringType: freefloating.TokenType,
Value: "$",
},
},
},
VarName: &node.Identifier{
@@ -95,11 +95,12 @@ func TestPrinterPrintFileInlineHtml(t *testing.T) {
&stmt.InlineHtml{Value: "<div>HTML</div>"},
&stmt.Expression{
Expr: &expr.Variable{
Meta: meta.Collection{
&meta.Data{
Type: meta.TokenType,
Value: "$",
TokenName: meta.NodeStart,
FreeFloating: freefloating.Collection{
freefloating.Start: []freefloating.String{
{
StringType: freefloating.TokenType,
Value: "$",
},
},
},
VarName: &node.Identifier{
@@ -3901,11 +3902,12 @@ func TestPrinterPrintProperty(t *testing.T) {
p := printer.NewPrinter(o)
p.Print(&stmt.Property{
Variable: &expr.Variable{
Meta: meta.Collection{
&meta.Data{
Type: meta.TokenType,
Value: "$",
TokenName: meta.NodeStart,
FreeFloating: freefloating.Collection{
freefloating.Start: []freefloating.String{
{
StringType: freefloating.TokenType,
Value: "$",
},
},
},
VarName: &node.Identifier{Value: "a"},