token

package
v3.9.9 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ERROR     = "ERROR"
	EOF       = "EOF"
	IDENT     = "IDENT"
	INT       = "INT"
	LBRACKET  = "LBRACKET"
	RBRACKET  = "RBRACKET"
	SEPARATOR = "SEPARATOR"
	GLOB      = "GLOB"
	COLON     = "COLON"
)

The set of Token types.

Variables

View Source
var (
	ErrUnterminatedString = errors.New("unterminated string")
	ErrInvalidCharacter   = errors.New("invalid character")
)

Base errors for scanning strings.

Functions

This section is empty.

Types

type ScanError

type ScanError struct {
	Inner    error
	Position int
}

func (ScanError) Error

func (e ScanError) Error() string

func (ScanError) Unwrap

func (e ScanError) Unwrap() error

Unwrap allows errors.Is() to inspect the underlying error.

type Scanner

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

func NewScanner

func NewScanner(input string) *Scanner

func (*Scanner) Next

func (s *Scanner) Next() Token

type Token

type Token struct {
	Type    Type
	Literal string
}

func (Token) String

func (t Token) String() string

type Type

type Type string

Jump to

Keyboard shortcuts

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