rename flag -meta to -ff
This commit is contained in:
parent
37c9c2092f
commit
a7229f53dd
8
main.go
8
main.go
@ -25,7 +25,7 @@ var wg sync.WaitGroup
|
|||||||
var usePhp5 *bool
|
var usePhp5 *bool
|
||||||
var dumpType string
|
var dumpType string
|
||||||
var profiler string
|
var profiler string
|
||||||
var withMeta *bool
|
var withFreeFloating *bool
|
||||||
var showResolvedNs *bool
|
var showResolvedNs *bool
|
||||||
var printBack *bool
|
var printBack *bool
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ type file struct {
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
usePhp5 = flag.Bool("php5", false, "parse as PHP5")
|
usePhp5 = flag.Bool("php5", false, "parse as PHP5")
|
||||||
withMeta = flag.Bool("meta", false, "show meta")
|
withFreeFloating = flag.Bool("ff", false, "parse and show free floating strings")
|
||||||
showResolvedNs = flag.Bool("r", false, "resolve names")
|
showResolvedNs = flag.Bool("r", false, "resolve names")
|
||||||
printBack = flag.Bool("pb", false, "print AST back into the parsed file")
|
printBack = flag.Bool("pb", false, "print AST back into the parsed file")
|
||||||
flag.StringVar(&dumpType, "d", "", "dump format: [custom, go, json, pretty_json]")
|
flag.StringVar(&dumpType, "d", "", "dump format: [custom, go, json, pretty_json]")
|
||||||
@ -110,8 +110,8 @@ func parserWorker(fileCh <-chan *file, result chan<- parser.Parser) {
|
|||||||
parserWorker = php7.NewParser(src, f.path)
|
parserWorker = php7.NewParser(src, f.path)
|
||||||
}
|
}
|
||||||
|
|
||||||
if *withMeta {
|
if *withFreeFloating {
|
||||||
parserWorker.WithMeta()
|
parserWorker.WithFreeFloating()
|
||||||
}
|
}
|
||||||
|
|
||||||
parserWorker.Parse()
|
parserWorker.Parse()
|
||||||
|
@ -11,5 +11,5 @@ type Parser interface {
|
|||||||
GetPath() string
|
GetPath() string
|
||||||
GetRootNode() node.Node
|
GetRootNode() node.Node
|
||||||
GetErrors() []*errors.Error
|
GetErrors() []*errors.Error
|
||||||
WithMeta()
|
WithFreeFloating()
|
||||||
}
|
}
|
||||||
|
@ -57,8 +57,8 @@ func (l *Parser) Error(msg string) {
|
|||||||
l.Lexer.Errors = append(l.Lexer.Errors, errors.NewError(msg, pos))
|
l.Lexer.Errors = append(l.Lexer.Errors, errors.NewError(msg, pos))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l *Parser) WithMeta() {
|
func (l *Parser) WithFreeFloating() {
|
||||||
l.Lexer.WithMeta = true
|
l.Lexer.WithFreeFloating = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse the php7 Parser entrypoint
|
// Parse the php7 Parser entrypoint
|
||||||
@ -106,7 +106,7 @@ func isDollar(r rune) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (l *Parser) MoveFreeFloating(src node.Node, dst node.Node) {
|
func (l *Parser) MoveFreeFloating(src node.Node, dst node.Node) {
|
||||||
if l.Lexer.WithMeta == false {
|
if l.Lexer.WithFreeFloating == false {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ func (l *Parser) MoveFreeFloating(src node.Node, dst node.Node) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (l *Parser) setFreeFloating(dst node.Node, p freefloating.Position, strings []freefloating.String) {
|
func (l *Parser) setFreeFloating(dst node.Node, p freefloating.Position, strings []freefloating.String) {
|
||||||
if l.Lexer.WithMeta == false {
|
if l.Lexer.WithFreeFloating == false {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -136,7 +136,7 @@ func (l *Parser) setFreeFloating(dst node.Node, p freefloating.Position, strings
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (l *Parser) GetFreeFloatingToken(t *scanner.Token) []freefloating.String {
|
func (l *Parser) GetFreeFloatingToken(t *scanner.Token) []freefloating.String {
|
||||||
if l.Lexer.WithMeta == false {
|
if l.Lexer.WithFreeFloating == false {
|
||||||
return []freefloating.String{}
|
return []freefloating.String{}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,7 +144,7 @@ func (l *Parser) GetFreeFloatingToken(t *scanner.Token) []freefloating.String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (l *Parser) addDollarToken(v node.Node) {
|
func (l *Parser) addDollarToken(v node.Node) {
|
||||||
if l.Lexer.WithMeta == false {
|
if l.Lexer.WithFreeFloating == false {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,7 +163,7 @@ func (l *Parser) addDollarToken(v node.Node) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (l *Parser) splitSemiColonAndPhpCloseTag(htmlNode node.Node, prevNode node.Node) {
|
func (l *Parser) splitSemiColonAndPhpCloseTag(htmlNode node.Node, prevNode node.Node) {
|
||||||
if l.Lexer.WithMeta == false {
|
if l.Lexer.WithFreeFloating == false {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,8 +56,8 @@ func (l *Parser) Error(msg string) {
|
|||||||
l.Lexer.Errors = append(l.Lexer.Errors, errors.NewError(msg, pos))
|
l.Lexer.Errors = append(l.Lexer.Errors, errors.NewError(msg, pos))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l *Parser) WithMeta() {
|
func (l *Parser) WithFreeFloating() {
|
||||||
l.Lexer.WithMeta = true
|
l.Lexer.WithFreeFloating = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse the php7 Parser entrypoint
|
// Parse the php7 Parser entrypoint
|
||||||
@ -105,7 +105,7 @@ func isDollar(r rune) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (l *Parser) MoveFreeFloating(src node.Node, dst node.Node) {
|
func (l *Parser) MoveFreeFloating(src node.Node, dst node.Node) {
|
||||||
if l.Lexer.WithMeta == false {
|
if l.Lexer.WithFreeFloating == false {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ func (l *Parser) MoveFreeFloating(src node.Node, dst node.Node) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (l *Parser) setFreeFloating(dst node.Node, p freefloating.Position, strings []freefloating.String) {
|
func (l *Parser) setFreeFloating(dst node.Node, p freefloating.Position, strings []freefloating.String) {
|
||||||
if l.Lexer.WithMeta == false {
|
if l.Lexer.WithFreeFloating == false {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,7 +135,7 @@ func (l *Parser) setFreeFloating(dst node.Node, p freefloating.Position, strings
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (l *Parser) GetFreeFloatingToken(t *scanner.Token) []freefloating.String {
|
func (l *Parser) GetFreeFloatingToken(t *scanner.Token) []freefloating.String {
|
||||||
if l.Lexer.WithMeta == false {
|
if l.Lexer.WithFreeFloating == false {
|
||||||
return []freefloating.String{}
|
return []freefloating.String{}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,7 +143,7 @@ func (l *Parser) GetFreeFloatingToken(t *scanner.Token) []freefloating.String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (l *Parser) addDollarToken(v node.Node) {
|
func (l *Parser) addDollarToken(v node.Node) {
|
||||||
if l.Lexer.WithMeta == false {
|
if l.Lexer.WithFreeFloating == false {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,7 +162,7 @@ func (l *Parser) addDollarToken(v node.Node) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (l *Parser) splitSemiColonAndPhpCloseTag(htmlNode node.Node, prevNode node.Node) {
|
func (l *Parser) splitSemiColonAndPhpCloseTag(htmlNode node.Node, prevNode node.Node) {
|
||||||
if l.Lexer.WithMeta == false {
|
if l.Lexer.WithFreeFloating == false {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ import (
|
|||||||
|
|
||||||
func parsePhp5(src string) node.Node {
|
func parsePhp5(src string) node.Node {
|
||||||
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
|
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
|
||||||
php5parser.WithMeta()
|
php5parser.WithFreeFloating()
|
||||||
php5parser.Parse()
|
php5parser.Parse()
|
||||||
|
|
||||||
return php5parser.GetRootNode()
|
return php5parser.GetRootNode()
|
||||||
|
@ -30,7 +30,7 @@ abstract class Bar extends Baz
|
|||||||
// parse
|
// parse
|
||||||
|
|
||||||
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
||||||
php7parser.WithMeta()
|
php7parser.WithFreeFloating()
|
||||||
php7parser.Parse()
|
php7parser.Parse()
|
||||||
|
|
||||||
rootNode := php7parser.GetRootNode()
|
rootNode := php7parser.GetRootNode()
|
||||||
@ -62,7 +62,7 @@ abstract class Bar extends Baz
|
|||||||
|
|
||||||
func parse(src string) node.Node {
|
func parse(src string) node.Node {
|
||||||
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
||||||
php7parser.WithMeta()
|
php7parser.WithFreeFloating()
|
||||||
php7parser.Parse()
|
php7parser.Parse()
|
||||||
|
|
||||||
return php7parser.GetRootNode()
|
return php7parser.GetRootNode()
|
||||||
|
@ -31,15 +31,15 @@ type Lval interface {
|
|||||||
// Lexer php lexer
|
// Lexer php lexer
|
||||||
type Lexer struct {
|
type Lexer struct {
|
||||||
*lex.Lexer
|
*lex.Lexer
|
||||||
StateStack []int
|
StateStack []int
|
||||||
PhpDocComment string
|
PhpDocComment string
|
||||||
FreeFloating []freefloating.String
|
FreeFloating []freefloating.String
|
||||||
heredocLabel string
|
heredocLabel string
|
||||||
tokenBytesBuf *bytes.Buffer
|
tokenBytesBuf *bytes.Buffer
|
||||||
TokenPool *TokenPool
|
TokenPool *TokenPool
|
||||||
WithMeta bool
|
WithFreeFloating bool
|
||||||
lastToken *Token
|
lastToken *Token
|
||||||
Errors []*errors.Error
|
Errors []*errors.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rune2Class returns the rune integer id
|
// Rune2Class returns the rune integer id
|
||||||
@ -163,10 +163,10 @@ func (l *Lexer) tokenString(chars []lex.Char) string {
|
|||||||
return string(l.tokenBytesBuf.Bytes())
|
return string(l.tokenBytesBuf.Bytes())
|
||||||
}
|
}
|
||||||
|
|
||||||
// meta
|
// free-floating
|
||||||
|
|
||||||
func (l *Lexer) addFreeFloating(t freefloating.StringType, chars []lex.Char) {
|
func (l *Lexer) addFreeFloating(t freefloating.StringType, chars []lex.Char) {
|
||||||
if !l.WithMeta {
|
if !l.WithFreeFloating {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -414,7 +414,7 @@ func TestTokens(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
||||||
lexer.WithMeta = true
|
lexer.WithFreeFloating = true
|
||||||
lv := &lval{}
|
lv := &lval{}
|
||||||
actual := []string{}
|
actual := []string{}
|
||||||
|
|
||||||
@ -550,7 +550,7 @@ func TestTeplateStringTokens(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
||||||
lexer.WithMeta = true
|
lexer.WithFreeFloating = true
|
||||||
lv := &lval{}
|
lv := &lval{}
|
||||||
actual := []string{}
|
actual := []string{}
|
||||||
|
|
||||||
@ -636,7 +636,7 @@ func TestBackquoteStringTokens(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
||||||
lexer.WithMeta = true
|
lexer.WithFreeFloating = true
|
||||||
lv := &lval{}
|
lv := &lval{}
|
||||||
actual := []string{}
|
actual := []string{}
|
||||||
|
|
||||||
@ -731,7 +731,7 @@ CAT;
|
|||||||
}
|
}
|
||||||
|
|
||||||
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
||||||
lexer.WithMeta = true
|
lexer.WithFreeFloating = true
|
||||||
lv := &lval{}
|
lv := &lval{}
|
||||||
actual := []string{}
|
actual := []string{}
|
||||||
|
|
||||||
@ -803,7 +803,7 @@ CAT
|
|||||||
}
|
}
|
||||||
|
|
||||||
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
||||||
lexer.WithMeta = true
|
lexer.WithFreeFloating = true
|
||||||
lv := &lval{}
|
lv := &lval{}
|
||||||
actual := []string{}
|
actual := []string{}
|
||||||
|
|
||||||
@ -842,7 +842,7 @@ CAT;
|
|||||||
}
|
}
|
||||||
|
|
||||||
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
||||||
lexer.WithMeta = true
|
lexer.WithFreeFloating = true
|
||||||
lv := &lval{}
|
lv := &lval{}
|
||||||
actual := []string{}
|
actual := []string{}
|
||||||
|
|
||||||
@ -875,7 +875,7 @@ func TestInlineHtmlNopTokens(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
||||||
lexer.WithMeta = true
|
lexer.WithFreeFloating = true
|
||||||
lv := &lval{}
|
lv := &lval{}
|
||||||
actual := []string{}
|
actual := []string{}
|
||||||
|
|
||||||
@ -985,7 +985,7 @@ func TestCommentEnd(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
||||||
lexer.WithMeta = true
|
lexer.WithFreeFloating = true
|
||||||
lv := &lval{}
|
lv := &lval{}
|
||||||
|
|
||||||
lexer.Lex(lv)
|
lexer.Lex(lv)
|
||||||
@ -1017,7 +1017,7 @@ func TestCommentNewLine(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
||||||
lexer.WithMeta = true
|
lexer.WithFreeFloating = true
|
||||||
lv := &lval{}
|
lv := &lval{}
|
||||||
|
|
||||||
lexer.Lex(lv)
|
lexer.Lex(lv)
|
||||||
@ -1049,7 +1049,7 @@ func TestCommentNewLine1(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
||||||
lexer.WithMeta = true
|
lexer.WithFreeFloating = true
|
||||||
lv := &lval{}
|
lv := &lval{}
|
||||||
|
|
||||||
lexer.Lex(lv)
|
lexer.Lex(lv)
|
||||||
@ -1081,7 +1081,7 @@ func TestCommentNewLine2(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
||||||
lexer.WithMeta = true
|
lexer.WithFreeFloating = true
|
||||||
lv := &lval{}
|
lv := &lval{}
|
||||||
|
|
||||||
lexer.Lex(lv)
|
lexer.Lex(lv)
|
||||||
@ -1114,7 +1114,7 @@ func TestCommentWithPhpEndTag(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
||||||
lexer.WithMeta = true
|
lexer.WithFreeFloating = true
|
||||||
lv := &lval{}
|
lv := &lval{}
|
||||||
|
|
||||||
lexer.Lex(lv)
|
lexer.Lex(lv)
|
||||||
@ -1147,7 +1147,7 @@ func TestInlineComment(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
||||||
lexer.WithMeta = true
|
lexer.WithFreeFloating = true
|
||||||
lv := &lval{}
|
lv := &lval{}
|
||||||
|
|
||||||
lexer.Lex(lv)
|
lexer.Lex(lv)
|
||||||
@ -1180,7 +1180,7 @@ func TestInlineComment2(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
||||||
lexer.WithMeta = true
|
lexer.WithFreeFloating = true
|
||||||
lv := &lval{}
|
lv := &lval{}
|
||||||
|
|
||||||
lexer.Lex(lv)
|
lexer.Lex(lv)
|
||||||
@ -1218,7 +1218,7 @@ func TestEmptyInlineComment(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
||||||
lexer.WithMeta = true
|
lexer.WithFreeFloating = true
|
||||||
lv := &lval{}
|
lv := &lval{}
|
||||||
|
|
||||||
lexer.Lex(lv)
|
lexer.Lex(lv)
|
||||||
@ -1251,7 +1251,7 @@ func TestEmptyInlineComment2(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
||||||
lexer.WithMeta = true
|
lexer.WithFreeFloating = true
|
||||||
lv := &lval{}
|
lv := &lval{}
|
||||||
|
|
||||||
lexer.Lex(lv)
|
lexer.Lex(lv)
|
||||||
@ -1266,7 +1266,7 @@ func TestMethodCallTokens(t *testing.T) {
|
|||||||
$a -> bar ( '' ) ;`
|
$a -> bar ( '' ) ;`
|
||||||
|
|
||||||
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
||||||
lexer.WithMeta = true
|
lexer.WithFreeFloating = true
|
||||||
lv := &lval{}
|
lv := &lval{}
|
||||||
|
|
||||||
expected := []freefloating.String{
|
expected := []freefloating.String{
|
||||||
@ -1357,7 +1357,7 @@ func TestYieldFromTokens(t *testing.T) {
|
|||||||
yield from $a`
|
yield from $a`
|
||||||
|
|
||||||
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php")
|
||||||
lexer.WithMeta = true
|
lexer.WithFreeFloating = true
|
||||||
lv := &lval{}
|
lv := &lval{}
|
||||||
|
|
||||||
expected := []freefloating.String{
|
expected := []freefloating.String{
|
||||||
|
@ -22,7 +22,7 @@ func ExampleDumper() {
|
|||||||
}`
|
}`
|
||||||
|
|
||||||
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
||||||
php7parser.WithMeta()
|
php7parser.WithFreeFloating()
|
||||||
php7parser.Parse()
|
php7parser.Parse()
|
||||||
nodes := php7parser.GetRootNode()
|
nodes := php7parser.GetRootNode()
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ func ExampleGoDumper() {
|
|||||||
}`
|
}`
|
||||||
|
|
||||||
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
||||||
php7parser.WithMeta()
|
php7parser.WithFreeFloating()
|
||||||
php7parser.Parse()
|
php7parser.Parse()
|
||||||
nodes := php7parser.GetRootNode()
|
nodes := php7parser.GetRootNode()
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ func ExampleJsonDumper() {
|
|||||||
}`
|
}`
|
||||||
|
|
||||||
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
||||||
php7parser.WithMeta()
|
php7parser.WithFreeFloating()
|
||||||
php7parser.Parse()
|
php7parser.Parse()
|
||||||
nodes := php7parser.GetRootNode()
|
nodes := php7parser.GetRootNode()
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ func ExamplePrettyJsonDumper() {
|
|||||||
`
|
`
|
||||||
|
|
||||||
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
||||||
php7parser.WithMeta()
|
php7parser.WithFreeFloating()
|
||||||
php7parser.Parse()
|
php7parser.Parse()
|
||||||
nodes := php7parser.GetRootNode()
|
nodes := php7parser.GetRootNode()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user