lexer

package
v1.5.10 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Identifier Kind = "Identifier"
	Number          = "Number"
	String          = "String"
	Operator        = "Operator"
	Bracket         = "Bracket"
	EOF             = "EOF"
)

Variables

This section is empty.

Functions

func IsAlphaNumeric added in v1.5.9

func IsAlphaNumeric(r rune) bool

func IsAlphabetic added in v1.5.9

func IsAlphabetic(r rune) bool

func IsSpace added in v1.5.9

func IsSpace(r rune) bool

Types

type Kind

type Kind string

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