diff --git a/php5/parser.go b/php5/parser.go index 2d849fd..c134e6f 100644 --- a/php5/parser.go +++ b/php5/parser.go @@ -18,7 +18,7 @@ func (lval *yySymType) Token(t *scanner.Token) { type Parser struct { *scanner.Lexer path string - lastToken *scanner.Token + currentToken *scanner.Token positionBuilder *parser.PositionBuilder errors []*errors.Error rootNode node.Node @@ -45,12 +45,12 @@ func NewParser(src io.Reader, path string) *Parser { // Lex proxy to lexer Lex func (l *Parser) Lex(lval *yySymType) int { t := l.Lexer.Lex(lval) - l.lastToken = lval.token + l.currentToken = lval.token return t } 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 diff --git a/php7/parser.go b/php7/parser.go index 5ec8c7c..67e5b59 100644 --- a/php7/parser.go +++ b/php7/parser.go @@ -18,7 +18,7 @@ func (lval *yySymType) Token(t *scanner.Token) { type Parser struct { *scanner.Lexer path string - lastToken *scanner.Token + currentToken *scanner.Token positionBuilder *parser.PositionBuilder errors []*errors.Error rootNode node.Node @@ -45,12 +45,12 @@ func NewParser(src io.Reader, path string) *Parser { // Lex proxy to lexer Lex func (l *Parser) Lex(lval *yySymType) int { t := l.Lexer.Lex(lval) - l.lastToken = lval.token + l.currentToken = lval.token return t } 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