rename meta to freefloating; refactoring
This commit is contained in:
1522
printer/printer.go
1522
printer/printer.go
File diff suppressed because it is too large
Load Diff
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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"},
|
||||
|
||||
Reference in New Issue
Block a user