From a636a14faac04ccd0dc82f347a00554b0ce1e802 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Mon, 18 May 2020 21:44:03 +0300 Subject: [PATCH] [refactoring] remove scanner interface --- internal/php5/parser.go | 6 +----- internal/php7/parser.go | 6 +----- internal/scanner/lexer.go | 5 ----- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/internal/php5/parser.go b/internal/php5/parser.go index 0f4441d..c0e2ac4 100644 --- a/internal/php5/parser.go +++ b/internal/php5/parser.go @@ -11,13 +11,9 @@ import ( "github.com/z7zmey/php-parser/pkg/token" ) -func (lval *yySymType) Token(t *scanner.Token) { - lval.token = t -} - // Parser structure type Parser struct { - Lexer scanner.Scanner + Lexer *scanner.Lexer currentToken *scanner.Token positionBuilder *positionbuilder.PositionBuilder rootNode ast.Vertex diff --git a/internal/php7/parser.go b/internal/php7/parser.go index df00e2d..f34ddc4 100644 --- a/internal/php7/parser.go +++ b/internal/php7/parser.go @@ -10,13 +10,9 @@ import ( "github.com/z7zmey/php-parser/pkg/token" ) -func (lval *yySymType) Token(t *scanner.Token) { - lval.token = t -} - // Parser structure type Parser struct { - Lexer scanner.Scanner + Lexer *scanner.Lexer currentToken *scanner.Token positionBuilder *positionbuilder.PositionBuilder rootNode ast.Vertex diff --git a/internal/scanner/lexer.go b/internal/scanner/lexer.go index 8cfc2b3..2308bcd 100644 --- a/internal/scanner/lexer.go +++ b/internal/scanner/lexer.go @@ -10,11 +10,6 @@ import ( "github.com/z7zmey/php-parser/pkg/token" ) -type Scanner interface { - Lex() *Token - ReturnTokenToPool(t *Token) -} - type Config struct { WithHiddenTokens bool ErrHandlerFunc func(*errors.Error)