token

package
v3.14.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 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