pql

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2020 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EOF                = errors.New("EOF")
	ErrInvalidEscape   = errors.New("Invalid escape sequence")
	ErrInvalidIdent    = errors.New("Invalid identifier")
	ErrInvalidQName    = errors.New("Invalid qualified name")
	ErrUnexpectedToken = errors.New("Unexpected token")
	ErrUnexpectedEOF   = errors.New("Unexpected end-of-file")
)

Functions

This section is empty.

Types

type Context

type Context struct {
	Columns []string
	Vars    map[string]interface{}
}

type Error

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

func (Error) Error

func (e Error) Error() string

type Node

type Node interface {
	Exec(io.Writer, Context) error
	Span() Span
}

type Program

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

func Parse

func Parse(t string) (*Program, error)

func (Program) Exec

func (p Program) Exec(w io.Writer, cxt Context) error

func (Program) Span

func (n Program) Span() Span

func (Program) Text

func (p Program) Text(cxt Context) (string, error)

type Scanner

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

func NewScanner

func NewScanner(t string) *Scanner

func (*Scanner) Backup

func (s *Scanner) Backup() *Scanner

func (*Scanner) Next

func (s *Scanner) Next() rune

func (*Scanner) Peek

func (s *Scanner) Peek() rune

func (*Scanner) Skip

func (s *Scanner) Skip(f func(rune) bool) int

func (*Scanner) SkipWhite

func (s *Scanner) SkipWhite() *Scanner

func (*Scanner) Step

func (s *Scanner) Step() *Scanner

func (*Scanner) Substr

func (s *Scanner) Substr(l, u int) string

func (*Scanner) Text

func (s *Scanner) Text() string

type Span

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

func Encompass

func Encompass(a ...Span) Span

func NewSpan

func NewSpan(t string, o, l int) Span

func (Span) Describe

func (s Span) Describe() string

func (Span) Excerpt

func (s Span) Excerpt() string

func (Span) String

func (s Span) String() string

Jump to

Keyboard shortcuts

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