merge token package into scanner package

This commit is contained in:
z7zmey
2018-04-15 14:47:40 +03:00
parent 983c721e83
commit e65ace8984
14 changed files with 56 additions and 62 deletions

View File

@@ -8,10 +8,9 @@ import (
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/scanner"
"github.com/z7zmey/php-parser/token"
)
func (lval *yySymType) Token(t token.Token) {
func (lval *yySymType) Token(t scanner.Token) {
lval.token = t
}
@@ -19,7 +18,7 @@ func (lval *yySymType) Token(t token.Token) {
type Parser struct {
*scanner.Lexer
path string
lastToken *token.Token
lastToken *scanner.Token
positionBuilder *position.Builder
errors []*errors.Error
rootNode node.Node

View File

@@ -16,14 +16,14 @@ import (
"github.com/z7zmey/php-parser/node/name"
"github.com/z7zmey/php-parser/node/scalar"
"github.com/z7zmey/php-parser/node/stmt"
"github.com/z7zmey/php-parser/token"
"github.com/z7zmey/php-parser/scanner"
)
//line php7/php7.y:21
type yySymType struct {
yys int
node node.Node
token token.Token
token scanner.Token
boolWithToken boolWithToken
list []node.Node
foreachVariable foreachVariable
@@ -345,7 +345,6 @@ const yyErrCode = 2
const yyInitialStackSize = 16
//line php7/php7.y:2635
type foreachVariable struct {
node node.Node
byRef bool
@@ -353,12 +352,12 @@ type foreachVariable struct {
type nodesWithEndToken struct {
nodes []node.Node
endToken token.Token
endToken scanner.Token
}
type boolWithToken struct {
value bool
token *token.Token
token *scanner.Token
}
type altSyntaxNode struct {

View File

@@ -5,7 +5,7 @@ import (
"strings"
"strconv"
"github.com/z7zmey/php-parser/token"
"github.com/z7zmey/php-parser/scanner"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/node/scalar"
"github.com/z7zmey/php-parser/node/name"
@@ -20,7 +20,7 @@ import (
%union{
node node.Node
token token.Token
token scanner.Token
boolWithToken boolWithToken
list []node.Node
foreachVariable foreachVariable
@@ -2641,12 +2641,12 @@ type foreachVariable struct {
type nodesWithEndToken struct {
nodes []node.Node
endToken token.Token
endToken scanner.Token
}
type boolWithToken struct {
value bool
token *token.Token
token *scanner.Token
}
type altSyntaxNode struct {