Moved unstable/cce/regexp to unstable/regexp.

This commit is contained in:
Carl Eastlund 2010-05-29 18:31:26 -04:00
parent 3a525b9a12
commit 2db3a9d38a
6 changed files with 17 additions and 26 deletions

View File

@ -1,8 +1,6 @@
#lang scheme #lang racket
(require "checks.ss" "../regexp.ss") (require rackunit rackunit/text-ui unstable/regexp "helpers.rkt")
(provide regexp-suite)
(define-syntax (regexp-test stx) (define-syntax (regexp-test stx)
(syntax-case stx () (syntax-case stx ()
@ -14,7 +12,7 @@
(test-case "pregexp" (test-case "pregexp"
(check-equal? (regexp-match (pregexp pattern) string) result))))])) (check-equal? (regexp-match (pregexp pattern) string) result))))]))
(define regexp-suite (run-tests
(test-suite "regexp.ss" (test-suite "regexp.ss"
(test-suite "regexp-sequence" (test-suite "regexp-sequence"
(regexp-test (regexp-sequence) "a cat" (list "")) (regexp-test (regexp-sequence) "a cat" (list ""))

View File

@ -10,8 +10,6 @@
@table-of-contents[] @table-of-contents[]
@include-section["regexp.scrbl"]
@include-section["set.scrbl"] @include-section["set.scrbl"]
@include-section["dict.scrbl"] @include-section["dict.scrbl"]

View File

@ -8,7 +8,6 @@
"test-exn.ss" "test-exn.ss"
"test-planet.ss" "test-planet.ss"
"test-port.ss" "test-port.ss"
"test-regexp.ss"
"test-require-provide.ss" "test-require-provide.ss"
"test-sandbox.ss" "test-sandbox.ss"
"test-scribble.ss" "test-scribble.ss"
@ -24,7 +23,6 @@
exn-suite exn-suite
planet-suite planet-suite
port-suite port-suite
regexp-suite
require-provide-suite require-provide-suite
sandbox-suite sandbox-suite
scribble-suite scribble-suite

View File

@ -1,6 +1,6 @@
#lang scheme/base #lang racket/base
(require scheme/list scheme/contract) (require racket/list racket/contract)
;; regexp-or : String ... -> String ;; regexp-or : String ... -> String
;; Produces the regexp disjunction of several regexp-strings. ;; Produces the regexp disjunction of several regexp-strings.

View File

@ -1,13 +1,9 @@
#lang scribble/doc #lang scribble/manual
@(require scribble/manual @(require scribble/eval "utils.rkt" (for-label racket unstable/regexp))
scribble/eval
"../scribble.ss"
"eval.ss")
@(require (for-label scheme unstable/cce/regexp))
@title[#:style 'quiet #:tag "cce-regexp"]{Regular Expressions} @title{Regular Expressions}
@defmodule[unstable/cce/regexp] @defmodule[unstable/regexp]
This module provides tools for building strings which can be compiled to regular This module provides tools for building strings which can be compiled to regular
expressions. In particular, the constructors wrap their arguments in expressions. In particular, the constructors wrap their arguments in
@ -23,7 +19,7 @@ Produces a regular expression string that matches @scheme[start], followed by
each @scheme[re] interleaved with @scheme[between], followed by @scheme[end]. each @scheme[re] interleaved with @scheme[between], followed by @scheme[end].
@defexamples[ @defexamples[
#:eval (evaluator 'unstable/cce/regexp) #:eval (eval/require 'unstable/regexp)
(define re (define re
(pregexp (pregexp
(regexp-sequence "[0-9]+" "[0-9]+" "[0-9]+" (regexp-sequence "[0-9]+" "[0-9]+" "[0-9]+"
@ -42,7 +38,7 @@ each @scheme[re] interleaved with @scheme[between], followed by @scheme[end].
Produces a regular expression string that matches any of the given @scheme[re]s. Produces a regular expression string that matches any of the given @scheme[re]s.
@defexamples[ @defexamples[
#:eval (evaluator 'unstable/cce/regexp) #:eval (eval/require 'unstable/regexp)
(define re (pregexp (regexp-or "[0-9]+" "[a-z]"))) (define re (pregexp (regexp-or "[0-9]+" "[a-z]")))
(regexp-match-exact? re "123") (regexp-match-exact? re "123")
(regexp-match-exact? re "c") (regexp-match-exact? re "c")
@ -57,7 +53,7 @@ Produces a regular expression string that matches either the empty string, or
the concatenation of all the given @scheme[re]s. the concatenation of all the given @scheme[re]s.
@defexamples[ @defexamples[
#:eval (evaluator 'unstable/cce/regexp) #:eval (eval/require 'unstable/regexp)
(define re (pregexp (regexp-maybe "[0-9]+" "[.]" "[0-9]+"))) (define re (pregexp (regexp-maybe "[0-9]+" "[.]" "[0-9]+")))
(regexp-match-exact? re "123.456") (regexp-match-exact? re "123.456")
(regexp-match-exact? re "") (regexp-match-exact? re "")
@ -72,7 +68,7 @@ Produces a regular expression string that matches zero or more consecutive
occurrences of the concatenation of the given @scheme[re]s. occurrences of the concatenation of the given @scheme[re]s.
@defexamples[ @defexamples[
#:eval (evaluator 'unstable/cce/regexp) #:eval (eval/require 'unstable/regexp)
(define re (pregexp (regexp-star "a" "b" "c"))) (define re (pregexp (regexp-star "a" "b" "c")))
(regexp-match-exact? re "") (regexp-match-exact? re "")
(regexp-match-exact? re "abc") (regexp-match-exact? re "abc")
@ -88,7 +84,7 @@ Produces a regular expression string that matches one or more consecutive
occurrences of the concatenation of the given @scheme[re]s. occurrences of the concatenation of the given @scheme[re]s.
@defexamples[ @defexamples[
#:eval (evaluator 'unstable/cce/regexp) #:eval (eval/require 'unstable/regexp)
(define re (pregexp (regexp-plus "a" "b" "c"))) (define re (pregexp (regexp-plus "a" "b" "c")))
(regexp-match-exact? re "") (regexp-match-exact? re "")
(regexp-match-exact? re "abc") (regexp-match-exact? re "abc")
@ -104,7 +100,7 @@ Produces a regular expression string that matches the concatenation of the given
@scheme[re]s and saves the result. @scheme[re]s and saves the result.
@defexamples[ @defexamples[
#:eval (evaluator 'unstable/cce/regexp) #:eval (eval/require 'unstable/regexp)
(define re (define re
(pregexp (regexp-sequence (regexp-save "[0-9]+") "\\1"))) (pregexp (regexp-sequence (regexp-save "[0-9]+") "\\1")))
(regexp-match-exact? re "11") (regexp-match-exact? re "11")
@ -120,7 +116,7 @@ Produces a regular expression string that matches the concatenation of the given
@scheme[re]s in multiple-line mode. @scheme[re]s in multiple-line mode.
@defexamples[ @defexamples[
#:eval (evaluator 'unstable/cce/regexp) #:eval (eval/require 'unstable/regexp)
(define re (pregexp (regexp-multi "^abc$"))) (define re (pregexp (regexp-multi "^abc$")))
(regexp-match? re "abc") (regexp-match? re "abc")
(regexp-match? re "xyz\nabc\ndef") (regexp-match? re "xyz\nabc\ndef")

View File

@ -82,6 +82,7 @@ Keep documentation and tests up to date.
@include-section["path.scrbl"] @include-section["path.scrbl"]
@include-section["pretty.scrbl"] @include-section["pretty.scrbl"]
@include-section["queue.scrbl"] @include-section["queue.scrbl"]
@include-section["regexp.scrbl"]
@include-section["srcloc.scrbl"] @include-section["srcloc.scrbl"]
@include-section["string.scrbl"] @include-section["string.scrbl"]
@include-section["struct.scrbl"] @include-section["struct.scrbl"]