parser

package
v3.1.0-fork Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrPatternNotMatch represents an error that patterns doesn't match.
	ErrPatternNotMatch = errors.New("Pattern not match")
)

Functions

func AnyChar

func AnyChar(buf string) (string, error)

AnyChar matches an arbitrary character

func AnyPunct

func AnyPunct(buf string) (string, error)

AnyPunct matches an arbitrary punctuation

func Char

func Char(buf string, c byte) (string, error)

Char matches a character: c

func Digit

func Digit(buf string, times int) (string, string, error)

Digit matches at least `times` digits

func GetDefaultDB

func GetDefaultDB(sel ast.StmtNode, dbName string) string

GetDefaultDB checks if all columns in the AST have explicit DBName. If not, return specified DBName.

func Match

func Match(buf string, pat func(byte) bool, times int) (string, string, error)

Match matches the `pat` at least `times`, and returns the match, the rest and the error

func MatchOne

func MatchOne(buf string, pat func(byte) bool) (string, error)

MatchOne matches only one time with pat

func Number

func Number(str string) (int, string, error)

Number matches a series of digits and convert it to an int

func Space

func Space(buf string, times int) (string, error)

Space matches at least `times` spaces

func Space0

func Space0(buf string) string

Space0 matches at least 0 space.

Types

This section is empty.

Jump to

Keyboard shortcuts

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