refactor: move php7 scanner into php7 package
This commit is contained in:
@@ -3,8 +3,8 @@ package tester
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"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/conf"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/pkg/version"
|
||||
@@ -46,7 +46,7 @@ func (l *LexerTokenFreeFloatingTestSuite) Run() {
|
||||
var lexer Lexer
|
||||
|
||||
if l.Version.Less(&version.Version{Major: 8, Minor: 0}) {
|
||||
lexer = scanner.NewLexer([]byte(l.Code), config)
|
||||
lexer = php7.NewLexer([]byte(l.Code), config)
|
||||
} else {
|
||||
lexer = php8.NewLexer([]byte(l.Code), config)
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/VKCOM/php-parser/internal/php8"
|
||||
"github.com/VKCOM/php-parser/internal/scanner"
|
||||
"github.com/VKCOM/php-parser/internal/php7"
|
||||
"github.com/VKCOM/php-parser/pkg/conf"
|
||||
"github.com/VKCOM/php-parser/pkg/version"
|
||||
"gotest.tools/assert"
|
||||
@@ -41,7 +41,7 @@ func (l *LexerTokenStringTestSuite) Run() {
|
||||
var lexer Lexer
|
||||
|
||||
if l.Version.Less(&version.Version{Major: 8, Minor: 0}) {
|
||||
lexer = scanner.NewLexer([]byte(l.Code), config)
|
||||
lexer = php7.NewLexer([]byte(l.Code), config)
|
||||
} else {
|
||||
lexer = php8.NewLexer([]byte(l.Code), config)
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/VKCOM/php-parser/internal/php8"
|
||||
"github.com/VKCOM/php-parser/internal/scanner"
|
||||
"github.com/VKCOM/php-parser/internal/php7"
|
||||
"github.com/VKCOM/php-parser/pkg/conf"
|
||||
"github.com/VKCOM/php-parser/pkg/token"
|
||||
"github.com/VKCOM/php-parser/pkg/version"
|
||||
@@ -53,7 +53,7 @@ func (l *LexerTokenStructTestSuite) Run() {
|
||||
var lexer Lexer
|
||||
|
||||
if l.Version.Less(&version.Version{Major: 8, Minor: 0}) {
|
||||
lexer = scanner.NewLexer([]byte(l.Code), config)
|
||||
lexer = php7.NewLexer([]byte(l.Code), config)
|
||||
} else {
|
||||
lexer = php8.NewLexer([]byte(l.Code), config)
|
||||
}
|
||||
|
||||
@@ -49,6 +49,8 @@ func (p *ParserDumpTestSuite) UsePHP8() {
|
||||
}
|
||||
|
||||
func (p *ParserDumpTestSuite) Run() {
|
||||
p.t.Helper()
|
||||
|
||||
config := conf.Config{
|
||||
Version: &p.Version,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user