[refactoring] remove scanner interface
This commit is contained in:
		
							parent
							
								
									436287bbe1
								
							
						
					
					
						commit
						a636a14faa
					
				| @ -11,13 +11,9 @@ import ( | |||||||
| 	"github.com/z7zmey/php-parser/pkg/token" | 	"github.com/z7zmey/php-parser/pkg/token" | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| func (lval *yySymType) Token(t *scanner.Token) { |  | ||||||
| 	lval.token = t |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| // Parser structure | // Parser structure | ||||||
| type Parser struct { | type Parser struct { | ||||||
| 	Lexer           scanner.Scanner | 	Lexer           *scanner.Lexer | ||||||
| 	currentToken    *scanner.Token | 	currentToken    *scanner.Token | ||||||
| 	positionBuilder *positionbuilder.PositionBuilder | 	positionBuilder *positionbuilder.PositionBuilder | ||||||
| 	rootNode        ast.Vertex | 	rootNode        ast.Vertex | ||||||
|  | |||||||
| @ -10,13 +10,9 @@ import ( | |||||||
| 	"github.com/z7zmey/php-parser/pkg/token" | 	"github.com/z7zmey/php-parser/pkg/token" | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| func (lval *yySymType) Token(t *scanner.Token) { |  | ||||||
| 	lval.token = t |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| // Parser structure | // Parser structure | ||||||
| type Parser struct { | type Parser struct { | ||||||
| 	Lexer           scanner.Scanner | 	Lexer           *scanner.Lexer | ||||||
| 	currentToken    *scanner.Token | 	currentToken    *scanner.Token | ||||||
| 	positionBuilder *positionbuilder.PositionBuilder | 	positionBuilder *positionbuilder.PositionBuilder | ||||||
| 	rootNode        ast.Vertex | 	rootNode        ast.Vertex | ||||||
|  | |||||||
| @ -10,11 +10,6 @@ import ( | |||||||
| 	"github.com/z7zmey/php-parser/pkg/token" | 	"github.com/z7zmey/php-parser/pkg/token" | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| type Scanner interface { |  | ||||||
| 	Lex() *Token |  | ||||||
| 	ReturnTokenToPool(t *Token) |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| type Config struct { | type Config struct { | ||||||
| 	WithHiddenTokens bool | 	WithHiddenTokens bool | ||||||
| 	ErrHandlerFunc   func(*errors.Error) | 	ErrHandlerFunc   func(*errors.Error) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user