lexer

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 12, 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

func Lex

func Lex(input string) chan Token

Types

type Space added in v0.2.1

type Space struct {
	String          string
	ContainsNewline bool
}

type Token

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

func (Token) Is

func (t Token) Is(ty TokenType) bool

func (Token) IsString added in v0.2.1

func (t Token) IsString(ty TokenType, s string) bool

type TokenType

type TokenType uint8
const (
	TokenError TokenType = iota
	TokenEOF
	TokenSpace
	TokenNumber
	TokenIdentifier
	TokenString
	TokenPlus
	TokenMinus
	TokenStar
	TokenSlash
	TokenPercent
	TokenNilCoalesce
	TokenParenOpen
	TokenParenClose
	TokenBraceOpen
	TokenBraceClose
	TokenBracketOpen
	TokenBracketClose
	TokenQuestionMark
	TokenComma
	TokenColon
	TokenDot
	TokenSemicolon
	TokenLeftArrow
	TokenLeftArrowExclamation
	TokenLess
	TokenLessEqual
	TokenLessLess
	TokenGreater
	TokenGreaterEqual
	TokenGreaterGreater
	TokenEqual
	TokenEqualEqual
	TokenNot
	TokenNotEqual
	TokenBlockCommentStart
	TokenBlockCommentContent
	TokenBlockCommentEnd
	TokenAmpersand
	TokenAmpersandAmpersand
	TokenCaret
	TokenVerticalBar
	TokenVerticalBarVerticalBar
	TokenAt
)

func (TokenType) String

func (t TokenType) String() string

Jump to

Keyboard shortcuts

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