diff --git a/README.md b/README.md index 6ce8d53..132d86d 100644 --- a/README.md +++ b/README.md @@ -37,30 +37,44 @@ Usage example package main import ( - "fmt" + "log" "os" - "github.com/z7zmey/php-parser/php7" - "github.com/z7zmey/php-parser/visitor" + "github.com/z7zmey/php-parser/pkg/cfg" + "github.com/z7zmey/php-parser/pkg/errors" + "github.com/z7zmey/php-parser/pkg/parser" + "github.com/z7zmey/php-parser/pkg/version" + "github.com/z7zmey/php-parser/pkg/visitor/dumper" ) func main() { src := []byte(` ... ``` -| flag | type | description | -|-------|------|----------------------------------------------| -| -p | bool | print filepath | -| -d |string| dump format: [custom, go, json, pretty-json] | -| -r | bool | resolve names | -| -ff | bool | parse and show free floating strings | -| -prof |string| start profiler: [cpu, mem, trace] | -| -php5 | bool | parse as PHP5 | - -Dump AST to stdout. +| flag | type | description | +| ------- | ------ | --------------------------------- | +| -p | bool | print filepath | +| -e | bool | print errors | +| -d | bool | dump in golang format | +| -r | bool | resolve names | +| -prof | string | start profiler: [cpu, mem, trace] | +| -phpver | string | php version (default: 7.4) | Namespace resolver ------------------ diff --git a/doc.go b/doc.go deleted file mode 100644 index 7441434..0000000 --- a/doc.go +++ /dev/null @@ -1,54 +0,0 @@ -/* - -A Parser for PHP written in Go - -Features: - - * Fully support PHP5 and PHP7 syntax - * Abstract syntax tree representation - * Traversing AST - * Namespace resolver - -Install: - - go get github.com/z7zmey/php-parser - -CLI dumper: - - $GOPATH/bin/php-parser -php5 /path/to/file/or/dir - -Package usage example: - - package main - - import ( - "fmt" - "bytes" - "os" - - "github.com/z7zmey/php-parser/php7" - "github.com/z7zmey/php-parser/visitor" - ) - - func main() { - src := bytes.NewBufferString(`