github.com/vipernet-xyz/tm@v0.34.24/libs/pubsub/query/query.peg.go (about)

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