[refactoring] remove scanner.Lexer.PhpDocComment

This commit is contained in:
Vadym Slizov 2020-05-18 00:23:02 +03:00
parent 5620697cab
commit 8a50bd254a
5 changed files with 1 additions and 22 deletions

Binary file not shown.

View File

@ -16,7 +16,6 @@ import (
node ast.Vertex
token *scanner.Token
list []ast.Vertex
str string
ClassExtends *ast.StmtClassExtends
ClassImplements *ast.StmtClassImplements
@ -285,8 +284,6 @@ import (
%type <list> method_modifiers variable_modifiers
%type <list> non_empty_member_modifiers name_list class_modifiers
%type <str> backup_doc_comment
%%
/////////////////////////////////////////////////////////////////////////
@ -4234,12 +4231,6 @@ inline_function:
backup_doc_comment:
/* empty */
{
$$ = yylex.(*Parser).Lexer.GetPhpDocComment()
yylex.(*Parser).Lexer.SetPhpDocComment("")
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
}
;
returns_ref:

View File

@ -13,8 +13,6 @@ import (
type Scanner interface {
Lex(lval Lval) int
ReturnTokenToPool(t *Token)
GetPhpDocComment() string
SetPhpDocComment(string)
GetErrors() []*errors.Error
GetWithHiddenTokens() bool
SetWithHiddenTokens(bool)
@ -38,7 +36,6 @@ type Lexer struct {
TokenPool *TokenPool
HiddenTokens []token.Token
WithHiddenTokens bool
PhpDocComment string
lastToken *Token
Errors []*errors.Error
NewLines NewLines
@ -49,14 +46,6 @@ func (l *Lexer) ReturnTokenToPool(t *Token) {
l.TokenPool.Put(t)
}
func (l *Lexer) GetPhpDocComment() string {
return l.PhpDocComment
}
func (l *Lexer) SetPhpDocComment(s string) {
l.PhpDocComment = s
}
func (l *Lexer) GetErrors() []*errors.Error {
return l.Errors
}

Binary file not shown.

View File

@ -336,7 +336,6 @@ func (lex *Lexer) Lex(lval Lval) int {
}
if isDocComment {
lex.PhpDocComment = string(lex.data[lex.ts:lex.te])
lex.addToken(T_DOC_COMMENT, lex.ts, lex.te)
} else {
lex.addToken(T_COMMENT, lex.ts, lex.te)
@ -352,7 +351,7 @@ func (lex *Lexer) Lex(lval Lval) int {
};
"{" => { lex.setTokenPosition(token); tok = TokenID(int('{')); lex.call(ftargs, fentry(php)); goto _out; };
"}" => { lex.setTokenPosition(token); tok = TokenID(int('}')); lex.ret(1); lex.PhpDocComment = ""; goto _out;};
"}" => { lex.setTokenPosition(token); tok = TokenID(int('}')); lex.ret(1); goto _out;};
"$" varname => { lex.setTokenPosition(token); tok = T_VARIABLE; fbreak; };
varname => { lex.setTokenPosition(token); tok = T_STRING; fbreak; };