scan

package
v0.0.0-...-5ae1cde Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const EOF rune = -1

Variables

This section is empty.

Functions

func IsDigit

func IsDigit(r rune) bool

func IsLetter

func IsLetter(r rune) bool

a-zA-z

Types

type Lexer

type Lexer struct {
	TokenGenerator func(rune) Token

	Peeked Token
	// contains filtered or unexported fields
}

func Lex

func Lex(b []byte, generator func(rune) Token) *Lexer

Lex returns a new Lexer with the given input and generator.

func (*Lexer) Next

func (l *Lexer) Next() (rune, int)

func (*Lexer) NextToken

func (l *Lexer) NextToken() (Token, error)

func (*Lexer) PeekToken

func (l *Lexer) PeekToken() (Token, error)

func (*Lexer) Reset

func (l *Lexer) Reset(b []byte)

type Parser

type Parser struct {
	Lexer     *Lexer
	BytesRead uint16
	// contains filtered or unexported fields
}

func (*Parser) CheckUTF8Error

func (p *Parser) CheckUTF8Error() error

if p encountered any utf8 errors when lexing, retrieve them here

func (*Parser) Expect

func (p *Parser) Expect(t TokenType) bool

func (*Parser) Next

func (p *Parser) Next() Token

func (*Parser) Peek

func (p *Parser) Peek() Token

Multiple calls to Peek will continue to return the same value until Next is called.

func (*Parser) Reset

func (p *Parser) Reset(b []byte)

type Token

type Token struct {
	TokenType TokenType
	Value     rune
	// contains filtered or unexported fields
}
var EOFToken Token = Token{TokenType(EOF), EOF, 0}

func (Token) String

func (t Token) String() string

type TokenType

type TokenType int8

Directories

Path Synopsis
wild implements the pattern matching for IRC wildcard expressions.
wild implements the pattern matching for IRC wildcard expressions.

Jump to

Keyboard shortcuts

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