search

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Expression

type Expression interface {
	String() string
}

func ParseQuery

func ParseQuery(input string) (expr Expression, err error)

type InfixExpression

type InfixExpression struct {
	Operator TokenType
	Left     Expression
	Right    Expression
}

func (InfixExpression) String

func (ie InfixExpression) String() string

type Lexer

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

func NewLexer

func NewLexer(input string) *Lexer

func (*Lexer) Next

func (l *Lexer) Next() Token

type Parser

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

func NewParser

func NewParser(l *Lexer) *Parser

type PrefixExpression

type PrefixExpression struct {
	Operator TokenType
	Right    Expression
}

func (PrefixExpression) String

func (pe PrefixExpression) String() string

type RegexpLiteral added in v0.4.0

type RegexpLiteral struct {
	*regexp.Regexp
}

func (RegexpLiteral) MarshalBinary added in v0.4.0

func (rl RegexpLiteral) MarshalBinary() ([]byte, error)

func (RegexpLiteral) String added in v0.7.0

func (rl RegexpLiteral) String() string

func (*RegexpLiteral) UnmarshalBinary added in v0.4.0

func (rl *RegexpLiteral) UnmarshalBinary(data []byte) error

type StringLiteral

type StringLiteral struct {
	Value string
}

func (StringLiteral) String

func (sl StringLiteral) String() string

type Token

type Token struct {
	Type    TokenType
	Literal string
}

type TokenType

type TokenType int
const (
	// Flow.
	TokInvalid TokenType = iota
	TokEOF
	TokParenOpen
	TokParenClose

	// Literals.
	TokString

	// Boolean operators.
	TokOpNot
	TokOpAnd
	TokOpOr

	// Comparison operators.
	TokOpEq
	TokOpNotEq
	TokOpGt
	TokOpLt
	TokOpGtEq
	TokOpLtEq
	TokOpRe
	TokOpNotRe
)

Token types.

func (TokenType) String

func (tt TokenType) String() string

Jump to

Keyboard shortcuts

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