tidb: github.com/pingcap/tidb/util/parser Index | Files

package parser

import "github.com/pingcap/tidb/util/parser"


Package Files

ast.go parser.go


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

func AnyChar Uses

func AnyChar(buf string) (string, error)

AnyChar matches an arbitrary character

func AnyPunct Uses

func AnyPunct(buf string) (string, error)

AnyPunct matches an arbitrary punctuation

func Char Uses

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

Char matches a character: c

func Digit Uses

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

Digit matches at least `times` digits

func GetDefaultDB Uses

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 Uses

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 Uses

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

MatchOne matches only one time with pat

func Number Uses

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

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

func Space Uses

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

Space matches at least `times` spaces

func Space0 Uses

func Space0(buf string) string

Space0 matches at least 0 space.

Package parser imports 4 packages (graph) and is imported by 6 packages. Updated 2020-06-01. Refresh now. Tools for package owners.