lexer

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TokenKindString

func TokenKindString(kind TokenKind) string

Types

type Error

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

func NewLexerError

func NewLexerError(format string, a ...any) *Error

func (*Error) Error

func (e *Error) Error() string

type Token

type Token struct {
	Kind  TokenKind
	Value string
}

func Tokenize

func Tokenize(source *string) ([]Token, error)

func (Token) Debug

func (token Token) Debug() string

type TokenKind

type TokenKind int
const (
	EOF TokenKind = iota
	Number
	String
	Identifier

	// Grouping & Braces.
	OpenParen
	CloseParen

	// Equivilance.
	Equals
	NotEquals

	// Conditional.
	Less
	LessEquals
	Greater
	GreaterEquals

	// Symbols.
	Dot
	Comma

	// Reserved Keywords.
	In //nolint:varnamelen
	Not
	Like
	ILike
	And
)

Jump to

Keyboard shortcuts

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