func (token *Token) AddBracket(s rune, bracket rune) (ok bool, isComplete bool, retry bool, err error) {
	if s == bracket {
		ok = true
		isComplete = true
		stat := token.Stat
		stat.Values = append(stat.Values, bracket)
	}
	return
}
AddBracket for token
package expression
import (
	"fmt"
	"log"
	"sort"
	"strconv"
	"unicode"
	"github.com/fefit/fet/types"
	"github.com/fefit/fet/utils"
)
type Indexs = types.Indexs
type Type int
type Runes []rune
type Flags map[string]bool
type Operator struct {
	Runes    Runes
	Priority int
}
type Expression struct {
	Parser  *Parser
	Initial bool
}
type Node struct {
	Left      *Node     
	Right     *Node     
	Root      *Node     
	Token     AnyToken  
	Type      string    
	Operator  string    
	Arguments []*Node   
	Function  *Node     
}
type OperatorList struct {
	Keys   []string
	Values map[string]*Operator
}
const (
	Quote              = '"'
	LeftRoundBracket   = '('
	RightRoundBracket  = ')'
	LeftSquareBracket  = '['
	RightSquareBracket = ']'
	Minus              = '-'
	Plus               = '+'
	Underline          = '_'
	Translate          = '\\'
	Space              = ' '
	Bitor              = "bitor"
	Dollar             = '$'
	VarSymbol          = '`'
)
var (
	operators = [][]string{
		{","},
		{"||"},
		{"&&"},
		{Bitor},
		{"^"},
		{"&"},
		{"==", "!="},
		{">=", "<=", "<", ">"},
		{"+", "-"},
		{"*", "/", "%"},
		{"**"},
		{"!"},
		{".", "|", ":", "(", ")", "[", "]"},
	}
	keywordOperators = map[string]string{
		"bitor": "bitor",
		"and":   "&&",
		"or":    "||",
		"not":   "!",
		"eq":    "==",
		"ne":    "!=",
		"lt":    "<",
		"le":    "<=",
		"gt":    ">",
		"ge":    ">=",
	}
	operatorList = func() OperatorList {
		preIndex := 8      
		ignoreIndex := 12  
		keys, values := []string{}, map[string]*Operator{}
		keys = append(keys, operators[preIndex]...)
		for i, total := 0, len(operators); i < total; i++ {
			ops := operators[i]
			for j, count := 0, len(ops); j < count; j++ {
				key := ops[j]
				values[key] = &Operator{
					Priority: i,
					Runes:    Runes(key),
				}
				if i == preIndex || (i == ignoreIndex && j > 2) {
					continue
				}
				keys = append(keys, key)
			}
		}
		return OperatorList{
			Keys:   keys,
			Values: values,
		}
	}()
	bases = map[rune]int{
		'b': 2,
		'o': 8,
		'x': 16,
	}
)
type Any interface{}
type AnyToken interface {
	Add(s rune) (bool, bool, bool, error)
	Validate(prevTokens []AnyToken) (AnyToken, error)
	SetStat(stat *TokenStat)
	GetStat() *TokenStat
}
func typeOf(token Any) string {
	name := fmt.Sprintf("%T", token)
	rns := Runes(name)
	total := len(rns)
	for total >= 0 {
		total--
		if r := rns[total]; r == '.' {
			break
		}
	}
	return string(rns[total+1:])
}
func getNoSpaceTokens(tokens []AnyToken, num int) (isPrevSpace bool, result []AnyToken) {
	isTwo := num == 2
	if num != 1 && !isTwo {
		log.Fatal("wrong num argments:getNoSpaceTokens")
	}
	prevs := getPrevTokens(tokens, num*2)
	p0, p1 := prevs[0], prevs[1]
	val, match := p0, p1
	if _, isSpace := p0.(*SpaceToken); isSpace {
		val = p1
		isPrevSpace = true
		if isTwo {
			p2, p3 := prevs[2], prevs[3]
			if _, isStillSpace := p2.(*SpaceToken); isStillSpace {
				match = p3
			} else {
				match = p2
			}
		}
	}
	result = append(result, val)
	if isTwo {
		result = append(result, match)
	}
	return
}
type TokenStat struct {
	StartIndex int
	Index      int
	ParseIndex int
	RBLevel    int
	RBSubLevel int
	SBLevel    int
	SBSubLevel int
	Logics     Flags
	Context    *Runes
	Values     Runes
}
type Token struct {
	IsComplete bool
	IsBegin    bool
	Stat       *TokenStat
}
type ValidateNextFn func(token AnyToken) error
func getPrevTokens(tokens []AnyToken, num int) []AnyToken {
	i, count, prevTokens := 1, len(tokens), []AnyToken{}
	for i <= num {
		if count >= i {
			prevTokens = append(prevTokens, tokens[count-i])
		} else {
			prevTokens = append(prevTokens, nil)
		}
		i++
	}
	return prevTokens
}
func (token *Token) GetStat() *TokenStat {
	return token.Stat
}
func (token *Token) Validate(tokens []AnyToken) (retryToken AnyToken, err error) {
	return
}
func (token *Token) Judge() (ok bool, isComplete bool, retry bool, err error) {
	if token.IsBegin {
		token.IsComplete = true
		isComplete = true
	}
	return
}