update README.md

This commit is contained in:
z7zmey 2018-02-04 21:35:46 +02:00
parent 025413d2a0
commit fb21f2dca5
3 changed files with 10 additions and 6 deletions

View File

@ -25,18 +25,21 @@ package main
import (
"bytes"
"github.com/z7zmey/php-parser/parser"
"github.com/z7zmey/php-parser/php5"
"github.com/z7zmey/php-parser/visitor"
)
func main() {
src := bytes.NewBufferString(`<? echo "Hello world";`)
nodes, comments, positions := parser.ParsePhp7(src, "example.php")
nodes, comments, positions := php5.Parse(src, "example.php")
visitor := Dumper{"", comments, positions}
visitor := visitor.Dumper{
Indent: "",
Comments: comments,
Positions: positions,
}
nodes.Walk(visitor)
}
```
## Roadmap

View File

@ -9,6 +9,7 @@ import (
"github.com/yookoala/realpath"
"github.com/z7zmey/php-parser/php5"
"github.com/z7zmey/php-parser/visitor"
)
func main() {
@ -25,7 +26,7 @@ func main() {
src, _ := os.Open(string(path))
nodes, comments, positions := php5.Parse(src, path)
visitor := Dumper{
visitor := visitor.Dumper{
Indent: " | ",
Comments: comments,
Positions: positions,

View File

@ -1,4 +1,4 @@
package main
package visitor
import (
"fmt"