github.com/number571/tendermint@v0.34.11-gost/libs/pubsub/query/query.peg.go (about)

     1  // nolint
     2  package query
     3  
     4  import (
     5  	"fmt"
     6  	"math"
     7  	"sort"
     8  	"strconv"
     9  )
    10  
    11  const endSymbol rune = 1114112
    12  
    13  /* The rule types inferred from the grammar are below. */
    14  type pegRule uint8
    15  
    16  const (
    17  	ruleUnknown pegRule = iota
    18  	rulee
    19  	rulecondition
    20  	ruletag
    21  	rulevalue
    22  	rulenumber
    23  	ruledigit
    24  	ruletime
    25  	ruledate
    26  	ruleyear
    27  	rulemonth
    28  	ruleday
    29  	ruleand
    30  	ruleequal
    31  	rulecontains
    32  	ruleexists
    33  	rulele
    34  	rulege
    35  	rulel
    36  	ruleg
    37  	rulePegText
    38  
    39  	rulePre
    40  	ruleIn
    41  	ruleSuf
    42  )
    43  
    44  var rul3s = [...]string{
    45  	"Unknown",
    46  	"e",
    47  	"condition",
    48  	"tag",
    49  	"value",
    50  	"number",
    51  	"digit",
    52  	"time",
    53  	"date",
    54  	"year",
    55  	"month",
    56  	"day",
    57  	"and",
    58  	"equal",
    59  	"contains",
    60  	"exists",
    61  	"le",
    62  	"ge",
    63  	"l",
    64  	"g",
    65  	"PegText",
    66  
    67  	"Pre_",
    68  	"_In_",
    69  	"_Suf",
    70  }
    71  
    72  type node32 struct {
    73  	token32
    74  	up, next *node32
    75  }
    76  
    77  func (node *node32) print(depth int, buffer string) {
    78  	for node != nil {
    79  		for c := 0; c < depth; c++ {
    80  			fmt.Printf(" ")
    81  		}
    82  		fmt.Printf("\x1B[34m%v\x1B[m %v\n", rul3s[node.pegRule], strconv.Quote(string(([]rune(buffer)[node.begin:node.end]))))
    83  		if node.up != nil {
    84  			node.up.print(depth+1, buffer)
    85  		}
    86  		node = node.next
    87  	}
    88  }
    89  
    90  func (node *node32) Print(buffer string) {
    91  	node.print(0, buffer)
    92  }
    93  
    94  type element struct {
    95  	node *node32
    96  	down *element
    97  }
    98  
    99  /* ${@} bit structure for abstract syntax tree */
   100  type token32 struct {
   101  	pegRule
   102  	begin, end, next uint32
   103  }
   104  
   105  func (t *token32) isZero() bool {
   106  	return t.pegRule == ruleUnknown && t.begin == 0 && t.end == 0 && t.next == 0
   107  }
   108  
   109  func (t *token32) isParentOf(u token32) bool {
   110  	return t.begin <= u.begin && t.end >= u.end && t.next > u.next
   111  }
   112  
   113  func (t *token32) getToken32() token32 {
   114  	return token32{pegRule: t.pegRule, begin: uint32(t.begin), end: uint32(t.end), next: uint32(t.next)}
   115  }
   116  
   117  func (t *token32) String() string {
   118  	return fmt.Sprintf("\x1B[34m%v\x1B[m %v %v %v", rul3s[t.pegRule], t.begin, t.end, t.next)
   119  }
   120  
   121  type tokens32 struct {
   122  	tree    []token32
   123  	ordered [][]token32
   124  }
   125  
   126  func (t *tokens32) trim(length int) {
   127  	t.tree = t.tree[0:length]
   128  }
   129  
   130  func (t *tokens32) Print() {
   131  	for _, token := range t.tree {
   132  		fmt.Println(token.String())
   133  	}
   134  }
   135  
   136  func (t *tokens32) Order() [][]token32 {
   137  	if t.ordered != nil {
   138  		return t.ordered
   139  	}
   140  
   141  	depths := make([]int32, 1, math.MaxInt16)
   142  	for i, token := range t.tree {
   143  		if token.pegRule == ruleUnknown {
   144  			t.tree = t.tree[:i]
   145  			break
   146  		}
   147  		depth := int(token.next)
   148  		if length := len(depths); depth >= length {
   149  			depths = depths[:depth+1]
   150  		}
   151  		depths[depth]++
   152  	}
   153  	depths = append(depths, 0)
   154  
   155  	ordered, pool := make([][]token32, len(depths)), make([]token32, len(t.tree)+len(depths))
   156  	for i, depth := range depths {
   157  		depth++
   158  		ordered[i], pool, depths[i] = pool[:depth], pool[depth:], 0
   159  	}
   160  
   161  	for i, token := range t.tree {
   162  		depth := token.next
   163  		token.next = uint32(i)
   164  		ordered[depth][depths[depth]] = token
   165  		depths[depth]++
   166  	}
   167  	t.ordered = ordered
   168  	return ordered
   169  }
   170  
   171  type state32 struct {
   172  	token32
   173  	depths []int32
   174  	leaf   bool
   175  }
   176  
   177  func (t *tokens32) AST() *node32 {
   178  	tokens := t.Tokens()
   179  	stack := &element{node: &node32{token32: <-tokens}}
   180  	for token := range tokens {
   181  		if token.begin == token.end {
   182  			continue
   183  		}
   184  		node := &node32{token32: token}
   185  		for stack != nil && stack.node.begin >= token.begin && stack.node.end <= token.end {
   186  			stack.node.next = node.up
   187  			node.up = stack.node
   188  			stack = stack.down
   189  		}
   190  		stack = &element{node: node, down: stack}
   191  	}
   192  	return stack.node
   193  }
   194  
   195  func (t *tokens32) PreOrder() (<-chan state32, [][]token32) {
   196  	s, ordered := make(chan state32, 6), t.Order()
   197  	go func() {
   198  		var states [8]state32
   199  		for i := range states {
   200  			states[i].depths = make([]int32, len(ordered))
   201  		}
   202  		depths, state, depth := make([]int32, len(ordered)), 0, 1
   203  		write := func(t token32, leaf bool) {
   204  			S := states[state]
   205  			state, S.pegRule, S.begin, S.end, S.next, S.leaf = (state+1)%8, t.pegRule, t.begin, t.end, uint32(depth), leaf
   206  			copy(S.depths, depths)
   207  			s <- S
   208  		}
   209  
   210  		states[state].token32 = ordered[0][0]
   211  		depths[0]++
   212  		state++
   213  		a, b := ordered[depth-1][depths[depth-1]-1], ordered[depth][depths[depth]]
   214  	depthFirstSearch:
   215  		for {
   216  			for {
   217  				if i := depths[depth]; i > 0 {
   218  					if c, j := ordered[depth][i-1], depths[depth-1]; a.isParentOf(c) &&
   219  						(j < 2 || !ordered[depth-1][j-2].isParentOf(c)) {
   220  						if c.end != b.begin {
   221  							write(token32{pegRule: ruleIn, begin: c.end, end: b.begin}, true)
   222  						}
   223  						break
   224  					}
   225  				}
   226  
   227  				if a.begin < b.begin {
   228  					write(token32{pegRule: rulePre, begin: a.begin, end: b.begin}, true)
   229  				}
   230  				break
   231  			}
   232  
   233  			next := depth + 1
   234  			if c := ordered[next][depths[next]]; c.pegRule != ruleUnknown && b.isParentOf(c) {
   235  				write(b, false)
   236  				depths[depth]++
   237  				depth, a, b = next, b, c
   238  				continue
   239  			}
   240  
   241  			write(b, true)
   242  			depths[depth]++
   243  			c, parent := ordered[depth][depths[depth]], true
   244  			for {
   245  				if c.pegRule != ruleUnknown && a.isParentOf(c) {
   246  					b = c
   247  					continue depthFirstSearch
   248  				} else if parent && b.end != a.end {
   249  					write(token32{pegRule: ruleSuf, begin: b.end, end: a.end}, true)
   250  				}
   251  
   252  				depth--
   253  				if depth > 0 {
   254  					a, b, c = ordered[depth-1][depths[depth-1]-1], a, ordered[depth][depths[depth]]
   255  					parent = a.isParentOf(b)
   256  					continue
   257  				}
   258  
   259  				break depthFirstSearch
   260  			}
   261  		}
   262  
   263  		close(s)
   264  	}()
   265  	return s, ordered
   266  }
   267  
   268  func (t *tokens32) PrintSyntax() {
   269  	tokens, ordered := t.PreOrder()
   270  	max := -1
   271  	for token := range tokens {
   272  		if !token.leaf {
   273  			fmt.Printf("%v", token.begin)
   274  			for i, leaf, depths := 0, int(token.next), token.depths; i < leaf; i++ {
   275  				fmt.Printf(" \x1B[36m%v\x1B[m", rul3s[ordered[i][depths[i]-1].pegRule])
   276  			}
   277  			fmt.Printf(" \x1B[36m%v\x1B[m\n", rul3s[token.pegRule])
   278  		} else if token.begin == token.end {
   279  			fmt.Printf("%v", token.begin)
   280  			for i, leaf, depths := 0, int(token.next), token.depths; i < leaf; i++ {
   281  				fmt.Printf(" \x1B[31m%v\x1B[m", rul3s[ordered[i][depths[i]-1].pegRule])
   282  			}
   283  			fmt.Printf(" \x1B[31m%v\x1B[m\n", rul3s[token.pegRule])
   284  		} else {
   285  			for c, end := token.begin, token.end; c < end; c++ {
   286  				if i := int(c); max+1 < i {
   287  					for j := max; j < i; j++ {
   288  						fmt.Printf("skip %v %v\n", j, token.String())
   289  					}
   290  					max = i
   291  				} else if i := int(c); i <= max {
   292  					for j := i; j <= max; j++ {
   293  						fmt.Printf("dupe %v %v\n", j, token.String())
   294  					}
   295  				} else {
   296  					max = int(c)
   297  				}
   298  				fmt.Printf("%v", c)
   299  				for i, leaf, depths := 0, int(token.next), token.depths; i < leaf; i++ {
   300  					fmt.Printf(" \x1B[34m%v\x1B[m", rul3s[ordered[i][depths[i]-1].pegRule])
   301  				}
   302  				fmt.Printf(" \x1B[34m%v\x1B[m\n", rul3s[token.pegRule])
   303  			}
   304  			fmt.Printf("\n")
   305  		}
   306  	}
   307  }
   308  
   309  func (t *tokens32) PrintSyntaxTree(buffer string) {
   310  	tokens, _ := t.PreOrder()
   311  	for token := range tokens {
   312  		for c := 0; c < int(token.next); c++ {
   313  			fmt.Printf(" ")
   314  		}
   315  		fmt.Printf("\x1B[34m%v\x1B[m %v\n", rul3s[token.pegRule], strconv.Quote(string(([]rune(buffer)[token.begin:token.end]))))
   316  	}
   317  }
   318  
   319  func (t *tokens32) Add(rule pegRule, begin, end, depth uint32, index int) {
   320  	t.tree[index] = token32{pegRule: rule, begin: uint32(begin), end: uint32(end), next: uint32(depth)}
   321  }
   322  
   323  func (t *tokens32) Tokens() <-chan token32 {
   324  	s := make(chan token32, 16)
   325  	go func() {
   326  		for _, v := range t.tree {
   327  			s <- v.getToken32()
   328  		}
   329  		close(s)
   330  	}()
   331  	return s
   332  }
   333  
   334  func (t *tokens32) Error() []token32 {
   335  	ordered := t.Order()
   336  	length := len(ordered)
   337  	tokens, length := make([]token32, length), length-1
   338  	for i := range tokens {
   339  		o := ordered[length-i]
   340  		if len(o) > 1 {
   341  			tokens[i] = o[len(o)-2].getToken32()
   342  		}
   343  	}
   344  	return tokens
   345  }
   346  
   347  func (t *tokens32) Expand(index int) {
   348  	tree := t.tree
   349  	if index >= len(tree) {
   350  		expanded := make([]token32, 2*len(tree))
   351  		copy(expanded, tree)
   352  		t.tree = expanded
   353  	}
   354  }
   355  
   356  type QueryParser struct {
   357  	Buffer string
   358  	buffer []rune
   359  	rules  [21]func() bool
   360  	Parse  func(rule ...int) error
   361  	Reset  func()
   362  	Pretty bool
   363  	tokens32
   364  }
   365  
   366  type textPosition struct {
   367  	line, symbol int
   368  }
   369  
   370  type textPositionMap map[int]textPosition
   371  
   372  func translatePositions(buffer []rune, positions []int) textPositionMap {
   373  	length, translations, j, line, symbol := len(positions), make(textPositionMap, len(positions)), 0, 1, 0
   374  	sort.Ints(positions)
   375  
   376  search:
   377  	for i, c := range buffer {
   378  		if c == '\n' {
   379  			line, symbol = line+1, 0
   380  		} else {
   381  			symbol++
   382  		}
   383  		if i == positions[j] {
   384  			translations[positions[j]] = textPosition{line, symbol}
   385  			for j++; j < length; j++ {
   386  				if i != positions[j] {
   387  					continue search
   388  				}
   389  			}
   390  			break search
   391  		}
   392  	}
   393  
   394  	return translations
   395  }
   396  
   397  type parseError struct {
   398  	p   *QueryParser
   399  	max token32
   400  }
   401  
   402  func (e *parseError) Error() string {
   403  	tokens, error := []token32{e.max}, "\n"
   404  	positions, p := make([]int, 2*len(tokens)), 0
   405  	for _, token := range tokens {
   406  		positions[p], p = int(token.begin), p+1
   407  		positions[p], p = int(token.end), p+1
   408  	}
   409  	translations := translatePositions(e.p.buffer, positions)
   410  	format := "parse error near %v (line %v symbol %v - line %v symbol %v):\n%v\n"
   411  	if e.p.Pretty {
   412  		format = "parse error near \x1B[34m%v\x1B[m (line %v symbol %v - line %v symbol %v):\n%v\n"
   413  	}
   414  	for _, token := range tokens {
   415  		begin, end := int(token.begin), int(token.end)
   416  		error += fmt.Sprintf(format,
   417  			rul3s[token.pegRule],
   418  			translations[begin].line, translations[begin].symbol,
   419  			translations[end].line, translations[end].symbol,
   420  			strconv.Quote(string(e.p.buffer[begin:end])))
   421  	}
   422  
   423  	return error
   424  }
   425  
   426  func (p *QueryParser) PrintSyntaxTree() {
   427  	p.tokens32.PrintSyntaxTree(p.Buffer)
   428  }
   429  
   430  func (p *QueryParser) Highlighter() {
   431  	p.PrintSyntax()
   432  }
   433  
   434  func (p *QueryParser) Init() {
   435  	p.buffer = []rune(p.Buffer)
   436  	if len(p.buffer) == 0 || p.buffer[len(p.buffer)-1] != endSymbol {
   437  		p.buffer = append(p.buffer, endSymbol)
   438  	}
   439  
   440  	tree := tokens32{tree: make([]token32, math.MaxInt16)}
   441  	var max token32
   442  	position, depth, tokenIndex, buffer, _rules := uint32(0), uint32(0), 0, p.buffer, p.rules
   443  
   444  	p.Parse = func(rule ...int) error {
   445  		r := 1
   446  		if len(rule) > 0 {
   447  			r = rule[0]
   448  		}
   449  		matches := p.rules[r]()
   450  		p.tokens32 = tree
   451  		if matches {
   452  			p.trim(tokenIndex)
   453  			return nil
   454  		}
   455  		return &parseError{p, max}
   456  	}
   457  
   458  	p.Reset = func() {
   459  		position, tokenIndex, depth = 0, 0, 0
   460  	}
   461  
   462  	add := func(rule pegRule, begin uint32) {
   463  		tree.Expand(tokenIndex)
   464  		tree.Add(rule, begin, position, depth, tokenIndex)
   465  		tokenIndex++
   466  		if begin != position && position > max.end {
   467  			max = token32{rule, begin, position, depth}
   468  		}
   469  	}
   470  
   471  	matchDot := func() bool {
   472  		if buffer[position] != endSymbol {
   473  			position++
   474  			return true
   475  		}
   476  		return false
   477  	}
   478  
   479  	/*matchChar := func(c byte) bool {
   480  		if buffer[position] == c {
   481  			position++
   482  			return true
   483  		}
   484  		return false
   485  	}*/
   486  
   487  	/*matchRange := func(lower byte, upper byte) bool {
   488  		if c := buffer[position]; c >= lower && c <= upper {
   489  			position++
   490  			return true
   491  		}
   492  		return false
   493  	}*/
   494  
   495  	_rules = [...]func() bool{
   496  		nil,
   497  		/* 0 e <- <('"' condition (' '+ and ' '+ condition)* '"' !.)> */
   498  		func() bool {
   499  			position0, tokenIndex0, depth0 := position, tokenIndex, depth
   500  			{
   501  				position1 := position
   502  				depth++
   503  				if buffer[position] != rune('"') {
   504  					goto l0
   505  				}
   506  				position++
   507  				if !_rules[rulecondition]() {
   508  					goto l0
   509  				}
   510  			l2:
   511  				{
   512  					position3, tokenIndex3, depth3 := position, tokenIndex, depth
   513  					if buffer[position] != rune(' ') {
   514  						goto l3
   515  					}
   516  					position++
   517  				l4:
   518  					{
   519  						position5, tokenIndex5, depth5 := position, tokenIndex, depth
   520  						if buffer[position] != rune(' ') {
   521  							goto l5
   522  						}
   523  						position++
   524  						goto l4
   525  					l5:
   526  						position, tokenIndex, depth = position5, tokenIndex5, depth5
   527  					}
   528  					{
   529  						position6 := position
   530  						depth++
   531  						{
   532  							position7, tokenIndex7, depth7 := position, tokenIndex, depth
   533  							if buffer[position] != rune('a') {
   534  								goto l8
   535  							}
   536  							position++
   537  							goto l7
   538  						l8:
   539  							position, tokenIndex, depth = position7, tokenIndex7, depth7
   540  							if buffer[position] != rune('A') {
   541  								goto l3
   542  							}
   543  							position++
   544  						}
   545  					l7:
   546  						{
   547  							position9, tokenIndex9, depth9 := position, tokenIndex, depth
   548  							if buffer[position] != rune('n') {
   549  								goto l10
   550  							}
   551  							position++
   552  							goto l9
   553  						l10:
   554  							position, tokenIndex, depth = position9, tokenIndex9, depth9
   555  							if buffer[position] != rune('N') {
   556  								goto l3
   557  							}
   558  							position++
   559  						}
   560  					l9:
   561  						{
   562  							position11, tokenIndex11, depth11 := position, tokenIndex, depth
   563  							if buffer[position] != rune('d') {
   564  								goto l12
   565  							}
   566  							position++
   567  							goto l11
   568  						l12:
   569  							position, tokenIndex, depth = position11, tokenIndex11, depth11
   570  							if buffer[position] != rune('D') {
   571  								goto l3
   572  							}
   573  							position++
   574  						}
   575  					l11:
   576  						depth--
   577  						add(ruleand, position6)
   578  					}
   579  					if buffer[position] != rune(' ') {
   580  						goto l3
   581  					}
   582  					position++
   583  				l13:
   584  					{
   585  						position14, tokenIndex14, depth14 := position, tokenIndex, depth
   586  						if buffer[position] != rune(' ') {
   587  							goto l14
   588  						}
   589  						position++
   590  						goto l13
   591  					l14:
   592  						position, tokenIndex, depth = position14, tokenIndex14, depth14
   593  					}
   594  					if !_rules[rulecondition]() {
   595  						goto l3
   596  					}
   597  					goto l2
   598  				l3:
   599  					position, tokenIndex, depth = position3, tokenIndex3, depth3
   600  				}
   601  				if buffer[position] != rune('"') {
   602  					goto l0
   603  				}
   604  				position++
   605  				{
   606  					position15, tokenIndex15, depth15 := position, tokenIndex, depth
   607  					if !matchDot() {
   608  						goto l15
   609  					}
   610  					goto l0
   611  				l15:
   612  					position, tokenIndex, depth = position15, tokenIndex15, depth15
   613  				}
   614  				depth--
   615  				add(rulee, position1)
   616  			}
   617  			return true
   618  		l0:
   619  			position, tokenIndex, depth = position0, tokenIndex0, depth0
   620  			return false
   621  		},
   622  		/* 1 condition <- <(tag ' '* ((le ' '* ((&('D' | 'd') date) | (&('T' | 't') time) | (&('0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9') number))) / (ge ' '* ((&('D' | 'd') date) | (&('T' | 't') time) | (&('0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9') number))) / ((&('E' | 'e') exists) | (&('=') (equal ' '* ((&('\'') value) | (&('D' | 'd') date) | (&('T' | 't') time) | (&('0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9') number)))) | (&('>') (g ' '* ((&('D' | 'd') date) | (&('T' | 't') time) | (&('0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9') number)))) | (&('<') (l ' '* ((&('D' | 'd') date) | (&('T' | 't') time) | (&('0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9') number)))) | (&('C' | 'c') (contains ' '* value)))))> */
   623  		func() bool {
   624  			position16, tokenIndex16, depth16 := position, tokenIndex, depth
   625  			{
   626  				position17 := position
   627  				depth++
   628  				{
   629  					position18 := position
   630  					depth++
   631  					{
   632  						position19 := position
   633  						depth++
   634  						{
   635  							position22, tokenIndex22, depth22 := position, tokenIndex, depth
   636  							{
   637  								switch buffer[position] {
   638  								case '<':
   639  									if buffer[position] != rune('<') {
   640  										goto l22
   641  									}
   642  									position++
   643  									break
   644  								case '>':
   645  									if buffer[position] != rune('>') {
   646  										goto l22
   647  									}
   648  									position++
   649  									break
   650  								case '=':
   651  									if buffer[position] != rune('=') {
   652  										goto l22
   653  									}
   654  									position++
   655  									break
   656  								case '\'':
   657  									if buffer[position] != rune('\'') {
   658  										goto l22
   659  									}
   660  									position++
   661  									break
   662  								case '"':
   663  									if buffer[position] != rune('"') {
   664  										goto l22
   665  									}
   666  									position++
   667  									break
   668  								case ')':
   669  									if buffer[position] != rune(')') {
   670  										goto l22
   671  									}
   672  									position++
   673  									break
   674  								case '(':
   675  									if buffer[position] != rune('(') {
   676  										goto l22
   677  									}
   678  									position++
   679  									break
   680  								case '\\':
   681  									if buffer[position] != rune('\\') {
   682  										goto l22
   683  									}
   684  									position++
   685  									break
   686  								case '\r':
   687  									if buffer[position] != rune('\r') {
   688  										goto l22
   689  									}
   690  									position++
   691  									break
   692  								case '\n':
   693  									if buffer[position] != rune('\n') {
   694  										goto l22
   695  									}
   696  									position++
   697  									break
   698  								case '\t':
   699  									if buffer[position] != rune('\t') {
   700  										goto l22
   701  									}
   702  									position++
   703  									break
   704  								default:
   705  									if buffer[position] != rune(' ') {
   706  										goto l22
   707  									}
   708  									position++
   709  									break
   710  								}
   711  							}
   712  
   713  							goto l16
   714  						l22:
   715  							position, tokenIndex, depth = position22, tokenIndex22, depth22
   716  						}
   717  						if !matchDot() {
   718  							goto l16
   719  						}
   720  					l20:
   721  						{
   722  							position21, tokenIndex21, depth21 := position, tokenIndex, depth
   723  							{
   724  								position24, tokenIndex24, depth24 := position, tokenIndex, depth
   725  								{
   726  									switch buffer[position] {
   727  									case '<':
   728  										if buffer[position] != rune('<') {
   729  											goto l24
   730  										}
   731  										position++
   732  										break
   733  									case '>':
   734  										if buffer[position] != rune('>') {
   735  											goto l24
   736  										}
   737  										position++
   738  										break
   739  									case '=':
   740  										if buffer[position] != rune('=') {
   741  											goto l24
   742  										}
   743  										position++
   744  										break
   745  									case '\'':
   746  										if buffer[position] != rune('\'') {
   747  											goto l24
   748  										}
   749  										position++
   750  										break
   751  									case '"':
   752  										if buffer[position] != rune('"') {
   753  											goto l24
   754  										}
   755  										position++
   756  										break
   757  									case ')':
   758  										if buffer[position] != rune(')') {
   759  											goto l24
   760  										}
   761  										position++
   762  										break
   763  									case '(':
   764  										if buffer[position] != rune('(') {
   765  											goto l24
   766  										}
   767  										position++
   768  										break
   769  									case '\\':
   770  										if buffer[position] != rune('\\') {
   771  											goto l24
   772  										}
   773  										position++
   774  										break
   775  									case '\r':
   776  										if buffer[position] != rune('\r') {
   777  											goto l24
   778  										}
   779  										position++
   780  										break
   781  									case '\n':
   782  										if buffer[position] != rune('\n') {
   783  											goto l24
   784  										}
   785  										position++
   786  										break
   787  									case '\t':
   788  										if buffer[position] != rune('\t') {
   789  											goto l24
   790  										}
   791  										position++
   792  										break
   793  									default:
   794  										if buffer[position] != rune(' ') {
   795  											goto l24
   796  										}
   797  										position++
   798  										break
   799  									}
   800  								}
   801  
   802  								goto l21
   803  							l24:
   804  								position, tokenIndex, depth = position24, tokenIndex24, depth24
   805  							}
   806  							if !matchDot() {
   807  								goto l21
   808  							}
   809  							goto l20
   810  						l21:
   811  							position, tokenIndex, depth = position21, tokenIndex21, depth21
   812  						}
   813  						depth--
   814  						add(rulePegText, position19)
   815  					}
   816  					depth--
   817  					add(ruletag, position18)
   818  				}
   819  			l26:
   820  				{
   821  					position27, tokenIndex27, depth27 := position, tokenIndex, depth
   822  					if buffer[position] != rune(' ') {
   823  						goto l27
   824  					}
   825  					position++
   826  					goto l26
   827  				l27:
   828  					position, tokenIndex, depth = position27, tokenIndex27, depth27
   829  				}
   830  				{
   831  					position28, tokenIndex28, depth28 := position, tokenIndex, depth
   832  					{
   833  						position30 := position
   834  						depth++
   835  						if buffer[position] != rune('<') {
   836  							goto l29
   837  						}
   838  						position++
   839  						if buffer[position] != rune('=') {
   840  							goto l29
   841  						}
   842  						position++
   843  						depth--
   844  						add(rulele, position30)
   845  					}
   846  				l31:
   847  					{
   848  						position32, tokenIndex32, depth32 := position, tokenIndex, depth
   849  						if buffer[position] != rune(' ') {
   850  							goto l32
   851  						}
   852  						position++
   853  						goto l31
   854  					l32:
   855  						position, tokenIndex, depth = position32, tokenIndex32, depth32
   856  					}
   857  					{
   858  						switch buffer[position] {
   859  						case 'D', 'd':
   860  							if !_rules[ruledate]() {
   861  								goto l29
   862  							}
   863  							break
   864  						case 'T', 't':
   865  							if !_rules[ruletime]() {
   866  								goto l29
   867  							}
   868  							break
   869  						default:
   870  							if !_rules[rulenumber]() {
   871  								goto l29
   872  							}
   873  							break
   874  						}
   875  					}
   876  
   877  					goto l28
   878  				l29:
   879  					position, tokenIndex, depth = position28, tokenIndex28, depth28
   880  					{
   881  						position35 := position
   882  						depth++
   883  						if buffer[position] != rune('>') {
   884  							goto l34
   885  						}
   886  						position++
   887  						if buffer[position] != rune('=') {
   888  							goto l34
   889  						}
   890  						position++
   891  						depth--
   892  						add(rulege, position35)
   893  					}
   894  				l36:
   895  					{
   896  						position37, tokenIndex37, depth37 := position, tokenIndex, depth
   897  						if buffer[position] != rune(' ') {
   898  							goto l37
   899  						}
   900  						position++
   901  						goto l36
   902  					l37:
   903  						position, tokenIndex, depth = position37, tokenIndex37, depth37
   904  					}
   905  					{
   906  						switch buffer[position] {
   907  						case 'D', 'd':
   908  							if !_rules[ruledate]() {
   909  								goto l34
   910  							}
   911  							break
   912  						case 'T', 't':
   913  							if !_rules[ruletime]() {
   914  								goto l34
   915  							}
   916  							break
   917  						default:
   918  							if !_rules[rulenumber]() {
   919  								goto l34
   920  							}
   921  							break
   922  						}
   923  					}
   924  
   925  					goto l28
   926  				l34:
   927  					position, tokenIndex, depth = position28, tokenIndex28, depth28
   928  					{
   929  						switch buffer[position] {
   930  						case 'E', 'e':
   931  							{
   932  								position40 := position
   933  								depth++
   934  								{
   935  									position41, tokenIndex41, depth41 := position, tokenIndex, depth
   936  									if buffer[position] != rune('e') {
   937  										goto l42
   938  									}
   939  									position++
   940  									goto l41
   941  								l42:
   942  									position, tokenIndex, depth = position41, tokenIndex41, depth41
   943  									if buffer[position] != rune('E') {
   944  										goto l16
   945  									}
   946  									position++
   947  								}
   948  							l41:
   949  								{
   950  									position43, tokenIndex43, depth43 := position, tokenIndex, depth
   951  									if buffer[position] != rune('x') {
   952  										goto l44
   953  									}
   954  									position++
   955  									goto l43
   956  								l44:
   957  									position, tokenIndex, depth = position43, tokenIndex43, depth43
   958  									if buffer[position] != rune('X') {
   959  										goto l16
   960  									}
   961  									position++
   962  								}
   963  							l43:
   964  								{
   965  									position45, tokenIndex45, depth45 := position, tokenIndex, depth
   966  									if buffer[position] != rune('i') {
   967  										goto l46
   968  									}
   969  									position++
   970  									goto l45
   971  								l46:
   972  									position, tokenIndex, depth = position45, tokenIndex45, depth45
   973  									if buffer[position] != rune('I') {
   974  										goto l16
   975  									}
   976  									position++
   977  								}
   978  							l45:
   979  								{
   980  									position47, tokenIndex47, depth47 := position, tokenIndex, depth
   981  									if buffer[position] != rune('s') {
   982  										goto l48
   983  									}
   984  									position++
   985  									goto l47
   986  								l48:
   987  									position, tokenIndex, depth = position47, tokenIndex47, depth47
   988  									if buffer[position] != rune('S') {
   989  										goto l16
   990  									}
   991  									position++
   992  								}
   993  							l47:
   994  								{
   995  									position49, tokenIndex49, depth49 := position, tokenIndex, depth
   996  									if buffer[position] != rune('t') {
   997  										goto l50
   998  									}
   999  									position++
  1000  									goto l49
  1001  								l50:
  1002  									position, tokenIndex, depth = position49, tokenIndex49, depth49
  1003  									if buffer[position] != rune('T') {
  1004  										goto l16
  1005  									}
  1006  									position++
  1007  								}
  1008  							l49:
  1009  								{
  1010  									position51, tokenIndex51, depth51 := position, tokenIndex, depth
  1011  									if buffer[position] != rune('s') {
  1012  										goto l52
  1013  									}
  1014  									position++
  1015  									goto l51
  1016  								l52:
  1017  									position, tokenIndex, depth = position51, tokenIndex51, depth51
  1018  									if buffer[position] != rune('S') {
  1019  										goto l16
  1020  									}
  1021  									position++
  1022  								}
  1023  							l51:
  1024  								depth--
  1025  								add(ruleexists, position40)
  1026  							}
  1027  							break
  1028  						case '=':
  1029  							{
  1030  								position53 := position
  1031  								depth++
  1032  								if buffer[position] != rune('=') {
  1033  									goto l16
  1034  								}
  1035  								position++
  1036  								depth--
  1037  								add(ruleequal, position53)
  1038  							}
  1039  						l54:
  1040  							{
  1041  								position55, tokenIndex55, depth55 := position, tokenIndex, depth
  1042  								if buffer[position] != rune(' ') {
  1043  									goto l55
  1044  								}
  1045  								position++
  1046  								goto l54
  1047  							l55:
  1048  								position, tokenIndex, depth = position55, tokenIndex55, depth55
  1049  							}
  1050  							{
  1051  								switch buffer[position] {
  1052  								case '\'':
  1053  									if !_rules[rulevalue]() {
  1054  										goto l16
  1055  									}
  1056  									break
  1057  								case 'D', 'd':
  1058  									if !_rules[ruledate]() {
  1059  										goto l16
  1060  									}
  1061  									break
  1062  								case 'T', 't':
  1063  									if !_rules[ruletime]() {
  1064  										goto l16
  1065  									}
  1066  									break
  1067  								default:
  1068  									if !_rules[rulenumber]() {
  1069  										goto l16
  1070  									}
  1071  									break
  1072  								}
  1073  							}
  1074  
  1075  							break
  1076  						case '>':
  1077  							{
  1078  								position57 := position
  1079  								depth++
  1080  								if buffer[position] != rune('>') {
  1081  									goto l16
  1082  								}
  1083  								position++
  1084  								depth--
  1085  								add(ruleg, position57)
  1086  							}
  1087  						l58:
  1088  							{
  1089  								position59, tokenIndex59, depth59 := position, tokenIndex, depth
  1090  								if buffer[position] != rune(' ') {
  1091  									goto l59
  1092  								}
  1093  								position++
  1094  								goto l58
  1095  							l59:
  1096  								position, tokenIndex, depth = position59, tokenIndex59, depth59
  1097  							}
  1098  							{
  1099  								switch buffer[position] {
  1100  								case 'D', 'd':
  1101  									if !_rules[ruledate]() {
  1102  										goto l16
  1103  									}
  1104  									break
  1105  								case 'T', 't':
  1106  									if !_rules[ruletime]() {
  1107  										goto l16
  1108  									}
  1109  									break
  1110  								default:
  1111  									if !_rules[rulenumber]() {
  1112  										goto l16
  1113  									}
  1114  									break
  1115  								}
  1116  							}
  1117  
  1118  							break
  1119  						case '<':
  1120  							{
  1121  								position61 := position
  1122  								depth++
  1123  								if buffer[position] != rune('<') {
  1124  									goto l16
  1125  								}
  1126  								position++
  1127  								depth--
  1128  								add(rulel, position61)
  1129  							}
  1130  						l62:
  1131  							{
  1132  								position63, tokenIndex63, depth63 := position, tokenIndex, depth
  1133  								if buffer[position] != rune(' ') {
  1134  									goto l63
  1135  								}
  1136  								position++
  1137  								goto l62
  1138  							l63:
  1139  								position, tokenIndex, depth = position63, tokenIndex63, depth63
  1140  							}
  1141  							{
  1142  								switch buffer[position] {
  1143  								case 'D', 'd':
  1144  									if !_rules[ruledate]() {
  1145  										goto l16
  1146  									}
  1147  									break
  1148  								case 'T', 't':
  1149  									if !_rules[ruletime]() {
  1150  										goto l16
  1151  									}
  1152  									break
  1153  								default:
  1154  									if !_rules[rulenumber]() {
  1155  										goto l16
  1156  									}
  1157  									break
  1158  								}
  1159  							}
  1160  
  1161  							break
  1162  						default:
  1163  							{
  1164  								position65 := position
  1165  								depth++
  1166  								{
  1167  									position66, tokenIndex66, depth66 := position, tokenIndex, depth
  1168  									if buffer[position] != rune('c') {
  1169  										goto l67
  1170  									}
  1171  									position++
  1172  									goto l66
  1173  								l67:
  1174  									position, tokenIndex, depth = position66, tokenIndex66, depth66
  1175  									if buffer[position] != rune('C') {
  1176  										goto l16
  1177  									}
  1178  									position++
  1179  								}
  1180  							l66:
  1181  								{
  1182  									position68, tokenIndex68, depth68 := position, tokenIndex, depth
  1183  									if buffer[position] != rune('o') {
  1184  										goto l69
  1185  									}
  1186  									position++
  1187  									goto l68
  1188  								l69:
  1189  									position, tokenIndex, depth = position68, tokenIndex68, depth68
  1190  									if buffer[position] != rune('O') {
  1191  										goto l16
  1192  									}
  1193  									position++
  1194  								}
  1195  							l68:
  1196  								{
  1197  									position70, tokenIndex70, depth70 := position, tokenIndex, depth
  1198  									if buffer[position] != rune('n') {
  1199  										goto l71
  1200  									}
  1201  									position++
  1202  									goto l70
  1203  								l71:
  1204  									position, tokenIndex, depth = position70, tokenIndex70, depth70
  1205  									if buffer[position] != rune('N') {
  1206  										goto l16
  1207  									}
  1208  									position++
  1209  								}
  1210  							l70:
  1211  								{
  1212  									position72, tokenIndex72, depth72 := position, tokenIndex, depth
  1213  									if buffer[position] != rune('t') {
  1214  										goto l73
  1215  									}
  1216  									position++
  1217  									goto l72
  1218  								l73:
  1219  									position, tokenIndex, depth = position72, tokenIndex72, depth72
  1220  									if buffer[position] != rune('T') {
  1221  										goto l16
  1222  									}
  1223  									position++
  1224  								}
  1225  							l72:
  1226  								{
  1227  									position74, tokenIndex74, depth74 := position, tokenIndex, depth
  1228  									if buffer[position] != rune('a') {
  1229  										goto l75
  1230  									}
  1231  									position++
  1232  									goto l74
  1233  								l75:
  1234  									position, tokenIndex, depth = position74, tokenIndex74, depth74
  1235  									if buffer[position] != rune('A') {
  1236  										goto l16
  1237  									}
  1238  									position++
  1239  								}
  1240  							l74:
  1241  								{
  1242  									position76, tokenIndex76, depth76 := position, tokenIndex, depth
  1243  									if buffer[position] != rune('i') {
  1244  										goto l77
  1245  									}
  1246  									position++
  1247  									goto l76
  1248  								l77:
  1249  									position, tokenIndex, depth = position76, tokenIndex76, depth76
  1250  									if buffer[position] != rune('I') {
  1251  										goto l16
  1252  									}
  1253  									position++
  1254  								}
  1255  							l76:
  1256  								{
  1257  									position78, tokenIndex78, depth78 := position, tokenIndex, depth
  1258  									if buffer[position] != rune('n') {
  1259  										goto l79
  1260  									}
  1261  									position++
  1262  									goto l78
  1263  								l79:
  1264  									position, tokenIndex, depth = position78, tokenIndex78, depth78
  1265  									if buffer[position] != rune('N') {
  1266  										goto l16
  1267  									}
  1268  									position++
  1269  								}
  1270  							l78:
  1271  								{
  1272  									position80, tokenIndex80, depth80 := position, tokenIndex, depth
  1273  									if buffer[position] != rune('s') {
  1274  										goto l81
  1275  									}
  1276  									position++
  1277  									goto l80
  1278  								l81:
  1279  									position, tokenIndex, depth = position80, tokenIndex80, depth80
  1280  									if buffer[position] != rune('S') {
  1281  										goto l16
  1282  									}
  1283  									position++
  1284  								}
  1285  							l80:
  1286  								depth--
  1287  								add(rulecontains, position65)
  1288  							}
  1289  						l82:
  1290  							{
  1291  								position83, tokenIndex83, depth83 := position, tokenIndex, depth
  1292  								if buffer[position] != rune(' ') {
  1293  									goto l83
  1294  								}
  1295  								position++
  1296  								goto l82
  1297  							l83:
  1298  								position, tokenIndex, depth = position83, tokenIndex83, depth83
  1299  							}
  1300  							if !_rules[rulevalue]() {
  1301  								goto l16
  1302  							}
  1303  							break
  1304  						}
  1305  					}
  1306  
  1307  				}
  1308  			l28:
  1309  				depth--
  1310  				add(rulecondition, position17)
  1311  			}
  1312  			return true
  1313  		l16:
  1314  			position, tokenIndex, depth = position16, tokenIndex16, depth16
  1315  			return false
  1316  		},
  1317  		/* 2 tag <- <<(!((&('<') '<') | (&('>') '>') | (&('=') '=') | (&('\'') '\'') | (&('"') '"') | (&(')') ')') | (&('(') '(') | (&('\\') '\\') | (&('\r') '\r') | (&('\n') '\n') | (&('\t') '\t') | (&(' ') ' ')) .)+>> */
  1318  		nil,
  1319  		/* 3 value <- <<('\'' (!('"' / '\'') .)* '\'')>> */
  1320  		func() bool {
  1321  			position85, tokenIndex85, depth85 := position, tokenIndex, depth
  1322  			{
  1323  				position86 := position
  1324  				depth++
  1325  				{
  1326  					position87 := position
  1327  					depth++
  1328  					if buffer[position] != rune('\'') {
  1329  						goto l85
  1330  					}
  1331  					position++
  1332  				l88:
  1333  					{
  1334  						position89, tokenIndex89, depth89 := position, tokenIndex, depth
  1335  						{
  1336  							position90, tokenIndex90, depth90 := position, tokenIndex, depth
  1337  							{
  1338  								position91, tokenIndex91, depth91 := position, tokenIndex, depth
  1339  								if buffer[position] != rune('"') {
  1340  									goto l92
  1341  								}
  1342  								position++
  1343  								goto l91
  1344  							l92:
  1345  								position, tokenIndex, depth = position91, tokenIndex91, depth91
  1346  								if buffer[position] != rune('\'') {
  1347  									goto l90
  1348  								}
  1349  								position++
  1350  							}
  1351  						l91:
  1352  							goto l89
  1353  						l90:
  1354  							position, tokenIndex, depth = position90, tokenIndex90, depth90
  1355  						}
  1356  						if !matchDot() {
  1357  							goto l89
  1358  						}
  1359  						goto l88
  1360  					l89:
  1361  						position, tokenIndex, depth = position89, tokenIndex89, depth89
  1362  					}
  1363  					if buffer[position] != rune('\'') {
  1364  						goto l85
  1365  					}
  1366  					position++
  1367  					depth--
  1368  					add(rulePegText, position87)
  1369  				}
  1370  				depth--
  1371  				add(rulevalue, position86)
  1372  			}
  1373  			return true
  1374  		l85:
  1375  			position, tokenIndex, depth = position85, tokenIndex85, depth85
  1376  			return false
  1377  		},
  1378  		/* 4 number <- <<('0' / ([1-9] digit* ('.' digit*)?))>> */
  1379  		func() bool {
  1380  			position93, tokenIndex93, depth93 := position, tokenIndex, depth
  1381  			{
  1382  				position94 := position
  1383  				depth++
  1384  				{
  1385  					position95 := position
  1386  					depth++
  1387  					{
  1388  						position96, tokenIndex96, depth96 := position, tokenIndex, depth
  1389  						if buffer[position] != rune('0') {
  1390  							goto l97
  1391  						}
  1392  						position++
  1393  						goto l96
  1394  					l97:
  1395  						position, tokenIndex, depth = position96, tokenIndex96, depth96
  1396  						if c := buffer[position]; c < rune('1') || c > rune('9') {
  1397  							goto l93
  1398  						}
  1399  						position++
  1400  					l98:
  1401  						{
  1402  							position99, tokenIndex99, depth99 := position, tokenIndex, depth
  1403  							if !_rules[ruledigit]() {
  1404  								goto l99
  1405  							}
  1406  							goto l98
  1407  						l99:
  1408  							position, tokenIndex, depth = position99, tokenIndex99, depth99
  1409  						}
  1410  						{
  1411  							position100, tokenIndex100, depth100 := position, tokenIndex, depth
  1412  							if buffer[position] != rune('.') {
  1413  								goto l100
  1414  							}
  1415  							position++
  1416  						l102:
  1417  							{
  1418  								position103, tokenIndex103, depth103 := position, tokenIndex, depth
  1419  								if !_rules[ruledigit]() {
  1420  									goto l103
  1421  								}
  1422  								goto l102
  1423  							l103:
  1424  								position, tokenIndex, depth = position103, tokenIndex103, depth103
  1425  							}
  1426  							goto l101
  1427  						l100:
  1428  							position, tokenIndex, depth = position100, tokenIndex100, depth100
  1429  						}
  1430  					l101:
  1431  					}
  1432  				l96:
  1433  					depth--
  1434  					add(rulePegText, position95)
  1435  				}
  1436  				depth--
  1437  				add(rulenumber, position94)
  1438  			}
  1439  			return true
  1440  		l93:
  1441  			position, tokenIndex, depth = position93, tokenIndex93, depth93
  1442  			return false
  1443  		},
  1444  		/* 5 digit <- <[0-9]> */
  1445  		func() bool {
  1446  			position104, tokenIndex104, depth104 := position, tokenIndex, depth
  1447  			{
  1448  				position105 := position
  1449  				depth++
  1450  				if c := buffer[position]; c < rune('0') || c > rune('9') {
  1451  					goto l104
  1452  				}
  1453  				position++
  1454  				depth--
  1455  				add(ruledigit, position105)
  1456  			}
  1457  			return true
  1458  		l104:
  1459  			position, tokenIndex, depth = position104, tokenIndex104, depth104
  1460  			return false
  1461  		},
  1462  		/* 6 time <- <(('t' / 'T') ('i' / 'I') ('m' / 'M') ('e' / 'E') ' ' <(year '-' month '-' day 'T' digit digit ':' digit digit ':' digit digit ((('-' / '+') digit digit ':' digit digit) / 'Z'))>)> */
  1463  		func() bool {
  1464  			position106, tokenIndex106, depth106 := position, tokenIndex, depth
  1465  			{
  1466  				position107 := position
  1467  				depth++
  1468  				{
  1469  					position108, tokenIndex108, depth108 := position, tokenIndex, depth
  1470  					if buffer[position] != rune('t') {
  1471  						goto l109
  1472  					}
  1473  					position++
  1474  					goto l108
  1475  				l109:
  1476  					position, tokenIndex, depth = position108, tokenIndex108, depth108
  1477  					if buffer[position] != rune('T') {
  1478  						goto l106
  1479  					}
  1480  					position++
  1481  				}
  1482  			l108:
  1483  				{
  1484  					position110, tokenIndex110, depth110 := position, tokenIndex, depth
  1485  					if buffer[position] != rune('i') {
  1486  						goto l111
  1487  					}
  1488  					position++
  1489  					goto l110
  1490  				l111:
  1491  					position, tokenIndex, depth = position110, tokenIndex110, depth110
  1492  					if buffer[position] != rune('I') {
  1493  						goto l106
  1494  					}
  1495  					position++
  1496  				}
  1497  			l110:
  1498  				{
  1499  					position112, tokenIndex112, depth112 := position, tokenIndex, depth
  1500  					if buffer[position] != rune('m') {
  1501  						goto l113
  1502  					}
  1503  					position++
  1504  					goto l112
  1505  				l113:
  1506  					position, tokenIndex, depth = position112, tokenIndex112, depth112
  1507  					if buffer[position] != rune('M') {
  1508  						goto l106
  1509  					}
  1510  					position++
  1511  				}
  1512  			l112:
  1513  				{
  1514  					position114, tokenIndex114, depth114 := position, tokenIndex, depth
  1515  					if buffer[position] != rune('e') {
  1516  						goto l115
  1517  					}
  1518  					position++
  1519  					goto l114
  1520  				l115:
  1521  					position, tokenIndex, depth = position114, tokenIndex114, depth114
  1522  					if buffer[position] != rune('E') {
  1523  						goto l106
  1524  					}
  1525  					position++
  1526  				}
  1527  			l114:
  1528  				if buffer[position] != rune(' ') {
  1529  					goto l106
  1530  				}
  1531  				position++
  1532  				{
  1533  					position116 := position
  1534  					depth++
  1535  					if !_rules[ruleyear]() {
  1536  						goto l106
  1537  					}
  1538  					if buffer[position] != rune('-') {
  1539  						goto l106
  1540  					}
  1541  					position++
  1542  					if !_rules[rulemonth]() {
  1543  						goto l106
  1544  					}
  1545  					if buffer[position] != rune('-') {
  1546  						goto l106
  1547  					}
  1548  					position++
  1549  					if !_rules[ruleday]() {
  1550  						goto l106
  1551  					}
  1552  					if buffer[position] != rune('T') {
  1553  						goto l106
  1554  					}
  1555  					position++
  1556  					if !_rules[ruledigit]() {
  1557  						goto l106
  1558  					}
  1559  					if !_rules[ruledigit]() {
  1560  						goto l106
  1561  					}
  1562  					if buffer[position] != rune(':') {
  1563  						goto l106
  1564  					}
  1565  					position++
  1566  					if !_rules[ruledigit]() {
  1567  						goto l106
  1568  					}
  1569  					if !_rules[ruledigit]() {
  1570  						goto l106
  1571  					}
  1572  					if buffer[position] != rune(':') {
  1573  						goto l106
  1574  					}
  1575  					position++
  1576  					if !_rules[ruledigit]() {
  1577  						goto l106
  1578  					}
  1579  					if !_rules[ruledigit]() {
  1580  						goto l106
  1581  					}
  1582  					{
  1583  						position117, tokenIndex117, depth117 := position, tokenIndex, depth
  1584  						{
  1585  							position119, tokenIndex119, depth119 := position, tokenIndex, depth
  1586  							if buffer[position] != rune('-') {
  1587  								goto l120
  1588  							}
  1589  							position++
  1590  							goto l119
  1591  						l120:
  1592  							position, tokenIndex, depth = position119, tokenIndex119, depth119
  1593  							if buffer[position] != rune('+') {
  1594  								goto l118
  1595  							}
  1596  							position++
  1597  						}
  1598  					l119:
  1599  						if !_rules[ruledigit]() {
  1600  							goto l118
  1601  						}
  1602  						if !_rules[ruledigit]() {
  1603  							goto l118
  1604  						}
  1605  						if buffer[position] != rune(':') {
  1606  							goto l118
  1607  						}
  1608  						position++
  1609  						if !_rules[ruledigit]() {
  1610  							goto l118
  1611  						}
  1612  						if !_rules[ruledigit]() {
  1613  							goto l118
  1614  						}
  1615  						goto l117
  1616  					l118:
  1617  						position, tokenIndex, depth = position117, tokenIndex117, depth117
  1618  						if buffer[position] != rune('Z') {
  1619  							goto l106
  1620  						}
  1621  						position++
  1622  					}
  1623  				l117:
  1624  					depth--
  1625  					add(rulePegText, position116)
  1626  				}
  1627  				depth--
  1628  				add(ruletime, position107)
  1629  			}
  1630  			return true
  1631  		l106:
  1632  			position, tokenIndex, depth = position106, tokenIndex106, depth106
  1633  			return false
  1634  		},
  1635  		/* 7 date <- <(('d' / 'D') ('a' / 'A') ('t' / 'T') ('e' / 'E') ' ' <(year '-' month '-' day)>)> */
  1636  		func() bool {
  1637  			position121, tokenIndex121, depth121 := position, tokenIndex, depth
  1638  			{
  1639  				position122 := position
  1640  				depth++
  1641  				{
  1642  					position123, tokenIndex123, depth123 := position, tokenIndex, depth
  1643  					if buffer[position] != rune('d') {
  1644  						goto l124
  1645  					}
  1646  					position++
  1647  					goto l123
  1648  				l124:
  1649  					position, tokenIndex, depth = position123, tokenIndex123, depth123
  1650  					if buffer[position] != rune('D') {
  1651  						goto l121
  1652  					}
  1653  					position++
  1654  				}
  1655  			l123:
  1656  				{
  1657  					position125, tokenIndex125, depth125 := position, tokenIndex, depth
  1658  					if buffer[position] != rune('a') {
  1659  						goto l126
  1660  					}
  1661  					position++
  1662  					goto l125
  1663  				l126:
  1664  					position, tokenIndex, depth = position125, tokenIndex125, depth125
  1665  					if buffer[position] != rune('A') {
  1666  						goto l121
  1667  					}
  1668  					position++
  1669  				}
  1670  			l125:
  1671  				{
  1672  					position127, tokenIndex127, depth127 := position, tokenIndex, depth
  1673  					if buffer[position] != rune('t') {
  1674  						goto l128
  1675  					}
  1676  					position++
  1677  					goto l127
  1678  				l128:
  1679  					position, tokenIndex, depth = position127, tokenIndex127, depth127
  1680  					if buffer[position] != rune('T') {
  1681  						goto l121
  1682  					}
  1683  					position++
  1684  				}
  1685  			l127:
  1686  				{
  1687  					position129, tokenIndex129, depth129 := position, tokenIndex, depth
  1688  					if buffer[position] != rune('e') {
  1689  						goto l130
  1690  					}
  1691  					position++
  1692  					goto l129
  1693  				l130:
  1694  					position, tokenIndex, depth = position129, tokenIndex129, depth129
  1695  					if buffer[position] != rune('E') {
  1696  						goto l121
  1697  					}
  1698  					position++
  1699  				}
  1700  			l129:
  1701  				if buffer[position] != rune(' ') {
  1702  					goto l121
  1703  				}
  1704  				position++
  1705  				{
  1706  					position131 := position
  1707  					depth++
  1708  					if !_rules[ruleyear]() {
  1709  						goto l121
  1710  					}
  1711  					if buffer[position] != rune('-') {
  1712  						goto l121
  1713  					}
  1714  					position++
  1715  					if !_rules[rulemonth]() {
  1716  						goto l121
  1717  					}
  1718  					if buffer[position] != rune('-') {
  1719  						goto l121
  1720  					}
  1721  					position++
  1722  					if !_rules[ruleday]() {
  1723  						goto l121
  1724  					}
  1725  					depth--
  1726  					add(rulePegText, position131)
  1727  				}
  1728  				depth--
  1729  				add(ruledate, position122)
  1730  			}
  1731  			return true
  1732  		l121:
  1733  			position, tokenIndex, depth = position121, tokenIndex121, depth121
  1734  			return false
  1735  		},
  1736  		/* 8 year <- <(('1' / '2') digit digit digit)> */
  1737  		func() bool {
  1738  			position132, tokenIndex132, depth132 := position, tokenIndex, depth
  1739  			{
  1740  				position133 := position
  1741  				depth++
  1742  				{
  1743  					position134, tokenIndex134, depth134 := position, tokenIndex, depth
  1744  					if buffer[position] != rune('1') {
  1745  						goto l135
  1746  					}
  1747  					position++
  1748  					goto l134
  1749  				l135:
  1750  					position, tokenIndex, depth = position134, tokenIndex134, depth134
  1751  					if buffer[position] != rune('2') {
  1752  						goto l132
  1753  					}
  1754  					position++
  1755  				}
  1756  			l134:
  1757  				if !_rules[ruledigit]() {
  1758  					goto l132
  1759  				}
  1760  				if !_rules[ruledigit]() {
  1761  					goto l132
  1762  				}
  1763  				if !_rules[ruledigit]() {
  1764  					goto l132
  1765  				}
  1766  				depth--
  1767  				add(ruleyear, position133)
  1768  			}
  1769  			return true
  1770  		l132:
  1771  			position, tokenIndex, depth = position132, tokenIndex132, depth132
  1772  			return false
  1773  		},
  1774  		/* 9 month <- <(('0' / '1') digit)> */
  1775  		func() bool {
  1776  			position136, tokenIndex136, depth136 := position, tokenIndex, depth
  1777  			{
  1778  				position137 := position
  1779  				depth++
  1780  				{
  1781  					position138, tokenIndex138, depth138 := position, tokenIndex, depth
  1782  					if buffer[position] != rune('0') {
  1783  						goto l139
  1784  					}
  1785  					position++
  1786  					goto l138
  1787  				l139:
  1788  					position, tokenIndex, depth = position138, tokenIndex138, depth138
  1789  					if buffer[position] != rune('1') {
  1790  						goto l136
  1791  					}
  1792  					position++
  1793  				}
  1794  			l138:
  1795  				if !_rules[ruledigit]() {
  1796  					goto l136
  1797  				}
  1798  				depth--
  1799  				add(rulemonth, position137)
  1800  			}
  1801  			return true
  1802  		l136:
  1803  			position, tokenIndex, depth = position136, tokenIndex136, depth136
  1804  			return false
  1805  		},
  1806  		/* 10 day <- <(((&('3') '3') | (&('2') '2') | (&('1') '1') | (&('0') '0')) digit)> */
  1807  		func() bool {
  1808  			position140, tokenIndex140, depth140 := position, tokenIndex, depth
  1809  			{
  1810  				position141 := position
  1811  				depth++
  1812  				{
  1813  					switch buffer[position] {
  1814  					case '3':
  1815  						if buffer[position] != rune('3') {
  1816  							goto l140
  1817  						}
  1818  						position++
  1819  						break
  1820  					case '2':
  1821  						if buffer[position] != rune('2') {
  1822  							goto l140
  1823  						}
  1824  						position++
  1825  						break
  1826  					case '1':
  1827  						if buffer[position] != rune('1') {
  1828  							goto l140
  1829  						}
  1830  						position++
  1831  						break
  1832  					default:
  1833  						if buffer[position] != rune('0') {
  1834  							goto l140
  1835  						}
  1836  						position++
  1837  						break
  1838  					}
  1839  				}
  1840  
  1841  				if !_rules[ruledigit]() {
  1842  					goto l140
  1843  				}
  1844  				depth--
  1845  				add(ruleday, position141)
  1846  			}
  1847  			return true
  1848  		l140:
  1849  			position, tokenIndex, depth = position140, tokenIndex140, depth140
  1850  			return false
  1851  		},
  1852  		/* 11 and <- <(('a' / 'A') ('n' / 'N') ('d' / 'D'))> */
  1853  		nil,
  1854  		/* 12 equal <- <'='> */
  1855  		nil,
  1856  		/* 13 contains <- <(('c' / 'C') ('o' / 'O') ('n' / 'N') ('t' / 'T') ('a' / 'A') ('i' / 'I') ('n' / 'N') ('s' / 'S'))> */
  1857  		nil,
  1858  		/* 14 exists <- <(('e' / 'E') ('x' / 'X') ('i' / 'I') ('s' / 'S') ('t' / 'T') ('s' / 'S'))> */
  1859  		nil,
  1860  		/* 15 le <- <('<' '=')> */
  1861  		nil,
  1862  		/* 16 ge <- <('>' '=')> */
  1863  		nil,
  1864  		/* 17 l <- <'<'> */
  1865  		nil,
  1866  		/* 18 g <- <'>'> */
  1867  		nil,
  1868  		nil,
  1869  	}
  1870  	p.rules = _rules
  1871  }