File: rx_backtrack

package info (click to toggle)
nqp 2022.12%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 9,436 kB
  • sloc: java: 28,030; perl: 3,394; ansic: 451; makefile: 200; javascript: 68; sh: 1
file content (38 lines) | stat: -rw-r--r-- 1,311 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
##   Backtracking control tests
a* a			bazaar		y	control
a*:a			bazaar		n	basic
a*: a			bazaar		n	basic
^[a|b]*  aba		abbabbababba	y	control
^[a|b]*: aba		abbabbababba	n	outside a group
\d+:			123abc		y	cut on character class shortcut
\d+:			abc		n	cut on character class shortcut
[ if    not | ify ]	verify		y	control
# todo :any<::>
[ if :: not | ify ]	verify		n	inside a group
# todo :any<::>
  if :: not | ify	verify		n	the default all group
[ if :  not | ify ]	verify		y	simple backtrack still works
# todo :any<::>
[ if :: not | ify ] | verify	verify	y	rule continues
[ when     ever ] | whence	whence	y	full backtrack failure
# todo :any<::>
[ when ::: ever ] | whence	whence	n	full backtrack failure
# todo :any<::>
ab::cd | gh::ij		xyabghij	y	group cut at top
# todo :any<::>
ab:::cd | gh:::ij	xyabghij	n	rule cut at top
# todo :any<::>
[ab::cd | gh::ij]	xyabghij	y	group cut in group
# todo :any<::>
[ab:::cd | gh:::ij]	xyabghij	n	rule cut in group
# todo :any<:>
[ ab | abc ]: de	xyzabcde	n	no backtrack into group
# todo :any<:>
( ab | abc ): de	xyzabcde	n	no backtrack into subpattern
# todo :any<:>
[ when <commit> ever ] | whence	whence	n	full backtrack failure

:ratchet a* a		bazaar		n	ratchet modifier
:ratchet a*! a		bazaar		y	force backtracking !

## vim: noexpandtab tabstop=4 shiftwidth=4