You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1871 lines
42 KiB

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