lexer

package
v0.0.0-...-40e63e7 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TokenEnd = iota
	TokenAngleLeft
	TokenAngleRight
	TokenMinus
	TokenPlus
	TokenClose
	TokenComment
	TokenEqual
	TokenEscape
	TokenIdentifier
	TokenOpen
	TokenQuote
	TokenSeparator
	TokenStop
	TokenVariable
	TokenWhitespace
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Scanner

type Scanner struct {
	// contains filtered or unexported fields
}

Scanner represents a lexical scanner.

func NewScanner

func NewScanner(r io.Reader) *Scanner

NewScanner returns a new instance of Scanner.

func (*Scanner) Scan

func (s *Scanner) Scan() (class int, lit string)

Scan returns the next token and literal value.

func (*Scanner) ScanIgnoreWhitespace

func (s *Scanner) ScanIgnoreWhitespace() (tok int, lit string)

ScanIgnoreWhitespace scans the next non-whitespace token.

Jump to

Keyboard shortcuts

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