lexer

package
v0.0.0-...-0e995ac Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Kind

type Kind int
const (
	KindError Kind = iota
	// Represents raw text in a template
	KindText
	KindEOF
	KindLeftDelim
	KindRightDelim
	KindIdentifier
	KindDot
	KindHash
	KindSpace
	KindBang
	KindEqual
	KindIf
	KindNil
	KindElse
	KindEnd
	KindTrue
	KindFalse
	KindVariable
	KindIn
	KindRange
	KindComma
	KindString
	KindNumber
	KindMinus
	KindPlus
	KindAsterisk
	KindSlash
	KindPercent
	KindOpenParen
	KindCloseParen
	KindOpenCurly
	KindCloseCurly
	KindColon
	KindOpenBracket
	KindCloseBracket
	KindOpenAngle
	KindCloseAngle
)

func (Kind) String

func (k Kind) String() string

type Lexer

type Lexer struct {
	Input string

	Tokens    []Token
	Line      int
	StartLine int
	// contains filtered or unexported fields
}

func Lex

func Lex(input string) *Lexer

type Token

type Token struct {
	Kind      Kind
	Value     string
	StartLine int
	EndLine   int
}

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