lexer

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 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(tokens ...string)

type Option

type Option struct {
	Filename string
	Customs  map[string]struct{}
}

type OptionFunc

type OptionFunc func(o *Option)

func WithCustomTokens added in v1.7.0

func WithCustomTokens(idents ...string) 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