all: renamed github.com/z7zmey/php-parser with github.com/VKCOM/php-parser
This commit is contained in:
parent
049ce7ddc6
commit
72cd222aeb
18
README.md
18
README.md
@ -1,13 +1,13 @@
|
||||
> This is a fork of the [z7zmey](https://github.com/z7zmey) [parser](https://github.com/z7zmey/php-parser) that adds PHP 8 support.
|
||||
> This is a fork of the [z7zmey](https://github.com/z7zmey) [parser](https://github.com/VKCOM/php-parser) that adds PHP 8 support.
|
||||
|
||||
PHP Parser written in Go
|
||||
========================
|
||||
|
||||
<img src="./parser.jpg" alt="PHP Parser written in Go" width="980"/>
|
||||
|
||||
[![GoDoc](https://godoc.org/github.com/z7zmey/php-parser?status.svg)](https://godoc.org/github.com/z7zmey/php-parser)
|
||||
[![GoDoc](https://godoc.org/github.com/VKCOM/php-parser?status.svg)](https://godoc.org/github.com/VKCOM/php-parser)
|
||||
[![Build Status](https://travis-ci.org/z7zmey/php-parser.svg?branch=master)](https://travis-ci.org/z7zmey/php-parser)
|
||||
[![Go Report Card](https://goreportcard.com/badge/github.com/z7zmey/php-parser)](https://goreportcard.com/report/github.com/z7zmey/php-parser)
|
||||
[![Go Report Card](https://goreportcard.com/badge/github.com/VKCOM/php-parser)](https://goreportcard.com/report/github.com/VKCOM/php-parser)
|
||||
|
||||
This project uses [goyacc](https://godoc.org/golang.org/x/tools/cmd/goyacc) and [ragel](https://www.colm.net/open-source/ragel/) tools to create PHP parser. It parses source code into [AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree). It can be used to write static analysis, refactoring, metrics, code style formatting tools.
|
||||
|
||||
@ -38,11 +38,11 @@ import (
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"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"
|
||||
"github.com/VKCOM/php-parser/pkg/cfg"
|
||||
"github.com/VKCOM/php-parser/pkg/errors"
|
||||
"github.com/VKCOM/php-parser/pkg/parser"
|
||||
"github.com/VKCOM/php-parser/pkg/version"
|
||||
"github.com/VKCOM/php-parser/pkg/visitor/dumper"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@ -80,7 +80,7 @@ Install
|
||||
-------
|
||||
|
||||
```
|
||||
go get github.com/z7zmey/php-parser/cmd/php-parser
|
||||
go get github.com/VKCOM/php-parser/cmd/php-parser
|
||||
```
|
||||
|
||||
CLI
|
||||
|
@ -17,15 +17,15 @@ import (
|
||||
"github.com/pkg/profile"
|
||||
"github.com/yookoala/realpath"
|
||||
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/z7zmey/php-parser/pkg/conf"
|
||||
"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"
|
||||
"github.com/z7zmey/php-parser/pkg/visitor/nsresolver"
|
||||
"github.com/z7zmey/php-parser/pkg/visitor/printer"
|
||||
"github.com/z7zmey/php-parser/pkg/visitor/traverser"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
"github.com/VKCOM/php-parser/pkg/conf"
|
||||
"github.com/VKCOM/php-parser/pkg/errors"
|
||||
"github.com/VKCOM/php-parser/pkg/parser"
|
||||
"github.com/VKCOM/php-parser/pkg/version"
|
||||
"github.com/VKCOM/php-parser/pkg/visitor/dumper"
|
||||
"github.com/VKCOM/php-parser/pkg/visitor/nsresolver"
|
||||
"github.com/VKCOM/php-parser/pkg/visitor/printer"
|
||||
"github.com/VKCOM/php-parser/pkg/visitor/traverser"
|
||||
)
|
||||
|
||||
var wg sync.WaitGroup
|
||||
|
2
go.mod
2
go.mod
@ -1,4 +1,4 @@
|
||||
module github.com/z7zmey/php-parser
|
||||
module github.com/VKCOM/php-parser
|
||||
|
||||
go 1.13
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
package php5
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/z7zmey/php-parser/pkg/position"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
"github.com/VKCOM/php-parser/pkg/position"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
)
|
||||
|
||||
type ParserBrackets struct {
|
||||
|
@ -1,12 +1,12 @@
|
||||
package php5
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/internal/position"
|
||||
"github.com/z7zmey/php-parser/internal/scanner"
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/z7zmey/php-parser/pkg/conf"
|
||||
"github.com/z7zmey/php-parser/pkg/errors"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/internal/position"
|
||||
"github.com/VKCOM/php-parser/internal/scanner"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
"github.com/VKCOM/php-parser/pkg/conf"
|
||||
"github.com/VKCOM/php-parser/pkg/errors"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
)
|
||||
|
||||
// Parser structure
|
||||
|
@ -5,14 +5,14 @@ import (
|
||||
|
||||
"gotest.tools/assert"
|
||||
|
||||
"github.com/z7zmey/php-parser/internal/php5"
|
||||
"github.com/z7zmey/php-parser/internal/scanner"
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/z7zmey/php-parser/pkg/conf"
|
||||
"github.com/z7zmey/php-parser/pkg/errors"
|
||||
"github.com/z7zmey/php-parser/pkg/position"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/z7zmey/php-parser/pkg/version"
|
||||
"github.com/VKCOM/php-parser/internal/php5"
|
||||
"github.com/VKCOM/php-parser/internal/scanner"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
"github.com/VKCOM/php-parser/pkg/conf"
|
||||
"github.com/VKCOM/php-parser/pkg/errors"
|
||||
"github.com/VKCOM/php-parser/pkg/position"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/pkg/version"
|
||||
)
|
||||
|
||||
func TestIdentifier(t *testing.T) {
|
||||
|
BIN
internal/php5/php5.go
generated
BIN
internal/php5/php5.go
generated
Binary file not shown.
@ -4,9 +4,9 @@ package php5
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/z7zmey/php-parser/pkg/errors"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
"github.com/VKCOM/php-parser/pkg/errors"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
)
|
||||
|
||||
%}
|
||||
|
@ -4,10 +4,10 @@ import (
|
||||
"io/ioutil"
|
||||
"testing"
|
||||
|
||||
"github.com/z7zmey/php-parser/internal/php5"
|
||||
"github.com/z7zmey/php-parser/internal/scanner"
|
||||
"github.com/z7zmey/php-parser/pkg/conf"
|
||||
"github.com/z7zmey/php-parser/pkg/version"
|
||||
"github.com/VKCOM/php-parser/internal/php5"
|
||||
"github.com/VKCOM/php-parser/internal/scanner"
|
||||
"github.com/VKCOM/php-parser/pkg/conf"
|
||||
"github.com/VKCOM/php-parser/pkg/version"
|
||||
)
|
||||
|
||||
func BenchmarkPhp5(b *testing.B) {
|
||||
|
@ -1,9 +1,9 @@
|
||||
package php7
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/z7zmey/php-parser/pkg/position"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
"github.com/VKCOM/php-parser/pkg/position"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
)
|
||||
|
||||
type ParserBrackets struct {
|
||||
|
@ -1,12 +1,12 @@
|
||||
package php7
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/internal/position"
|
||||
"github.com/z7zmey/php-parser/internal/scanner"
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/z7zmey/php-parser/pkg/conf"
|
||||
"github.com/z7zmey/php-parser/pkg/errors"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/internal/position"
|
||||
"github.com/VKCOM/php-parser/internal/scanner"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
"github.com/VKCOM/php-parser/pkg/conf"
|
||||
"github.com/VKCOM/php-parser/pkg/errors"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
)
|
||||
|
||||
// Parser structure
|
||||
|
@ -5,14 +5,14 @@ import (
|
||||
|
||||
"gotest.tools/assert"
|
||||
|
||||
"github.com/z7zmey/php-parser/internal/php7"
|
||||
"github.com/z7zmey/php-parser/internal/scanner"
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/z7zmey/php-parser/pkg/conf"
|
||||
"github.com/z7zmey/php-parser/pkg/errors"
|
||||
"github.com/z7zmey/php-parser/pkg/position"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/z7zmey/php-parser/pkg/version"
|
||||
"github.com/VKCOM/php-parser/internal/php7"
|
||||
"github.com/VKCOM/php-parser/internal/scanner"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
"github.com/VKCOM/php-parser/pkg/conf"
|
||||
"github.com/VKCOM/php-parser/pkg/errors"
|
||||
"github.com/VKCOM/php-parser/pkg/position"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/pkg/version"
|
||||
)
|
||||
|
||||
func TestIdentifier(t *testing.T) {
|
||||
|
BIN
internal/php7/php7.go
generated
BIN
internal/php7/php7.go
generated
Binary file not shown.
@ -4,8 +4,8 @@ package php7
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
)
|
||||
|
||||
%}
|
||||
|
@ -4,10 +4,10 @@ import (
|
||||
"io/ioutil"
|
||||
"testing"
|
||||
|
||||
"github.com/z7zmey/php-parser/internal/php7"
|
||||
"github.com/z7zmey/php-parser/internal/scanner"
|
||||
"github.com/z7zmey/php-parser/pkg/conf"
|
||||
"github.com/z7zmey/php-parser/pkg/version"
|
||||
"github.com/VKCOM/php-parser/internal/php7"
|
||||
"github.com/VKCOM/php-parser/internal/scanner"
|
||||
"github.com/VKCOM/php-parser/pkg/conf"
|
||||
"github.com/VKCOM/php-parser/pkg/version"
|
||||
)
|
||||
|
||||
func BenchmarkPhp7(b *testing.B) {
|
||||
|
@ -3,10 +3,10 @@ package php8
|
||||
import (
|
||||
"bytes"
|
||||
|
||||
"github.com/z7zmey/php-parser/internal/position"
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
position2 "github.com/z7zmey/php-parser/pkg/position"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/internal/position"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
position2 "github.com/VKCOM/php-parser/pkg/position"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
)
|
||||
|
||||
// Builder is responsible for creating nodes inside grammar rules.
|
||||
|
@ -4,11 +4,11 @@ import (
|
||||
"bytes"
|
||||
"strings"
|
||||
|
||||
"github.com/z7zmey/php-parser/pkg/conf"
|
||||
"github.com/z7zmey/php-parser/pkg/errors"
|
||||
"github.com/z7zmey/php-parser/pkg/position"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/z7zmey/php-parser/pkg/version"
|
||||
"github.com/VKCOM/php-parser/pkg/conf"
|
||||
"github.com/VKCOM/php-parser/pkg/errors"
|
||||
"github.com/VKCOM/php-parser/pkg/position"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/pkg/version"
|
||||
)
|
||||
|
||||
type Lexer struct {
|
||||
|
@ -1,9 +1,9 @@
|
||||
package php8
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/z7zmey/php-parser/pkg/position"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
"github.com/VKCOM/php-parser/pkg/position"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
)
|
||||
|
||||
type ParserBrackets struct {
|
||||
|
@ -1,11 +1,11 @@
|
||||
package php8
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/internal/position"
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/z7zmey/php-parser/pkg/conf"
|
||||
"github.com/z7zmey/php-parser/pkg/errors"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/internal/position"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
"github.com/VKCOM/php-parser/pkg/conf"
|
||||
"github.com/VKCOM/php-parser/pkg/errors"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
)
|
||||
|
||||
// Parser structure
|
||||
|
@ -3,14 +3,14 @@ package php8_test
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/z7zmey/php-parser/internal/tester"
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/z7zmey/php-parser/pkg/conf"
|
||||
"github.com/z7zmey/php-parser/pkg/errors"
|
||||
"github.com/z7zmey/php-parser/pkg/parser"
|
||||
"github.com/z7zmey/php-parser/pkg/position"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/z7zmey/php-parser/pkg/version"
|
||||
"github.com/VKCOM/php-parser/internal/tester"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
"github.com/VKCOM/php-parser/pkg/conf"
|
||||
"github.com/VKCOM/php-parser/pkg/errors"
|
||||
"github.com/VKCOM/php-parser/pkg/parser"
|
||||
"github.com/VKCOM/php-parser/pkg/position"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/pkg/version"
|
||||
"gotest.tools/assert"
|
||||
)
|
||||
|
||||
|
@ -3,15 +3,15 @@ package php8_test
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/z7zmey/php-parser/internal/php8"
|
||||
"github.com/VKCOM/php-parser/internal/php8"
|
||||
"gotest.tools/assert"
|
||||
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/z7zmey/php-parser/pkg/conf"
|
||||
"github.com/z7zmey/php-parser/pkg/errors"
|
||||
"github.com/z7zmey/php-parser/pkg/position"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/z7zmey/php-parser/pkg/version"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
"github.com/VKCOM/php-parser/pkg/conf"
|
||||
"github.com/VKCOM/php-parser/pkg/errors"
|
||||
"github.com/VKCOM/php-parser/pkg/position"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/pkg/version"
|
||||
)
|
||||
|
||||
func TestIdentifier(t *testing.T) {
|
||||
|
@ -11,8 +11,8 @@ import __yyfmt__ "fmt"
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
)
|
||||
|
||||
// line internal/php8/php8.y:13
|
||||
|
@ -4,8 +4,8 @@ package php8
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
)
|
||||
|
||||
%}
|
||||
|
@ -4,9 +4,9 @@ import (
|
||||
"io/ioutil"
|
||||
"testing"
|
||||
|
||||
"github.com/z7zmey/php-parser/internal/php8"
|
||||
"github.com/z7zmey/php-parser/pkg/conf"
|
||||
"github.com/z7zmey/php-parser/pkg/version"
|
||||
"github.com/VKCOM/php-parser/internal/php8"
|
||||
"github.com/VKCOM/php-parser/pkg/conf"
|
||||
"github.com/VKCOM/php-parser/pkg/version"
|
||||
)
|
||||
|
||||
func BenchmarkPhp8(b *testing.B) {
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
)
|
||||
|
||||
// line internal/php8/scanner.go:15
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
)
|
||||
|
||||
%%{
|
||||
|
@ -3,10 +3,10 @@ package php8_test
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/z7zmey/php-parser/internal/php8"
|
||||
"github.com/z7zmey/php-parser/internal/tester"
|
||||
"github.com/z7zmey/php-parser/pkg/conf"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/internal/php8"
|
||||
"github.com/VKCOM/php-parser/internal/tester"
|
||||
"github.com/VKCOM/php-parser/pkg/conf"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
"gotest.tools/assert"
|
||||
)
|
||||
|
||||
|
@ -5,11 +5,11 @@ import (
|
||||
|
||||
"gotest.tools/assert"
|
||||
|
||||
"github.com/z7zmey/php-parser/pkg/conf"
|
||||
"github.com/z7zmey/php-parser/pkg/errors"
|
||||
"github.com/z7zmey/php-parser/pkg/position"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/z7zmey/php-parser/pkg/version"
|
||||
"github.com/VKCOM/php-parser/pkg/conf"
|
||||
"github.com/VKCOM/php-parser/pkg/errors"
|
||||
"github.com/VKCOM/php-parser/pkg/position"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/pkg/version"
|
||||
)
|
||||
|
||||
func TestTokens(t *testing.T) {
|
||||
|
@ -1,9 +1,9 @@
|
||||
package position
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/z7zmey/php-parser/pkg/position"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
"github.com/VKCOM/php-parser/pkg/position"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
)
|
||||
|
||||
type startPos struct {
|
||||
|
@ -4,10 +4,10 @@ import (
|
||||
"gotest.tools/assert"
|
||||
"testing"
|
||||
|
||||
builder "github.com/z7zmey/php-parser/internal/position"
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/z7zmey/php-parser/pkg/position"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
builder "github.com/VKCOM/php-parser/internal/position"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
"github.com/VKCOM/php-parser/pkg/position"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
)
|
||||
|
||||
func TestNewTokenPosition(t *testing.T) {
|
||||
|
@ -4,11 +4,11 @@ import (
|
||||
"bytes"
|
||||
"strings"
|
||||
|
||||
"github.com/z7zmey/php-parser/pkg/conf"
|
||||
"github.com/z7zmey/php-parser/pkg/errors"
|
||||
"github.com/z7zmey/php-parser/pkg/position"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/z7zmey/php-parser/pkg/version"
|
||||
"github.com/VKCOM/php-parser/pkg/conf"
|
||||
"github.com/VKCOM/php-parser/pkg/errors"
|
||||
"github.com/VKCOM/php-parser/pkg/position"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/pkg/version"
|
||||
)
|
||||
|
||||
type Lexer struct {
|
||||
|
BIN
internal/scanner/scanner.go
generated
BIN
internal/scanner/scanner.go
generated
Binary file not shown.
@ -5,7 +5,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
)
|
||||
|
||||
%%{
|
||||
|
@ -4,11 +4,11 @@ import (
|
||||
"gotest.tools/assert"
|
||||
"testing"
|
||||
|
||||
"github.com/z7zmey/php-parser/pkg/conf"
|
||||
"github.com/z7zmey/php-parser/pkg/errors"
|
||||
"github.com/z7zmey/php-parser/pkg/position"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/z7zmey/php-parser/pkg/version"
|
||||
"github.com/VKCOM/php-parser/pkg/conf"
|
||||
"github.com/VKCOM/php-parser/pkg/errors"
|
||||
"github.com/VKCOM/php-parser/pkg/position"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/pkg/version"
|
||||
)
|
||||
|
||||
func TestTokens(t *testing.T) {
|
||||
|
@ -3,11 +3,11 @@ package tester
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/z7zmey/php-parser/internal/php8"
|
||||
"github.com/z7zmey/php-parser/internal/scanner"
|
||||
"github.com/z7zmey/php-parser/pkg/conf"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/z7zmey/php-parser/pkg/version"
|
||||
"github.com/VKCOM/php-parser/internal/php8"
|
||||
"github.com/VKCOM/php-parser/internal/scanner"
|
||||
"github.com/VKCOM/php-parser/pkg/conf"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/pkg/version"
|
||||
"gotest.tools/assert"
|
||||
)
|
||||
|
||||
|
@ -3,10 +3,10 @@ package tester
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/z7zmey/php-parser/internal/php8"
|
||||
"github.com/z7zmey/php-parser/internal/scanner"
|
||||
"github.com/z7zmey/php-parser/pkg/conf"
|
||||
"github.com/z7zmey/php-parser/pkg/version"
|
||||
"github.com/VKCOM/php-parser/internal/php8"
|
||||
"github.com/VKCOM/php-parser/internal/scanner"
|
||||
"github.com/VKCOM/php-parser/pkg/conf"
|
||||
"github.com/VKCOM/php-parser/pkg/version"
|
||||
"gotest.tools/assert"
|
||||
)
|
||||
|
||||
|
@ -3,11 +3,11 @@ package tester
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/z7zmey/php-parser/internal/php8"
|
||||
"github.com/z7zmey/php-parser/internal/scanner"
|
||||
"github.com/z7zmey/php-parser/pkg/conf"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/z7zmey/php-parser/pkg/version"
|
||||
"github.com/VKCOM/php-parser/internal/php8"
|
||||
"github.com/VKCOM/php-parser/internal/scanner"
|
||||
"github.com/VKCOM/php-parser/pkg/conf"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/pkg/version"
|
||||
"gotest.tools/assert"
|
||||
)
|
||||
|
||||
|
@ -4,11 +4,11 @@ import (
|
||||
"bytes"
|
||||
"testing"
|
||||
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/z7zmey/php-parser/pkg/conf"
|
||||
"github.com/z7zmey/php-parser/pkg/parser"
|
||||
"github.com/z7zmey/php-parser/pkg/version"
|
||||
"github.com/z7zmey/php-parser/pkg/visitor/printer"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
"github.com/VKCOM/php-parser/pkg/conf"
|
||||
"github.com/VKCOM/php-parser/pkg/parser"
|
||||
"github.com/VKCOM/php-parser/pkg/version"
|
||||
"github.com/VKCOM/php-parser/pkg/visitor/printer"
|
||||
"gotest.tools/assert"
|
||||
)
|
||||
|
||||
|
@ -3,10 +3,10 @@ package tester
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/z7zmey/php-parser/pkg/conf"
|
||||
"github.com/z7zmey/php-parser/pkg/parser"
|
||||
"github.com/z7zmey/php-parser/pkg/version"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
"github.com/VKCOM/php-parser/pkg/conf"
|
||||
"github.com/VKCOM/php-parser/pkg/parser"
|
||||
"github.com/VKCOM/php-parser/pkg/version"
|
||||
"gotest.tools/assert"
|
||||
)
|
||||
|
||||
|
@ -4,10 +4,10 @@ import (
|
||||
"bytes"
|
||||
"testing"
|
||||
|
||||
"github.com/z7zmey/php-parser/pkg/conf"
|
||||
"github.com/z7zmey/php-parser/pkg/parser"
|
||||
"github.com/z7zmey/php-parser/pkg/version"
|
||||
"github.com/z7zmey/php-parser/pkg/visitor/dumper"
|
||||
"github.com/VKCOM/php-parser/pkg/conf"
|
||||
"github.com/VKCOM/php-parser/pkg/parser"
|
||||
"github.com/VKCOM/php-parser/pkg/version"
|
||||
"github.com/VKCOM/php-parser/pkg/visitor/dumper"
|
||||
"gotest.tools/assert"
|
||||
)
|
||||
|
||||
|
@ -3,10 +3,10 @@ package tester
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/z7zmey/php-parser/pkg/conf"
|
||||
"github.com/z7zmey/php-parser/pkg/errors"
|
||||
"github.com/z7zmey/php-parser/pkg/parser"
|
||||
"github.com/z7zmey/php-parser/pkg/version"
|
||||
"github.com/VKCOM/php-parser/pkg/conf"
|
||||
"github.com/VKCOM/php-parser/pkg/errors"
|
||||
"github.com/VKCOM/php-parser/pkg/parser"
|
||||
"github.com/VKCOM/php-parser/pkg/version"
|
||||
"gotest.tools/assert"
|
||||
)
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package ast
|
||||
|
||||
import "github.com/z7zmey/php-parser/pkg/position"
|
||||
import "github.com/VKCOM/php-parser/pkg/position"
|
||||
|
||||
type Vertex interface {
|
||||
Accept(v Visitor)
|
||||
|
@ -1,8 +1,8 @@
|
||||
package ast
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/pkg/position"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/pkg/position"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
)
|
||||
|
||||
// Root node
|
||||
|
@ -1,8 +1,8 @@
|
||||
package conf
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/pkg/errors"
|
||||
"github.com/z7zmey/php-parser/pkg/version"
|
||||
"github.com/VKCOM/php-parser/pkg/errors"
|
||||
"github.com/VKCOM/php-parser/pkg/version"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
|
@ -3,7 +3,7 @@ package errors
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/z7zmey/php-parser/pkg/position"
|
||||
"github.com/VKCOM/php-parser/pkg/position"
|
||||
)
|
||||
|
||||
// Error parsing error
|
||||
|
@ -5,8 +5,8 @@ import (
|
||||
|
||||
"gotest.tools/assert"
|
||||
|
||||
"github.com/z7zmey/php-parser/pkg/errors"
|
||||
"github.com/z7zmey/php-parser/pkg/position"
|
||||
"github.com/VKCOM/php-parser/pkg/errors"
|
||||
"github.com/VKCOM/php-parser/pkg/position"
|
||||
)
|
||||
|
||||
func TestConstructor(t *testing.T) {
|
||||
|
@ -10,11 +10,11 @@ Package usage example:
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/z7zmey/php-parser/pkg/conf"
|
||||
"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"
|
||||
"github.com/VKCOM/php-parser/pkg/conf"
|
||||
"github.com/VKCOM/php-parser/pkg/errors"
|
||||
"github.com/VKCOM/php-parser/pkg/parser"
|
||||
"github.com/VKCOM/php-parser/pkg/version"
|
||||
"github.com/VKCOM/php-parser/pkg/visitor/dumper"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -3,13 +3,13 @@ package parser
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/z7zmey/php-parser/internal/php5"
|
||||
"github.com/z7zmey/php-parser/internal/php7"
|
||||
"github.com/z7zmey/php-parser/internal/php8"
|
||||
"github.com/z7zmey/php-parser/internal/scanner"
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/z7zmey/php-parser/pkg/conf"
|
||||
"github.com/z7zmey/php-parser/pkg/version"
|
||||
"github.com/VKCOM/php-parser/internal/php5"
|
||||
"github.com/VKCOM/php-parser/internal/php7"
|
||||
"github.com/VKCOM/php-parser/internal/php8"
|
||||
"github.com/VKCOM/php-parser/internal/scanner"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
"github.com/VKCOM/php-parser/pkg/conf"
|
||||
"github.com/VKCOM/php-parser/pkg/version"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -1,6 +1,6 @@
|
||||
package token
|
||||
|
||||
import "github.com/z7zmey/php-parser/pkg/position"
|
||||
import "github.com/VKCOM/php-parser/pkg/position"
|
||||
|
||||
//go:generate stringer -type=ID -output ./token_string.go
|
||||
type ID int
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
|
||||
"gotest.tools/assert"
|
||||
|
||||
"github.com/z7zmey/php-parser/pkg/version"
|
||||
"github.com/VKCOM/php-parser/pkg/version"
|
||||
)
|
||||
|
||||
func Test(t *testing.T) {
|
||||
|
@ -5,10 +5,10 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/z7zmey/php-parser/pkg/position"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/pkg/position"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
)
|
||||
|
||||
type Dumper struct {
|
||||
|
@ -2,12 +2,12 @@ package dumper_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/z7zmey/php-parser/pkg/position"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/z7zmey/php-parser/pkg/visitor/dumper"
|
||||
"github.com/VKCOM/php-parser/pkg/position"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/pkg/visitor/dumper"
|
||||
"testing"
|
||||
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
)
|
||||
|
||||
func TestDumper_root(t *testing.T) {
|
||||
|
@ -3,8 +3,8 @@ package formatter
|
||||
import (
|
||||
"bytes"
|
||||
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
)
|
||||
|
||||
type formatterState int
|
||||
|
@ -2,12 +2,12 @@ package formatter_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/z7zmey/php-parser/pkg/visitor/formatter"
|
||||
"github.com/z7zmey/php-parser/pkg/visitor/printer"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/pkg/visitor/formatter"
|
||||
"github.com/VKCOM/php-parser/pkg/visitor/printer"
|
||||
"testing"
|
||||
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
)
|
||||
|
||||
func TestFormatter_Root(t *testing.T) {
|
||||
|
@ -5,8 +5,8 @@ import (
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/z7zmey/php-parser/pkg/visitor"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
"github.com/VKCOM/php-parser/pkg/visitor"
|
||||
)
|
||||
|
||||
// NamespaceResolver visitor
|
||||
|
@ -1,13 +1,13 @@
|
||||
package nsresolver_test
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/pkg/visitor/nsresolver"
|
||||
"github.com/z7zmey/php-parser/pkg/visitor/traverser"
|
||||
"github.com/VKCOM/php-parser/pkg/visitor/nsresolver"
|
||||
"github.com/VKCOM/php-parser/pkg/visitor/traverser"
|
||||
"testing"
|
||||
|
||||
"gotest.tools/assert"
|
||||
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
)
|
||||
|
||||
func TestResolveStaticCall(t *testing.T) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
package visitor
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
)
|
||||
|
||||
type Null struct {
|
||||
|
@ -4,8 +4,8 @@ import (
|
||||
"bytes"
|
||||
"io"
|
||||
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
)
|
||||
|
||||
type printerState int
|
||||
|
@ -4,12 +4,12 @@ import (
|
||||
"bytes"
|
||||
"testing"
|
||||
|
||||
"github.com/z7zmey/php-parser/internal/php5"
|
||||
"github.com/z7zmey/php-parser/internal/scanner"
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/z7zmey/php-parser/pkg/conf"
|
||||
"github.com/z7zmey/php-parser/pkg/version"
|
||||
"github.com/z7zmey/php-parser/pkg/visitor/printer"
|
||||
"github.com/VKCOM/php-parser/internal/php5"
|
||||
"github.com/VKCOM/php-parser/internal/scanner"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
"github.com/VKCOM/php-parser/pkg/conf"
|
||||
"github.com/VKCOM/php-parser/pkg/version"
|
||||
"github.com/VKCOM/php-parser/pkg/visitor/printer"
|
||||
)
|
||||
|
||||
func parsePhp5(src string) ast.Vertex {
|
||||
|
@ -5,12 +5,12 @@ import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/z7zmey/php-parser/internal/php7"
|
||||
"github.com/z7zmey/php-parser/internal/scanner"
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/z7zmey/php-parser/pkg/conf"
|
||||
"github.com/z7zmey/php-parser/pkg/version"
|
||||
"github.com/z7zmey/php-parser/pkg/visitor/printer"
|
||||
"github.com/VKCOM/php-parser/internal/php7"
|
||||
"github.com/VKCOM/php-parser/internal/scanner"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
"github.com/VKCOM/php-parser/pkg/conf"
|
||||
"github.com/VKCOM/php-parser/pkg/version"
|
||||
"github.com/VKCOM/php-parser/pkg/visitor/printer"
|
||||
)
|
||||
|
||||
func ExamplePrinter() {
|
||||
|
@ -5,12 +5,12 @@ import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/z7zmey/php-parser/internal/php8"
|
||||
"github.com/z7zmey/php-parser/internal/tester"
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/z7zmey/php-parser/pkg/conf"
|
||||
"github.com/z7zmey/php-parser/pkg/version"
|
||||
"github.com/z7zmey/php-parser/pkg/visitor/printer"
|
||||
"github.com/VKCOM/php-parser/internal/php8"
|
||||
"github.com/VKCOM/php-parser/internal/tester"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
"github.com/VKCOM/php-parser/pkg/conf"
|
||||
"github.com/VKCOM/php-parser/pkg/version"
|
||||
"github.com/VKCOM/php-parser/pkg/visitor/printer"
|
||||
"gotest.tools/assert"
|
||||
)
|
||||
|
||||
|
@ -2,11 +2,11 @@ package printer_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/z7zmey/php-parser/pkg/visitor/printer"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/pkg/visitor/printer"
|
||||
"testing"
|
||||
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
)
|
||||
|
||||
func TestPrinterPrintFile(t *testing.T) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
package traverser
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/VKCOM/php-parser/pkg/ast"
|
||||
)
|
||||
|
||||
type Traverser struct {
|
||||
|
Loading…
Reference in New Issue
Block a user