From: Chris Hanson Date: Sat, 30 Nov 2019 23:13:06 +0000 (-0800) Subject: Rename SRE? -> VALID-SRE?. X-Git-Tag: mit-scheme-pucked-10.1.20~10^2~33 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=72a93c0f9a66484b20d323837ee482657d209f7b;p=mit-scheme.git Rename SRE? -> VALID-SRE?. --- diff --git a/src/runtime/runtime.pkg b/src/runtime/runtime.pkg index 5a6cf9f3f..ce624348e 100644 --- a/src/runtime/runtime.pkg +++ b/src/runtime/runtime.pkg @@ -5532,7 +5532,6 @@ USA. (parent (runtime regexp)) (export () condition-type:compile-regexp - cset-sre? print-regexp regexp regexp->nfa @@ -5547,7 +5546,8 @@ USA. regexp-matches? regexp-search regexp? - sre?)) + valid-cset-sre? + valid-sre?)) (define-package (runtime regexp rules) (files "regexp-rules") diff --git a/src/runtime/srfi-115.scm b/src/runtime/srfi-115.scm index 11a66e886..bf40615ab 100644 --- a/src/runtime/srfi-115.scm +++ b/src/runtime/srfi-115.scm @@ -29,16 +29,16 @@ USA. (declare (usual-integrations)) -(define (sre? object) +(define (valid-sre? object) (and (or (find-cset-sre-rule object) (find-sre-rule object)) #t)) -(register-predicate! sre? 'source-regexp) +(register-predicate! valid-sre? 'source-regexp) -(define (cset-sre? object) +(define (valid-cset-sre? object) (and (find-cset-sre-rule object) #t)) -(register-predicate! cset-sre? 'char-set-regexp) +(register-predicate! valid-cset-sre? 'char-set-regexp) (define (compile-sre-top-level sre) (make-regexp @@ -272,46 +272,46 @@ USA. (lambda (string) (insn:string string #f)) string?) -(define-sre-rule `(* . ,sre?) +(define-sre-rule `(* . ,valid-sre?) (lambda sres (insn:* (compile-sres sres)))) (define-sre-alias 'zero-or-more '*) -(define-sre-rule `(+ . ,sre?) +(define-sre-rule `(+ . ,valid-sre?) (lambda sres (insn:>= 1 (compile-sres sres)))) (define-sre-alias 'one-or-more '+) -(define-sre-rule `(? . ,sre?) +(define-sre-rule `(? . ,valid-sre?) (lambda sres (insn:? (compile-sres sres)))) (define-sre-alias 'optional '?) -(define-sre-rule `(= ,min-arity? . ,sre?) +(define-sre-rule `(= ,min-arity? . ,valid-sre?) (lambda (n . sres) (insn:= n (compile-sres sres)))) (define-sre-alias 'exactly '=) -(define-sre-rule `(>= ,min-arity? . ,sre?) +(define-sre-rule `(>= ,min-arity? . ,valid-sre?) (lambda (n . sres) (insn:>= n (compile-sres sres)))) (define-sre-alias 'at-least '>=) -(define-sre-rule `(** ,min-arity? ,max-arity? . ,sre?) +(define-sre-rule `(** ,min-arity? ,max-arity? . ,valid-sre?) (lambda (n m . sres) (insn:** n m (compile-sres sres))) (lambda (n m . sres) (declare (ignore sres)) (<= n m))) (define-sre-alias 'repeated '**) -(define-sre-rule `(|\|| . ,sre?) +(define-sre-rule `(|\|| . ,valid-sre?) (lambda sres (insn:alt (map-in-order compile-sre sres)))) (define-sre-alias 'or '|\||) -(define-sre-rule `(: . ,sre?) +(define-sre-rule `(: . ,valid-sre?) (lambda sres (compile-sres sres))) (define-sre-alias 'seq ':) -(define-sre-rule `($ . ,sre?) +(define-sre-rule `($ . ,valid-sre?) (lambda sres (insn:group (next-submatch-number) (compile-sres sres)))) (define-sre-alias 'submatch '$) -(define-sre-rule `(-> ,interned-symbol? . ,sre?) +(define-sre-rule `(-> ,interned-symbol? . ,valid-sre?) (lambda (key . sres) (insn:group key (compile-sres sres)))) (define-sre-alias 'submatch-named '->) @@ -321,15 +321,15 @@ USA. (define-sre-rule 'bol (lambda () (insn:line-start))) (define-sre-rule 'eol (lambda () (insn:line-end))) -(define-sre-rule `(?? . ,sre?) +(define-sre-rule `(?? . ,valid-sre?) (lambda sres (insn:?? (compile-sres sres)))) (define-sre-alias 'non-greedy-optional '??) -(define-sre-rule `(*? . ,sre?) +(define-sre-rule `(*? . ,valid-sre?) (lambda sres (insn:*? (compile-sres sres)))) (define-sre-alias 'non-greedy-zero-or-more '*?) -(define-sre-rule `(**? ,min-arity? ,max-arity? . ,sre?) +(define-sre-rule `(**? ,min-arity? ,max-arity? . ,valid-sre?) (lambda (n m . sres) (insn:**? n m (compile-sres sres))) (lambda (n m . sres) (declare (ignore sres)) (<= n m))) (define-sre-alias 'non-greedy-repeated '**?) @@ -384,19 +384,19 @@ USA. (lambda rs (char-set* (append-map range-spec->ranges rs)))) (define-cset-sre-alias 'char-range '/) -(define-cset-sre-rule `(or . ,cset-sre?) +(define-cset-sre-rule `(or . ,valid-cset-sre?) (lambda cset-sres (char-set-union* (compile-cset-sres cset-sres)))) (define-cset-sre-alias '|\|| 'or) -(define-cset-sre-rule `(and . ,cset-sre?) +(define-cset-sre-rule `(and . ,valid-cset-sre?) (lambda cset-sres (char-set-intersection* (compile-cset-sres cset-sres)))) (define-cset-sre-alias '& 'and) -(define-cset-sre-rule `(- . ,cset-sre?) +(define-cset-sre-rule `(- . ,valid-cset-sre?) (lambda cset-sres (apply char-set-difference (compile-cset-sres cset-sres)))) (define-cset-sre-alias 'difference '-) -(define-cset-sre-rule `(~ . ,cset-sre?) +(define-cset-sre-rule `(~ . ,valid-cset-sre?) (lambda cset-sres (char-set-difference char-set:unicode (char-set-union* (compile-cset-sres cset-sres)))))