lexer

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Kind

type Kind int
const (
	KindUnknown Kind = iota
	KindEOF
	KindSpace
	KindNewline
	KindIdentifier
	KindPlaceholder
	KindNamedPlaceholder
	KindString
	KindNumber
	KindSymbol
	KindComment
)

func (Kind) String

func (k Kind) String() string

type LexError

type LexError struct {
	Pos int
	Err error
}

func (*LexError) Error

func (e *LexError) Error() string

func (*LexError) Unwrap

func (e *LexError) Unwrap() error

type Lexer

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

func NewLexer

func NewLexer(input string) *Lexer

func (*Lexer) Lex

func (l *Lexer) Lex() (Tokens, error)

type Token

type Token struct {
	Kind  Kind
	Value string
}

type Tokens

type Tokens []Token

func (Tokens) String

func (ts Tokens) String() string

Jump to

Keyboard shortcuts

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