scanner

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IgnoreWhiteSpace

func IgnoreWhiteSpace(l *Lexer) (newLine bool)

func Start

func Start(emitter token.Emitter, inital State, input string)

func StartWithFilenames

func StartWithFilenames(emitter token.Emitter, inital State, filenames ...string)

Types

type Lexer

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

func (*Lexer) Accept

func (l *Lexer) Accept(valid string) bool

func (*Lexer) AcceptRun

func (l *Lexer) AcceptRun(valid string) bool

func (*Lexer) AcceptRunUntil

func (l *Lexer) AcceptRunUntil(invalid string)

func (*Lexer) Backup

func (l *Lexer) Backup()

func (*Lexer) Current

func (l *Lexer) Current() string

func (*Lexer) Emit

func (l *Lexer) Emit(typ token.Type)

func (*Lexer) Errorf

func (l *Lexer) Errorf(format string, args ...interface{})

func (*Lexer) Ignore

func (l *Lexer) Ignore()

func (*Lexer) Next

func (l *Lexer) Next() rune

func (*Lexer) NextN

func (l *Lexer) NextN(n int) string

func (*Lexer) Peek

func (l *Lexer) Peek() rune

func (*Lexer) PeekN

func (l *Lexer) PeekN(n int) string

func (*Lexer) Run

func (l *Lexer) Run(state State)

type State

type State func(*Lexer) State

func Lex

func Lex(l *Lexer) State

func Number

func Number(l *Lexer) State

Jump to

Keyboard shortcuts

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