lexer

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAlphaNumeric

func IsAlphaNumeric(r rune) bool

func IsAlphabetic

func IsAlphabetic(r rune) bool

func IsSpace

func IsSpace(r rune) bool

Types

type Kind

type Kind string
const (
	Identifier Kind = "Identifier"
	Number     Kind = "Number"
	String     Kind = "String"
	Operator   Kind = "Operator"
	Bracket    Kind = "Bracket"
	EOF        Kind = "EOF"
)

type Token

type Token struct {
	file.Location
	Kind  Kind
	Value string
}

func Lex

func Lex(source *file.Source) ([]Token, error)

func (Token) Is

func (t Token) Is(kind Kind, values ...string) bool

func (Token) String

func (t Token) String() string

Jump to

Keyboard shortcuts

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