Help us shape the future of Go! Take the 2026 Go Developer Survey

lexer

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const EOF rune = -1

Variables

This section is empty.

Functions

This section is empty.

Types

type Token

type Token struct {
	Type  TokenType
	Value interface{}
	Range ast.Range
}

func Lex

func Lex(input string) []Token

func (Token) Is

func (t Token) Is(ty TokenType) bool

type TokenType

type TokenType uint8
const (
	TokenError TokenType = iota
	TokenEOF
	TokenSpace
	TokenNumber
	TokenOperatorPlus
	TokenOperatorMinus
	TokenOperatorMul
	TokenOperatorDiv
	TokenOperatorNilCoalesce
	TokenParenOpen
	TokenParenClose
	TokenBraceOpen
	TokenBraceClose
	TokenBracketOpen
	TokenBracketClose
)

func (TokenType) String

func (i TokenType) String() string

Jump to

Keyboard shortcuts

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