rename lastToken to currentToken
This commit is contained in:
parent
435dc5c706
commit
a28fd2e8ec
@ -18,7 +18,7 @@ func (lval *yySymType) Token(t *scanner.Token) {
|
|||||||
type Parser struct {
|
type Parser struct {
|
||||||
*scanner.Lexer
|
*scanner.Lexer
|
||||||
path string
|
path string
|
||||||
lastToken *scanner.Token
|
currentToken *scanner.Token
|
||||||
positionBuilder *parser.PositionBuilder
|
positionBuilder *parser.PositionBuilder
|
||||||
errors []*errors.Error
|
errors []*errors.Error
|
||||||
rootNode node.Node
|
rootNode node.Node
|
||||||
@ -45,12 +45,12 @@ func NewParser(src io.Reader, path string) *Parser {
|
|||||||
// Lex proxy to lexer Lex
|
// Lex proxy to lexer Lex
|
||||||
func (l *Parser) Lex(lval *yySymType) int {
|
func (l *Parser) Lex(lval *yySymType) int {
|
||||||
t := l.Lexer.Lex(lval)
|
t := l.Lexer.Lex(lval)
|
||||||
l.lastToken = lval.token
|
l.currentToken = lval.token
|
||||||
return t
|
return t
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l *Parser) Error(msg string) {
|
func (l *Parser) Error(msg string) {
|
||||||
l.errors = append(l.errors, errors.NewError(msg, l.lastToken))
|
l.errors = append(l.errors, errors.NewError(msg, l.currentToken))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse the php7 Parser entrypoint
|
// Parse the php7 Parser entrypoint
|
||||||
|
@ -18,7 +18,7 @@ func (lval *yySymType) Token(t *scanner.Token) {
|
|||||||
type Parser struct {
|
type Parser struct {
|
||||||
*scanner.Lexer
|
*scanner.Lexer
|
||||||
path string
|
path string
|
||||||
lastToken *scanner.Token
|
currentToken *scanner.Token
|
||||||
positionBuilder *parser.PositionBuilder
|
positionBuilder *parser.PositionBuilder
|
||||||
errors []*errors.Error
|
errors []*errors.Error
|
||||||
rootNode node.Node
|
rootNode node.Node
|
||||||
@ -45,12 +45,12 @@ func NewParser(src io.Reader, path string) *Parser {
|
|||||||
// Lex proxy to lexer Lex
|
// Lex proxy to lexer Lex
|
||||||
func (l *Parser) Lex(lval *yySymType) int {
|
func (l *Parser) Lex(lval *yySymType) int {
|
||||||
t := l.Lexer.Lex(lval)
|
t := l.Lexer.Lex(lval)
|
||||||
l.lastToken = lval.token
|
l.currentToken = lval.token
|
||||||
return t
|
return t
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l *Parser) Error(msg string) {
|
func (l *Parser) Error(msg string) {
|
||||||
l.errors = append(l.errors, errors.NewError(msg, l.lastToken))
|
l.errors = append(l.errors, errors.NewError(msg, l.currentToken))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse the php7 Parser entrypoint
|
// Parse the php7 Parser entrypoint
|
||||||
|
Loading…
Reference in New Issue
Block a user