lexer

package
v1.11.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2024 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lexer

type Lexer struct {
	// contains filtered or unexported fields
}

func New

func New(r io.Reader, opts ...OptionFunc) *Lexer

func NewFromString

func NewFromString(input string, opts ...OptionFunc) *Lexer

func (*Lexer) GetLine

func (l *Lexer) GetLine(n int) (string, bool)

func (*Lexer) LineCount added in v0.8.0

func (l *Lexer) LineCount() int

func (*Lexer) NewLine

func (l *Lexer) NewLine()

func (*Lexer) NextToken

func (l *Lexer) NextToken() token.Token

nolint: funlen,gocognit,gocyclo

func (*Lexer) PeekToken added in v0.0.7

func (l *Lexer) PeekToken() token.Token

func (*Lexer) RegisterCustomTokens added in v1.7.0

func (l *Lexer) RegisterCustomTokens(tokenMap map[string]token.TokenType)

type Option

type Option struct {
	Filename string
	Customs  map[string]token.TokenType
}

type OptionFunc

type OptionFunc func(o *Option)

func WithCustomTokens added in v1.7.0

func WithCustomTokens(tokenMap map[string]token.TokenType) OptionFunc

func WithFile

func WithFile(filename string) OptionFunc

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL