(group-ref x))
("abc" #f))
((seq "a"
- (* (seq (group x (char-set "bc"))
+ (* (seq (group x (char-in "bc"))
(group-ref x)))
"d")
("abbccd" (0 6 (x . "b") (x . "c")))
(group-ref x)
"b"
(* "c")
- (char-set "ce")
+ (char-in "ce")
"d")
("aabcccd" (0 7 (x . "a"))))
((seq (string-start)
"d")
"acd")
((seq (** 0 1 "-")
- (+ (char-set "0123456789"))
+ (+ (char-in "0123456789"))
(string-end))
"-5"))))
\f
;;; Ripped off from "grep/tests/ere.tests".
(define-test 'match-grep-ere
(multi-match-strings-test
- `(((alt "abc" "de")
+ '(((alt "abc" "de")
"abc")
((alt "a" "b" "c")
("abc" (0 1)))
((seq "a" (any-char) "c")
"abc")
- ((seq "a" (char-set "bc") "d")
+ ((seq "a" (char-in "bc") "d")
"abd")
((seq "a" (* "b") "c")
"abc")
"abc")
((seq "a" (? "b") "c")
"abc")
- ((seq "a" (char-set "b") "c")
+ ((seq "a" (char-in "b") "c")
"abc")
- ((seq "a" (char-set "ab") "c")
+ ((seq "a" (char-in "ab") "c")
"abc")
- ((seq "a" (inverse-char-set "ab") "c")
+ ((seq "a" (char-not-in "ab") "c")
("abc" #f)
"adc")
- ((seq "a" (char-set ,char-set:alphabetic) "c")
+ ((seq "a" (char-in alphabetic) "c")
"abc"
"adc")
- ((seq "a" (+ (char-set ,char-set:numeric)) "c")
+ ((seq "a" (+ (char-in numeric)) "c")
"a019c")
- ((seq "A" (+ (char-set ,char-set:lower-case)) "C")
+ ((seq "A" (+ (char-in lower-case)) "C")
"AabC")
- ((seq "a" (+ (char-set ,char-set:upper-case)) "c")
+ ((seq "a" (+ (char-in upper-case)) "c")
"aBCc")
- ((seq "a" (** 20 (char-set "ab")))
+ ((seq "a" (** 20 (char-in "ab")))
"aaaaabaaaabaaaabaaaab")
((seq "a"
- (char-set "ab") (char-set "ab") (char-set "ab") (char-set "ab")
- (char-set "ab") (char-set "ab") (char-set "ab") (char-set "ab")
- (char-set "ab") (char-set "ab") (char-set "ab") (char-set "ab")
- (char-set "ab") (char-set "ab") (char-set "ab") (char-set "ab")
- (char-set "ab") (char-set "ab") (char-set "ab") (char-set "ab"))
+ (char-in "ab") (char-in "ab") (char-in "ab") (char-in "ab")
+ (char-in "ab") (char-in "ab") (char-in "ab") (char-in "ab")
+ (char-in "ab") (char-in "ab") (char-in "ab") (char-in "ab")
+ (char-in "ab") (char-in "ab") (char-in "ab") (char-in "ab")
+ (char-in "ab") (char-in "ab") (char-in "ab") (char-in "ab"))
"aaaaabaaaabaaaabaaaab")
((seq "a"
- (char-set "ab") (char-set "ab") (char-set "ab") (char-set "ab")
- (char-set "ab") (char-set "ab") (char-set "ab") (char-set "ab")
- (char-set "ab") (char-set "ab") (char-set "ab") (char-set "ab")
- (char-set "ab") (char-set "ab") (char-set "ab") (char-set "ab")
- (char-set "ab") (char-set "ab") (char-set "ab") (char-set "ab")
+ (char-in "ab") (char-in "ab") (char-in "ab") (char-in "ab")
+ (char-in "ab") (char-in "ab") (char-in "ab") (char-in "ab")
+ (char-in "ab") (char-in "ab") (char-in "ab") (char-in "ab")
+ (char-in "ab") (char-in "ab") (char-in "ab") (char-in "ab")
+ (char-in "ab") (char-in "ab") (char-in "ab") (char-in "ab")
(alt "wee" "week")
(alt "knights" "night"))
"aaaaabaaaabaaaabaaaabweeknights")
- ((seq (char-set "ab") (char-set "cd") (char-set "ef") (char-set "gh")
- (char-set "ij") (char-set "kl") (char-set "mn"))
+ ((seq (char-in "ab") (char-in "cd") (char-in "ef") (char-in "gh")
+ (char-in "ij") (char-in "kl") (char-in "mn"))
("acegikmoq" (0 7)))
- ((seq (char-set "ab") (char-set "cd") (char-set "ef") (char-set "gh")
- (char-set "ij") (char-set "kl") (char-set "mn") (char-set "op"))
+ ((seq (char-in "ab") (char-in "cd") (char-in "ef") (char-in "gh")
+ (char-in "ij") (char-in "kl") (char-in "mn") (char-in "op"))
("acegikmoq" (0 8)))
- ((seq (char-set "ab") (char-set "cd") (char-set "ef") (char-set "gh")
- (char-set "ij") (char-set "kl") (char-set "mn") (char-set "op")
- (char-set "qr"))
+ ((seq (char-in "ab") (char-in "cd") (char-in "ef") (char-in "gh")
+ (char-in "ij") (char-in "kl") (char-in "mn") (char-in "op")
+ (char-in "qr"))
("acegikmoqy" (0 9)))
- ((seq (char-set "ab") (char-set "cd") (char-set "ef") (char-set "gh")
- (char-set "ij") (char-set "kl") (char-set "mn") (char-set "op")
- (char-set "q"))
+ ((seq (char-in "ab") (char-in "cd") (char-in "ef") (char-in "gh")
+ (char-in "ij") (char-in "kl") (char-in "mn") (char-in "op")
+ (char-in "q"))
("acegikmoqy" (0 9)))
("aBc"
("Abc" #f))
- ((seq "a" (* (char-set "Bc")) "d")
+ ((seq "a" (* (char-in "Bc")) "d")
"acBd"
"aBcd"
"aBcBcBd"
("aBCd" #f)
("abcd" #f)
("abBCcd" #f))
- ((seq "a" (inverse-char-set "b") "c")
+ ((seq "a" (char-not-in "b") "c")
("abc" #f)
"aBc"
"adc")
- ((seq (char-set "a") "b" (char-set "c"))
+ ((seq (char-in "a") "b" (char-in "c"))
"abc")
- ((seq (char-set "a") "b" (char-set "a"))
+ ((seq (char-in "a") "b" (char-in "a"))
"aba")
- ((seq (char-set "abc") "b" (char-set "abc"))
+ ((seq (char-in "abc") "b" (char-in "abc"))
"abc")
- ((seq (char-set "abc") "b" (char-set "abd"))
+ ((seq (char-in "abc") "b" (char-in "abd"))
("abc" #f)
"abd")
((seq "a" (+ (seq (? "b") "c")) "d")
"abcdefghijklmnop")
("abcdefghijklmnopqrstuv"
"abcdefghijklmnopqrstuv")
- ((alt (seq "CC" (char-set "13") "1")
+ ((alt (seq "CC" (char-in "13") "1")
(seq (** 21 "a")
- (char-set "23")
- (char-set "EO")
- (char-set "123")
- (char-set "Es")
- (char-set "12")
+ (char-in "23")
+ (char-in "EO")
+ (char-in "123")
+ (char-in "Es")
+ (char-in "12")
(** 15 "a")
"aa"
- (char-set "34")
- (char-set "EW")
+ (char-in "34")
+ (char-in "EW")
"aaaaaaa"
- (char-set "X")
+ (char-in "X")
"a"))
"CC11"))))
\f
(define-test 'match-grep-muammar-qaddafi
(match-strings-test
'(seq "M"
- (char-set "ou")
+ (char-in "ou")
(? "'")
"a"
(+ "m")
- (char-set "ae")
+ (char-in "ae")
"r "
(* (any-char))
- (? (seq (char-set "AEae")
+ (? (seq (char-in "AEae")
"l"
- (char-set "- ")))
- (char-set "GKQ")
+ (char-in "- ")))
+ (char-in "GKQ")
(? "h")
- (+ (char-set "aeu"))
- (+ (seq (char-set "dtz")
- (? (char-set "dhz"))))
+ (+ (char-in "aeu"))
+ (+ (seq (char-in "dtz")
+ (? (char-in "dhz"))))
"af"
- (char-set "iy"))
+ (char-in "iy"))
'("Muammar Qaddafi"
"Mo'ammar Gadhafi"
"Muammar Kaddafi"
((seq "a" (* (any-char)) "c")
"axyzc"
("axyzd" #f))
- ((seq "a" (char-set "bc") "d")
+ ((seq "a" (char-in "bc") "d")
("abc" #f)
"abd")
- ((seq "a" (char-set "bcd") "e")
+ ((seq "a" (char-in "bcd") "e")
("abd" #f)
"ace")
- ((seq "a" (char-set "bcd"))
+ ((seq "a" (char-in "bcd"))
"ac"
("aac" #f))
- ((seq "a" (inverse-char-set "bc") "d")
+ ((seq "a" (char-not-in "bc") "d")
"aed"
("abd" #f))
((seq (+ "a") (+ "b") "c")
((? (alt (+ "a") "b"))
("ba" (0 1))
("ab" (0 1)))
- ((* (inverse-char-set "ab"))
+ ((* (char-not-in "ab"))
"cde")
- ((seq (* (char-set "abc")) "d")
+ ((seq (* (char-in "abc")) "d")
"abbbcd")
- ((seq (* (char-set "abc")) "bcd")
+ ((seq (* (char-in "abc")) "bcd")
"abcd")
((alt "a" "b" "c" "d" "e")
"e")
(assert-equal (re-pattern->regsexp (car entry))
(cadr entry))))
'(("[\r\n\t ]*(This file must be converted with BinHex.*[\r\n][\r\n\t ]*:"
- (seq (* (char-set (9 . 11) 13 32))
+ (seq (* (char-in (9 . 11) 13 32))
"(This file must be converted with BinHex"
(* (any-char))
- (char-set 10 13)
- (* (char-set (9 . 11) 13 32))
+ (char-in 10 13)
+ (* (char-in (9 . 11) 13 32))
":"))
("^begin +[0-7]+ +.+$"
(seq (line-start)
"begin"
(+ #\space)
- (+ (char-set (48 . 56)))
+ (+ (char-in (48 . 56)))
(+ #\space)
(+ (any-char))
(line-end)))
("\\`8859-[0-9]+\\'"
- (seq (string-start) "8859-" (+ (char-set (48 . 58))) (string-end)))
+ (seq (string-start) "8859-" (+ (char-in (48 . 58))) (string-end)))
("\\`0x\\([0-9A-Fa-f][0-9A-Fa-f]\\)\t0x\\([0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f]\\)\t"
(seq (string-start)
"0x"
(group 1
- (seq (char-set (48 . 58) (65 . 71) (97 . 103))
- (char-set (48 . 58) (65 . 71) (97 . 103))))
+ (seq (char-in (48 . 58) (65 . 71) (97 . 103))
+ (char-in (48 . 58) (65 . 71) (97 . 103))))
"\t0x"
(group
2
- (seq (char-set (48 . 58) (65 . 71) (97 . 103))
- (char-set (48 . 58) (65 . 71) (97 . 103))
- (char-set (48 . 58) (65 . 71) (97 . 103))
- (char-set (48 . 58) (65 . 71) (97 . 103))))
+ (seq (char-in (48 . 58) (65 . 71) (97 . 103))
+ (char-in (48 . 58) (65 . 71) (97 . 103))
+ (char-in (48 . 58) (65 . 71) (97 . 103))
+ (char-in (48 . 58) (65 . 71) (97 . 103))))
"\t"))
("\\`\\s *\\(error:\\)?\\s *\\(.*\\)\\s *\\'"