refactor: move php7 scanner into php7 package
This commit is contained in:
@@ -124,11 +124,13 @@ func (lex *Lexer) isHeredocEndBefore73(p int) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
if len(lex.data) > p+l && lex.data[p+l] != ';' && lex.data[p+l] != '\r' && lex.data[p+l] != '\n' {
|
||||
if len(lex.data) > p+l && lex.data[p+l] != ';' && lex.data[p+l] != '\r' &&
|
||||
lex.data[p+l] != '\n' {
|
||||
return false
|
||||
}
|
||||
|
||||
if len(lex.data) > p+l+1 && lex.data[p+l] == ';' && lex.data[p+l+1] != '\r' && lex.data[p+l+1] != '\n' {
|
||||
if len(lex.data) > p+l+1 && lex.data[p+l] == ';' && lex.data[p+l+1] != '\r' &&
|
||||
lex.data[p+l+1] != '\n' {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -262,5 +264,6 @@ func isValidVarNameStart(r byte) bool {
|
||||
}
|
||||
|
||||
func isValidVarName(r byte) bool {
|
||||
return (r >= 'A' && r <= 'Z') || (r >= 'a' && r <= 'z') || (r >= '0' && r <= '9') || r == '_' || r >= 0x80
|
||||
return (r >= 'A' && r <= 'Z') || (r >= 'a' && r <= 'z') || (r >= '0' && r <= '9') || r == '_' ||
|
||||
r >= 0x80
|
||||
}
|
||||
|
||||
@@ -4177,7 +4177,7 @@ class Point {
|
||||
},
|
||||
},
|
||||
AmpersandTkn: &token.Token{
|
||||
ID: token.ID(57492),
|
||||
ID: token.T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG,
|
||||
Val: []byte("&"),
|
||||
FreeFloating: []*token.Token{
|
||||
{
|
||||
@@ -4302,7 +4302,7 @@ class Point {
|
||||
},
|
||||
},
|
||||
AmpersandTkn: &token.Token{
|
||||
ID: token.ID(57492),
|
||||
ID: token.T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG,
|
||||
Val: []byte("&"),
|
||||
FreeFloating: []*token.Token{
|
||||
{
|
||||
|
||||
@@ -539,4 +539,4 @@ func (lex *Lexer) Lex() *token.Token {
|
||||
tkn.ID = token.ID(tok)
|
||||
|
||||
return tkn
|
||||
}
|
||||
}
|
||||
|
||||
@@ -317,7 +317,7 @@ func TestTokens(t *testing.T) {
|
||||
token.ID(int('|')).String(),
|
||||
token.ID(int('/')).String(),
|
||||
token.ID(int('^')).String(),
|
||||
token.ID(T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG).String(),
|
||||
token.ID(token.T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG).String(),
|
||||
token.ID(int('+')).String(),
|
||||
token.ID(int('-')).String(),
|
||||
token.ID(int('*')).String(),
|
||||
|
||||
Reference in New Issue
Block a user