diff options
author | Andy Wingo <wingo@pobox.com> | 2013-01-10 16:01:06 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2013-01-10 16:01:06 +0100 |
commit | 921cd222b992f719dc870239bc196688b8d3d507 (patch) | |
tree | e37946f2683aed6ca03bcbaecd89787afcedeb13 | |
parent | 03a2f59851ff9e9ae751c92c5608ef2a197c4938 (diff) | |
download | guile-921cd222b992f719dc870239bc196688b8d3d507.tar.gz |
deprecate SCM_CHAR_CODE_LIMIT and char-code-limit
* libguile/__scm.h:
* libguile/deprecated.h (SCM_CHAR_CODE_LIMIT): Move declaration here
from __scm.h.
* libguile/feature.c:
* module/ice-9/deprecated.scm (char-code-limit): Move definition here.
* test-suite/tests/regexp.test: Update to not use char-code-limit.
-rw-r--r-- | doc/guile-api.alist | 1 | ||||
-rw-r--r-- | libguile/__scm.h | 8 | ||||
-rw-r--r-- | libguile/deprecated.h | 10 | ||||
-rw-r--r-- | libguile/feature.c | 4 | ||||
-rw-r--r-- | module/ice-9/deprecated.scm | 7 | ||||
-rw-r--r-- | test-suite/tests/regexp.test | 23 |
6 files changed, 29 insertions, 24 deletions
diff --git a/doc/guile-api.alist b/doc/guile-api.alist index 5f73cae3a..5830c917a 100644 --- a/doc/guile-api.alist +++ b/doc/guile-api.alist @@ -466,7 +466,6 @@ (char-ci=? (groups Scheme) (scan-data "#<primitive-procedure char-ci=?>")) (char-ci>=? (groups Scheme) (scan-data "#<primitive-procedure char-ci>=?>")) (char-ci>? (groups Scheme) (scan-data "#<primitive-procedure char-ci>?>")) -(char-code-limit (groups Scheme) (scan-data "")) (char-downcase (groups Scheme) (scan-data "#<primitive-procedure char-downcase>")) (char-is-both? (groups Scheme) (scan-data "#<primitive-procedure char-is-both?>")) (char-lower-case? (groups Scheme) (scan-data "#<primitive-procedure char-lower-case?>")) diff --git a/libguile/__scm.h b/libguile/__scm.h index 1c20bd71a..47ed12b75 100644 --- a/libguile/__scm.h +++ b/libguile/__scm.h @@ -4,7 +4,7 @@ #define SCM___SCM_H /* Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2006, - * 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. + * 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -436,12 +436,6 @@ # define SCM_LONG_BIT (SCM_CHAR_BIT * sizeof (long) / sizeof (char)) #endif -#ifdef UCHAR_MAX -# define SCM_CHAR_CODE_LIMIT (UCHAR_MAX + 1L) -#else -# define SCM_CHAR_CODE_LIMIT 256L -#endif - #define SCM_I_UTYPE_MAX(type) ((type)-1) #define SCM_I_TYPE_MAX(type,umax) ((type)((umax)/2)) #define SCM_I_TYPE_MIN(type,umax) (-((type)((umax)/2))-1) diff --git a/libguile/deprecated.h b/libguile/deprecated.h index ae0891f88..de85c6f4e 100644 --- a/libguile/deprecated.h +++ b/libguile/deprecated.h @@ -5,7 +5,7 @@ #ifndef SCM_DEPRECATED_H #define SCM_DEPRECATED_H -/* Copyright (C) 2003,2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. +/* Copyright (C) 2003,2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -839,6 +839,14 @@ SCM_DEPRECATED SCM scm_struct_vtable_tag (SCM handle); +#ifdef UCHAR_MAX +# define SCM_CHAR_CODE_LIMIT (UCHAR_MAX + 1L) +#else +# define SCM_CHAR_CODE_LIMIT 256L +#endif + + + void scm_i_init_deprecated (void); #endif diff --git a/libguile/feature.c b/libguile/feature.c index f3bddc788..464697508 100644 --- a/libguile/feature.c +++ b/libguile/feature.c @@ -1,5 +1,5 @@ /* Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - * 2006, 2007, 2009, 2011 Free Software Foundation, Inc. + * 2006, 2007, 2009, 2011, 2013 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -123,8 +123,6 @@ scm_init_feature() scm_add_feature ("threads"); #endif - scm_c_define ("char-code-limit", scm_from_int (SCM_CHAR_CODE_LIMIT)); - #include "libguile/feature.x" } diff --git a/module/ice-9/deprecated.scm b/module/ice-9/deprecated.scm index 9d80cfe65..3d401934b 100644 --- a/module/ice-9/deprecated.scm +++ b/module/ice-9/deprecated.scm @@ -70,7 +70,8 @@ read-hash-procedures process-define-module fluid-let-syntax - set-system-module!)) + set-system-module! + char-code-limit)) ;;;; Deprecated definitions. @@ -896,3 +897,7 @@ it.") (issue-deprecation-warning "`module-eval-closure' is deprecated. Use module-variable or module-define! instead.") (standard-eval-closure m))) + +;; Legacy definition. We can't make it identifier-syntax yet though, +;; because compiled code might rely on it. +(define char-code-limit 256) diff --git a/test-suite/tests/regexp.test b/test-suite/tests/regexp.test index d549df2cb..b5c59f030 100644 --- a/test-suite/tests/regexp.test +++ b/test-suite/tests/regexp.test @@ -2,7 +2,7 @@ ;;;; Jim Blandy <jimb@red-bean.com> --- September 1999 ;;;; ;;;; Copyright (C) 1999, 2004, 2006, 2007, 2008, 2009, 2010, -;;;; 2012 Free Software Foundation, Inc. +;;;; 2012, 2013 Free Software Foundation, Inc. ;;;; ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public @@ -171,10 +171,10 @@ (let ((lst `((regexp/basic ,regexp/basic) (regexp/extended ,regexp/extended))) - ;; string of all characters, except #\nul which doesn't work because - ;; it's the usual end-of-string for the underlying C regexec() - (allchars (list->string (map integer->char - (cdr (iota char-code-limit)))))) + ;; String of all latin-1 characters, except #\nul which doesn't + ;; work because it's the usual end-of-string for the underlying + ;; C regexec(). + (allchars (list->string (map integer->char (cdr (iota 256)))))) (for-each (lambda (elem) (let ((name (car elem)) @@ -182,9 +182,9 @@ (with-test-prefix name - ;; try on each individual character, except #\nul + ;; Try on each individual latin-1 character, except #\nul. (do ((i 1 (1+ i))) - ((>= i char-code-limit)) + ((>= i 256)) (let* ((c (integer->char i)) (s (string c))) (pass-if (list "char" i (format #f "~s ~s" c s)) @@ -194,11 +194,12 @@ (and (= 0 (match:start m)) (= 1 (match:end m)))))))) - ;; try on pattern "aX" where X is each character, except #\nul - ;; this exposes things like "?" which are special only when they - ;; follow a pattern to repeat or whatever ("a" in this case) + ;; Try on pattern "aX" where X is each latin-1 character, + ;; except #\nul. This exposes things like "?" which are + ;; special only when they follow a pattern to repeat or + ;; whatever ("a" in this case). (do ((i 1 (1+ i))) - ((>= i char-code-limit)) + ((>= i 256)) (let* ((c (integer->char i)) (s (string #\a c)) (q (with-unicode (regexp-quote s)))) |