From c6d88d12345a3722bf78b124c69f15d73da23dc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sun, 1 Mar 2015 22:46:55 +0100 Subject: [PATCH 01/46] tests: Use 'pass-if-equal' in web-http chunked encoding tests. * test-suite/tests/web-http.test ("chunked encoding"): Use 'pass-if-equal' where appropriate. --- test-suite/tests/web-http.test | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/test-suite/tests/web-http.test b/test-suite/tests/web-http.test index f01a8326d..09b029064 100644 --- a/test-suite/tests/web-http.test +++ b/test-suite/tests/web-http.test @@ -1,6 +1,6 @@ ;;;; web-uri.test --- URI library -*- mode: scheme; coding: utf-8; -*- ;;;; -;;;; Copyright (C) 2010, 2011, 2014, 2016 Free Software Foundation, Inc. +;;;; Copyright (C) 2010-2011, 2014-2016 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 @@ -369,18 +369,19 @@ (with-test-prefix "chunked encoding" (let* ((s "5\r\nFirst\r\nA\r\n line\n Sec\r\n8\r\nond line\r\n0\r\n") (p (make-chunked-input-port (open-input-string s)))) - (pass-if (equal? "First line\n Second line" - (get-string-all p))) + (pass-if-equal + "First line\n Second line" + (get-string-all p)) (pass-if (port-eof? (make-chunked-input-port (open-input-string "0\r\n"))))) - (pass-if - (equal? (call-with-output-string - (lambda (out-raw) - (let ((out-chunked (make-chunked-output-port out-raw - #:keep-alive? #t))) - (display "First chunk" out-chunked) - (force-output out-chunked) - (display "Second chunk" out-chunked) - (force-output out-chunked) - (display "Third chunk" out-chunked) - (close-port out-chunked)))) - "b\r\nFirst chunk\r\nc\r\nSecond chunk\r\nb\r\nThird chunk\r\n0\r\n"))) + (pass-if-equal + (call-with-output-string + (lambda (out-raw) + (let ((out-chunked (make-chunked-output-port out-raw + #:keep-alive? #t))) + (display "First chunk" out-chunked) + (force-output out-chunked) + (display "Second chunk" out-chunked) + (force-output out-chunked) + (display "Third chunk" out-chunked) + (close-port out-chunked)))) + "b\r\nFirst chunk\r\nc\r\nSecond chunk\r\nb\r\nThird chunk\r\n0\r\n")) From 751a55e3552547c84cc3cc0ad69fc6f26bd7251e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sun, 1 Mar 2015 23:41:01 +0100 Subject: [PATCH 02/46] http: Do not buffer HTTP chunks. Fixes . * module/web/http.scm (read-chunk, read-chunk-body): Remove. (make-chunked-input-port)[next-chunk, buffer-, buffer-size, buffer-pointer]: Remove. [chunk-size, remaining]: New variables. [read!]: Rewrite to write directly to BV. * test-suite/tests/web-http.test ("chunked encoding")["reads chunks without buffering", "reads across chunk boundaries"]: New tests. --- module/web/http.scm | 66 +++++++++++++++++----------------- test-suite/tests/web-http.test | 54 ++++++++++++++++++++++++++-- 2 files changed, 84 insertions(+), 36 deletions(-) diff --git a/module/web/http.scm b/module/web/http.scm index 9e8e4a3a5..8093ed21d 100644 --- a/module/web/http.scm +++ b/module/web/http.scm @@ -1,6 +1,6 @@ ;;; HTTP messages -;; Copyright (C) 2010, 2011, 2012, 2013, 2014, 2016 Free Software Foundation, Inc. +;; Copyright (C) 2010-2016 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 @@ -1914,6 +1914,7 @@ treated specially, and is just returned as a plain string." ;; Chunked Responses (define (read-chunk-header port) + "Read a chunk header and return the chunk size." (let* ((str (read-line port)) (extension-start (string-index str (lambda (c) (or (char=? c #\;) (char=? c #\return))))) @@ -1923,53 +1924,50 @@ treated specially, and is just returned as a plain string." 16))) size)) -(define (read-chunk port) - (let ((size (read-chunk-header port))) - (read-chunk-body port size))) - -(define (read-chunk-body port size) - (let ((bv (get-bytevector-n port size))) - (get-u8 port) ; CR - (get-u8 port) ; LF - bv)) - (define* (make-chunked-input-port port #:key (keep-alive? #f)) "Returns a new port which translates HTTP chunked transfer encoded data from PORT into a non-encoded format. Returns eof when it has read the final chunk from PORT. This does not necessarily mean that there is no more data on PORT. When the returned port is closed it will also close PORT, unless the KEEP-ALIVE? is true." - (define (next-chunk) - (read-chunk port)) - (define finished? #f) (define (close) (unless keep-alive? (close-port port))) - (define buffer #vu8()) - (define buffer-size 0) - (define buffer-pointer 0) + + (define chunk-size 0) ;size of the current chunk + (define remaining 0) ;number of bytes left from the current chunk + (define finished? #f) ;did we get all the chunks? + (define (read! bv idx to-read) (define (loop to-read num-read) (cond ((or finished? (zero? to-read)) num-read) - ((<= to-read (- buffer-size buffer-pointer)) - (bytevector-copy! buffer buffer-pointer - bv (+ idx num-read) - to-read) - (set! buffer-pointer (+ buffer-pointer to-read)) - (loop 0 (+ num-read to-read))) - (else - (let ((n (- buffer-size buffer-pointer))) - (bytevector-copy! buffer buffer-pointer - bv (+ idx num-read) - n) - (set! buffer (next-chunk)) - (set! buffer-pointer 0) - (set! buffer-size (bytevector-length buffer)) - (set! finished? (= buffer-size 0)) - (loop (- to-read n) - (+ num-read n)))))) + ((zero? remaining) ;get a new chunk + (let ((size (read-chunk-header port))) + (set! chunk-size size) + (set! remaining size) + (if (zero? size) + (begin + (set! finished? #t) + num-read) + (loop to-read num-read)))) + (else ;read from the current chunk + (let* ((ask-for (min to-read remaining)) + (read (get-bytevector-n! port bv (+ idx num-read) + ask-for))) + (if (eof-object? read) + (begin ;premature termination + (set! finished? #t) + num-read) + (let ((left (- remaining read))) + (set! remaining left) + (when (zero? left) + ;; We're done with this chunk; read CR and LF. + (get-u8 port) (get-u8 port)) + (loop (- to-read read) + (+ num-read read)))))))) (loop to-read 0)) + (make-custom-binary-input-port "chunked input port" read! #f #f close)) (define* (make-chunked-output-port port #:key (keep-alive? #f) diff --git a/test-suite/tests/web-http.test b/test-suite/tests/web-http.test index 09b029064..8a7a29542 100644 --- a/test-suite/tests/web-http.test +++ b/test-suite/tests/web-http.test @@ -1,4 +1,4 @@ -;;;; web-uri.test --- URI library -*- mode: scheme; coding: utf-8; -*- +;;;; web-http.test --- HTTP library -*- mode: scheme; coding: utf-8; -*- ;;;; ;;;; Copyright (C) 2010-2011, 2014-2016 Free Software Foundation, Inc. ;;;; @@ -20,6 +20,7 @@ (define-module (test-suite web-http) #:use-module (web uri) #:use-module (web http) + #:use-module (rnrs bytevectors) #:use-module (rnrs io ports) #:use-module (ice-9 regex) #:use-module (ice-9 control) @@ -372,7 +373,56 @@ (pass-if-equal "First line\n Second line" (get-string-all p)) - (pass-if (port-eof? (make-chunked-input-port (open-input-string "0\r\n"))))) + (pass-if (port-eof? (make-chunked-input-port (open-input-string "0\r\n")))) + + (pass-if-equal "reads chunks without buffering" + ;; Make sure the chunked input port does not read more than what + ;; the client asked. See + `("First " "chunk." "Second " "chunk." + (1 1 1 6 6 1 1 + 1 1 1 7 6 1 1)) + (let* ((str "C\r\nFirst chunk.\r\nD\r\nSecond chunk.\r\n") + (requests '()) + (read! (let ((port (open-input-string str))) + (lambda (bv index count) + (set! requests (cons count requests)) + (let ((n (get-bytevector-n! port bv index + count))) + (if (eof-object? n) 0 n))))) + (input (make-custom-binary-input-port "chunky" read! + #f #f #f)) + (port (make-chunked-input-port input))) + (setvbuf input _IONBF) + (setvbuf port _IONBF) + (list (utf8->string (get-bytevector-n port 6)) + (utf8->string (get-bytevector-n port 6)) + (utf8->string (get-bytevector-n port 7)) + (utf8->string (get-bytevector-n port 6)) + (reverse requests)))) + + (pass-if-equal "reads across chunk boundaries" + ;; Same, but read across chunk boundaries. + `("First " "chunk.Second " "chunk." + (1 1 1 6 6 1 1 + 1 1 1 7 6 1 1)) + (let* ((str "C\r\nFirst chunk.\r\nD\r\nSecond chunk.\r\n") + (requests '()) + (read! (let ((port (open-input-string str))) + (lambda (bv index count) + (set! requests (cons count requests)) + (let ((n (get-bytevector-n! port bv index + count))) + (if (eof-object? n) 0 n))))) + (input (make-custom-binary-input-port "chunky" read! + #f #f #f)) + (port (make-chunked-input-port input))) + (setvbuf input _IONBF) + (setvbuf port _IONBF) + (list (utf8->string (get-bytevector-n port 6)) + (utf8->string (get-bytevector-n port 13)) + (utf8->string (get-bytevector-n port 6)) + (reverse requests))))) + (pass-if-equal (call-with-output-string (lambda (out-raw) From e390e5760b8811be04665e160d0eb79d3721c453 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Thu, 22 Jan 2015 01:22:19 -0500 Subject: [PATCH 03/46] Implement 'string-utf8-length' and 'scm_c_string_utf8_length'. * libguile/strings.c (utf8_length, scm_c_string_utf8_length) (scm_string_utf8_length): New functions. * libguile/strings.h (scm_c_string_utf8_length, scm_string_utf8_length): New prototypes. * doc/ref/api-data.texi (Bytevectors as Strings): Add docs. * doc/ref/guile.texi: Update manual copyright date to 2015. * test-suite/tests/strings.test (string-utf8-length): Add tests. --- doc/ref/api-data.texi | 8 +++++++- doc/ref/guile.texi | 2 +- libguile/strings.c | 34 +++++++++++++++++++++++++++++++++- libguile/strings.h | 5 ++++- test-suite/tests/strings.test | 20 ++++++++++++++++++-- 5 files changed, 63 insertions(+), 6 deletions(-) diff --git a/doc/ref/api-data.texi b/doc/ref/api-data.texi index 3f787b1c9..3a3a8e4ac 100644 --- a/doc/ref/api-data.texi +++ b/doc/ref/api-data.texi @@ -1,6 +1,6 @@ @c -*-texinfo-*- @c This is part of the GNU Guile Reference Manual. -@c Copyright (C) 1996, 1997, 2000-2004, 2006-2014 +@c Copyright (C) 1996, 1997, 2000-2004, 2006-2015 @c Free Software Foundation, Inc. @c See the file guile.texi for copying conditions. @@ -4983,6 +4983,12 @@ in one of the most commonly available encoding formats. @result{} #vu8(99 97 102 195 169) @end lisp +@deftypefn {Scheme Procedure} {} string-utf8-length str +@deftypefnx {C function} SCM scm_string_utf8_length (str) +@deftypefnx {C function} size_t scm_c_string_utf8_length (str) +Return the number of bytes in the UTF-8 representation of @var{str}. +@end deftypefn + @deffn {Scheme Procedure} string->utf8 str @deffnx {Scheme Procedure} string->utf16 str [endianness] @deffnx {Scheme Procedure} string->utf32 str [endianness] diff --git a/doc/ref/guile.texi b/doc/ref/guile.texi index 5f21188fa..cb4c431f2 100644 --- a/doc/ref/guile.texi +++ b/doc/ref/guile.texi @@ -14,7 +14,7 @@ This manual documents Guile version @value{VERSION}. Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005, 2009, -2010, 2011, 2012, 2013, 2014 Free Software Foundation. +2010, 2011, 2012, 2013, 2014, 2015 Free Software Foundation. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or diff --git a/libguile/strings.c b/libguile/strings.c index 2e5647e6d..dc2e4f5fe 100644 --- a/libguile/strings.c +++ b/libguile/strings.c @@ -1,5 +1,5 @@ /* Copyright (C) 1995, 1996, 1998, 2000, 2001, 2004, 2006, - * 2008-2015 Free Software Foundation, Inc. + * 2008-2016 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 @@ -2065,6 +2065,38 @@ u32_u8_length_in_bytes (const scm_t_uint32 *str, size_t len) return ret; } +static size_t +utf8_length (SCM str) +{ + if (scm_i_is_narrow_string (str)) + return latin1_u8_strlen ((scm_t_uint8 *) scm_i_string_chars (str), + scm_i_string_length (str)); + else + return u32_u8_length_in_bytes + ((scm_t_uint32 *) scm_i_string_wide_chars (str), + scm_i_string_length (str)); +} + +size_t +scm_c_string_utf8_length (SCM string) +#define FUNC_NAME "scm_c_string_utf8_length" +{ + SCM_VALIDATE_STRING (1, string); + return utf8_length (string); +} +#undef FUNC_NAME + +SCM_DEFINE (scm_string_utf8_length, "string-utf8-length", 1, 0, 0, + (SCM string), + "Returns the number of bytes in the UTF-8 representation of " + "@var{string}.") +#define FUNC_NAME s_scm_string_utf8_length +{ + SCM_VALIDATE_STRING (1, string); + return scm_from_size_t (utf8_length (string)); +} +#undef FUNC_NAME + char * scm_to_utf8_stringn (SCM str, size_t *lenp) #define FUNC_NAME "scm_to_utf8_stringn" diff --git a/libguile/strings.h b/libguile/strings.h index 24471cd69..882e7ce64 100644 --- a/libguile/strings.h +++ b/libguile/strings.h @@ -3,7 +3,8 @@ #ifndef SCM_STRINGS_H #define SCM_STRINGS_H -/* Copyright (C) 1995,1996,1997,1998,2000,2001, 2004, 2005, 2006, 2008, 2009, 2010, 2011, 2013 Free Software Foundation, Inc. +/* Copyright (C) 1995-1998, 2000, 2001, 2004-2006, 2008-2011, 2013, + * 2015-2016 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 @@ -107,6 +108,7 @@ SCM_API SCM scm_string_p (SCM x); SCM_API SCM scm_string (SCM chrs); SCM_API SCM scm_make_string (SCM k, SCM chr); SCM_API SCM scm_string_length (SCM str); +SCM_API SCM scm_string_utf8_length (SCM str); SCM_API SCM scm_string_bytes_per_char (SCM str); SCM_API SCM scm_string_ref (SCM str, SCM k); SCM_API SCM scm_string_set_x (SCM str, SCM k, SCM chr); @@ -120,6 +122,7 @@ SCM_API SCM scm_from_stringn (const char *str, size_t len, const char *encoding, scm_t_string_failed_conversion_handler handler); SCM_API SCM scm_c_make_string (size_t len, SCM chr); SCM_API size_t scm_c_string_length (SCM str); +SCM_API size_t scm_c_string_utf8_length (SCM str); SCM_API size_t scm_c_symbol_length (SCM sym); SCM_API SCM scm_c_string_ref (SCM str, size_t pos); SCM_API void scm_c_string_set_x (SCM str, size_t pos, SCM chr); diff --git a/test-suite/tests/strings.test b/test-suite/tests/strings.test index 56c898c8b..66c8a6b95 100644 --- a/test-suite/tests/strings.test +++ b/test-suite/tests/strings.test @@ -1,8 +1,8 @@ ;;;; strings.test --- test suite for Guile's string functions -*- scheme -*- ;;;; Jim Blandy --- August 1999 ;;;; -;;;; Copyright (C) 1999, 2001, 2004, 2005, 2006, 2008, 2009, 2010, -;;;; 2011, 2013 Free Software Foundation, Inc. +;;;; Copyright (C) 1999, 2001, 2004-2006, 2008-2011, 2013, +;;;; 2015 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 @@ -457,6 +457,22 @@ (pass-if "compatibility composition is equal?" (equal? (string-normalize-nfkc "\u1e9b\u0323") "\u1e69"))) +;; +;; string-utf8-length +;; + +(with-test-prefix "string-utf8-length" + + (pass-if-exception "wrong type argument" + exception:wrong-type-arg + (string-utf8-length 50)) + + (pass-if-equal 0 (string-utf8-length "")) + (pass-if-equal 1 (string-utf8-length "\0")) + (pass-if-equal 5 (string-utf8-length "hello")) + (pass-if-equal 7 (string-utf8-length "helloλ")) + (pass-if-equal 9 (string-utf8-length "ሠላም"))) + ;; ;; string-ref ;; From 30db824b923ba9cdb3dc1783af03f9b164a87f6e Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Wed, 18 Feb 2015 16:32:21 -0500 Subject: [PATCH 04/46] Don't return expressions from void functions in numbers.c Although popular compilers allow it as long as the expression is of type void, it violates C99 and some compilers choke on it. * libguile/numbers.c (scm_euclidean_divide, scm_floor_divide) (scm_ceiling_divide, scm_truncate_divide, scm_centered_divide) (scm_round_divide): Don't use the return statement with an expression from functions with return type void. --- libguile/numbers.c | 246 ++++++++++++++++++++------------------------- 1 file changed, 108 insertions(+), 138 deletions(-) diff --git a/libguile/numbers.c b/libguile/numbers.c index 4f740c583..9cc72d269 100644 --- a/libguile/numbers.c +++ b/libguile/numbers.c @@ -1,6 +1,4 @@ -/* Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - * 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, - * 2013, 2014 Free Software Foundation, Inc. +/* Copyright (C) 1995-2015 Free Software Foundation, Inc. * * Portions Copyright 1990, 1991, 1992, 1993 by AT&T Bell Laboratories * and Bellcore. See scm_divide. @@ -1173,9 +1171,9 @@ void scm_euclidean_divide (SCM x, SCM y, SCM *qp, SCM *rp) { if (scm_is_false (scm_negative_p (y))) - return scm_floor_divide (x, y, qp, rp); + scm_floor_divide (x, y, qp, rp); else - return scm_ceiling_divide (x, y, qp, rp); + scm_ceiling_divide (x, y, qp, rp); } static SCM scm_i_inexact_floor_quotient (double x, double y); @@ -1549,7 +1547,6 @@ scm_floor_divide (SCM x, SCM y, SCM *qp, SCM *rp) *qp = scm_i_inum2big (qq); *rp = SCM_I_MAKINUM (rr); } - return; } else if (SCM_BIGP (y)) { @@ -1584,15 +1581,14 @@ scm_floor_divide (SCM x, SCM y, SCM *qp, SCM *rp) *qp = SCM_I_MAKINUM (-1); *rp = scm_i_normbig (r); } - return; } else if (SCM_REALP (y)) - return scm_i_inexact_floor_divide (xx, SCM_REAL_VALUE (y), qp, rp); + scm_i_inexact_floor_divide (xx, SCM_REAL_VALUE (y), qp, rp); else if (SCM_FRACTIONP (y)) - return scm_i_exact_rational_floor_divide (x, y, qp, rp); + scm_i_exact_rational_floor_divide (x, y, qp, rp); else - return two_valued_wta_dispatch_2 (g_scm_floor_divide, x, y, SCM_ARG2, - s_scm_floor_divide, qp, rp); + two_valued_wta_dispatch_2 (g_scm_floor_divide, x, y, SCM_ARG2, + s_scm_floor_divide, qp, rp); } else if (SCM_BIGP (x)) { @@ -1618,7 +1614,6 @@ scm_floor_divide (SCM x, SCM y, SCM *qp, SCM *rp) *qp = scm_i_normbig (q); *rp = scm_i_normbig (r); } - return; } else if (SCM_BIGP (y)) { @@ -1629,41 +1624,40 @@ scm_floor_divide (SCM x, SCM y, SCM *qp, SCM *rp) scm_remember_upto_here_2 (x, y); *qp = scm_i_normbig (q); *rp = scm_i_normbig (r); - return; } else if (SCM_REALP (y)) - return scm_i_inexact_floor_divide - (scm_i_big2dbl (x), SCM_REAL_VALUE (y), qp, rp); + scm_i_inexact_floor_divide (scm_i_big2dbl (x), SCM_REAL_VALUE (y), + qp, rp); else if (SCM_FRACTIONP (y)) - return scm_i_exact_rational_floor_divide (x, y, qp, rp); + scm_i_exact_rational_floor_divide (x, y, qp, rp); else - return two_valued_wta_dispatch_2 (g_scm_floor_divide, x, y, SCM_ARG2, - s_scm_floor_divide, qp, rp); + two_valued_wta_dispatch_2 (g_scm_floor_divide, x, y, SCM_ARG2, + s_scm_floor_divide, qp, rp); } else if (SCM_REALP (x)) { if (SCM_REALP (y) || SCM_I_INUMP (y) || SCM_BIGP (y) || SCM_FRACTIONP (y)) - return scm_i_inexact_floor_divide - (SCM_REAL_VALUE (x), scm_to_double (y), qp, rp); + scm_i_inexact_floor_divide (SCM_REAL_VALUE (x), scm_to_double (y), + qp, rp); else - return two_valued_wta_dispatch_2 (g_scm_floor_divide, x, y, SCM_ARG2, - s_scm_floor_divide, qp, rp); + two_valued_wta_dispatch_2 (g_scm_floor_divide, x, y, SCM_ARG2, + s_scm_floor_divide, qp, rp); } else if (SCM_FRACTIONP (x)) { if (SCM_REALP (y)) - return scm_i_inexact_floor_divide - (scm_i_fraction2double (x), SCM_REAL_VALUE (y), qp, rp); + scm_i_inexact_floor_divide + (scm_i_fraction2double (x), SCM_REAL_VALUE (y), qp, rp); else if (SCM_I_INUMP (y) || SCM_BIGP (y) || SCM_FRACTIONP (y)) - return scm_i_exact_rational_floor_divide (x, y, qp, rp); + scm_i_exact_rational_floor_divide (x, y, qp, rp); else - return two_valued_wta_dispatch_2 (g_scm_floor_divide, x, y, SCM_ARG2, - s_scm_floor_divide, qp, rp); + two_valued_wta_dispatch_2 (g_scm_floor_divide, x, y, SCM_ARG2, + s_scm_floor_divide, qp, rp); } else - return two_valued_wta_dispatch_2 (g_scm_floor_divide, x, y, SCM_ARG1, - s_scm_floor_divide, qp, rp); + two_valued_wta_dispatch_2 (g_scm_floor_divide, x, y, SCM_ARG1, + s_scm_floor_divide, qp, rp); } static void @@ -2090,7 +2084,6 @@ scm_ceiling_divide (SCM x, SCM y, SCM *qp, SCM *rp) *qp = scm_i_inum2big (qq); *rp = SCM_I_MAKINUM (rr); } - return; } else if (SCM_BIGP (y)) { @@ -2136,15 +2129,14 @@ scm_ceiling_divide (SCM x, SCM y, SCM *qp, SCM *rp) *qp = SCM_INUM1; *rp = scm_i_normbig (r); } - return; } else if (SCM_REALP (y)) - return scm_i_inexact_ceiling_divide (xx, SCM_REAL_VALUE (y), qp, rp); + scm_i_inexact_ceiling_divide (xx, SCM_REAL_VALUE (y), qp, rp); else if (SCM_FRACTIONP (y)) - return scm_i_exact_rational_ceiling_divide (x, y, qp, rp); + scm_i_exact_rational_ceiling_divide (x, y, qp, rp); else - return two_valued_wta_dispatch_2 (g_scm_ceiling_divide, x, y, SCM_ARG2, - s_scm_ceiling_divide, qp, rp); + two_valued_wta_dispatch_2 (g_scm_ceiling_divide, x, y, SCM_ARG2, + s_scm_ceiling_divide, qp, rp); } else if (SCM_BIGP (x)) { @@ -2170,7 +2162,6 @@ scm_ceiling_divide (SCM x, SCM y, SCM *qp, SCM *rp) *qp = scm_i_normbig (q); *rp = scm_i_normbig (r); } - return; } else if (SCM_BIGP (y)) { @@ -2181,41 +2172,40 @@ scm_ceiling_divide (SCM x, SCM y, SCM *qp, SCM *rp) scm_remember_upto_here_2 (x, y); *qp = scm_i_normbig (q); *rp = scm_i_normbig (r); - return; } else if (SCM_REALP (y)) - return scm_i_inexact_ceiling_divide - (scm_i_big2dbl (x), SCM_REAL_VALUE (y), qp, rp); + scm_i_inexact_ceiling_divide (scm_i_big2dbl (x), SCM_REAL_VALUE (y), + qp, rp); else if (SCM_FRACTIONP (y)) - return scm_i_exact_rational_ceiling_divide (x, y, qp, rp); + scm_i_exact_rational_ceiling_divide (x, y, qp, rp); else - return two_valued_wta_dispatch_2 (g_scm_ceiling_divide, x, y, SCM_ARG2, - s_scm_ceiling_divide, qp, rp); + two_valued_wta_dispatch_2 (g_scm_ceiling_divide, x, y, SCM_ARG2, + s_scm_ceiling_divide, qp, rp); } else if (SCM_REALP (x)) { if (SCM_REALP (y) || SCM_I_INUMP (y) || SCM_BIGP (y) || SCM_FRACTIONP (y)) - return scm_i_inexact_ceiling_divide - (SCM_REAL_VALUE (x), scm_to_double (y), qp, rp); + scm_i_inexact_ceiling_divide (SCM_REAL_VALUE (x), scm_to_double (y), + qp, rp); else - return two_valued_wta_dispatch_2 (g_scm_ceiling_divide, x, y, SCM_ARG2, - s_scm_ceiling_divide, qp, rp); + two_valued_wta_dispatch_2 (g_scm_ceiling_divide, x, y, SCM_ARG2, + s_scm_ceiling_divide, qp, rp); } else if (SCM_FRACTIONP (x)) { if (SCM_REALP (y)) - return scm_i_inexact_ceiling_divide + scm_i_inexact_ceiling_divide (scm_i_fraction2double (x), SCM_REAL_VALUE (y), qp, rp); else if (SCM_I_INUMP (y) || SCM_BIGP (y) || SCM_FRACTIONP (y)) - return scm_i_exact_rational_ceiling_divide (x, y, qp, rp); + scm_i_exact_rational_ceiling_divide (x, y, qp, rp); else - return two_valued_wta_dispatch_2 (g_scm_ceiling_divide, x, y, SCM_ARG2, - s_scm_ceiling_divide, qp, rp); + two_valued_wta_dispatch_2 (g_scm_ceiling_divide, x, y, SCM_ARG2, + s_scm_ceiling_divide, qp, rp); } else - return two_valued_wta_dispatch_2 (g_scm_ceiling_divide, x, y, SCM_ARG1, - s_scm_ceiling_divide, qp, rp); + two_valued_wta_dispatch_2 (g_scm_ceiling_divide, x, y, SCM_ARG1, + s_scm_ceiling_divide, qp, rp); } static void @@ -2573,7 +2563,6 @@ scm_truncate_divide (SCM x, SCM y, SCM *qp, SCM *rp) *qp = scm_i_inum2big (qq); *rp = SCM_I_MAKINUM (rr); } - return; } else if (SCM_BIGP (y)) { @@ -2591,16 +2580,14 @@ scm_truncate_divide (SCM x, SCM y, SCM *qp, SCM *rp) *qp = SCM_INUM0; *rp = x; } - return; } else if (SCM_REALP (y)) - return scm_i_inexact_truncate_divide (xx, SCM_REAL_VALUE (y), qp, rp); + scm_i_inexact_truncate_divide (xx, SCM_REAL_VALUE (y), qp, rp); else if (SCM_FRACTIONP (y)) - return scm_i_exact_rational_truncate_divide (x, y, qp, rp); + scm_i_exact_rational_truncate_divide (x, y, qp, rp); else - return two_valued_wta_dispatch_2 - (g_scm_truncate_divide, x, y, SCM_ARG2, - s_scm_truncate_divide, qp, rp); + two_valued_wta_dispatch_2 (g_scm_truncate_divide, x, y, SCM_ARG2, + s_scm_truncate_divide, qp, rp); } else if (SCM_BIGP (x)) { @@ -2627,7 +2614,6 @@ scm_truncate_divide (SCM x, SCM y, SCM *qp, SCM *rp) *qp = scm_i_normbig (q); *rp = SCM_I_MAKINUM (rr); } - return; } else if (SCM_BIGP (y)) { @@ -2640,41 +2626,38 @@ scm_truncate_divide (SCM x, SCM y, SCM *qp, SCM *rp) *rp = scm_i_normbig (r); } else if (SCM_REALP (y)) - return scm_i_inexact_truncate_divide - (scm_i_big2dbl (x), SCM_REAL_VALUE (y), qp, rp); + scm_i_inexact_truncate_divide (scm_i_big2dbl (x), SCM_REAL_VALUE (y), + qp, rp); else if (SCM_FRACTIONP (y)) - return scm_i_exact_rational_truncate_divide (x, y, qp, rp); + scm_i_exact_rational_truncate_divide (x, y, qp, rp); else - return two_valued_wta_dispatch_2 - (g_scm_truncate_divide, x, y, SCM_ARG2, - s_scm_truncate_divide, qp, rp); + two_valued_wta_dispatch_2 (g_scm_truncate_divide, x, y, SCM_ARG2, + s_scm_truncate_divide, qp, rp); } else if (SCM_REALP (x)) { if (SCM_REALP (y) || SCM_I_INUMP (y) || SCM_BIGP (y) || SCM_FRACTIONP (y)) - return scm_i_inexact_truncate_divide - (SCM_REAL_VALUE (x), scm_to_double (y), qp, rp); + scm_i_inexact_truncate_divide (SCM_REAL_VALUE (x), scm_to_double (y), + qp, rp); else - return two_valued_wta_dispatch_2 - (g_scm_truncate_divide, x, y, SCM_ARG2, - s_scm_truncate_divide, qp, rp); + two_valued_wta_dispatch_2 (g_scm_truncate_divide, x, y, SCM_ARG2, + s_scm_truncate_divide, qp, rp); } else if (SCM_FRACTIONP (x)) { if (SCM_REALP (y)) - return scm_i_inexact_truncate_divide + scm_i_inexact_truncate_divide (scm_i_fraction2double (x), SCM_REAL_VALUE (y), qp, rp); else if (SCM_I_INUMP (y) || SCM_BIGP (y) || SCM_FRACTIONP (y)) - return scm_i_exact_rational_truncate_divide (x, y, qp, rp); + scm_i_exact_rational_truncate_divide (x, y, qp, rp); else - return two_valued_wta_dispatch_2 - (g_scm_truncate_divide, x, y, SCM_ARG2, - s_scm_truncate_divide, qp, rp); + two_valued_wta_dispatch_2 (g_scm_truncate_divide, x, y, SCM_ARG2, + s_scm_truncate_divide, qp, rp); } else - return two_valued_wta_dispatch_2 (g_scm_truncate_divide, x, y, SCM_ARG1, - s_scm_truncate_divide, qp, rp); + two_valued_wta_dispatch_2 (g_scm_truncate_divide, x, y, SCM_ARG1, + s_scm_truncate_divide, qp, rp); } static void @@ -3217,22 +3200,18 @@ scm_centered_divide (SCM x, SCM y, SCM *qp, SCM *rp) *qp = scm_i_inum2big (qq); *rp = SCM_I_MAKINUM (rr); } - return; } else if (SCM_BIGP (y)) - { - /* Pass a denormalized bignum version of x (even though it - can fit in a fixnum) to scm_i_bigint_centered_divide */ - return scm_i_bigint_centered_divide (scm_i_long2big (xx), y, qp, rp); - } + /* Pass a denormalized bignum version of x (even though it + can fit in a fixnum) to scm_i_bigint_centered_divide */ + scm_i_bigint_centered_divide (scm_i_long2big (xx), y, qp, rp); else if (SCM_REALP (y)) - return scm_i_inexact_centered_divide (xx, SCM_REAL_VALUE (y), qp, rp); + scm_i_inexact_centered_divide (xx, SCM_REAL_VALUE (y), qp, rp); else if (SCM_FRACTIONP (y)) - return scm_i_exact_rational_centered_divide (x, y, qp, rp); + scm_i_exact_rational_centered_divide (x, y, qp, rp); else - return two_valued_wta_dispatch_2 - (g_scm_centered_divide, x, y, SCM_ARG2, - s_scm_centered_divide, qp, rp); + two_valued_wta_dispatch_2 (g_scm_centered_divide, x, y, SCM_ARG2, + s_scm_centered_divide, qp, rp); } else if (SCM_BIGP (x)) { @@ -3276,46 +3255,42 @@ scm_centered_divide (SCM x, SCM y, SCM *qp, SCM *rp) *qp = scm_i_normbig (q); *rp = SCM_I_MAKINUM (rr); } - return; } else if (SCM_BIGP (y)) - return scm_i_bigint_centered_divide (x, y, qp, rp); + scm_i_bigint_centered_divide (x, y, qp, rp); else if (SCM_REALP (y)) - return scm_i_inexact_centered_divide - (scm_i_big2dbl (x), SCM_REAL_VALUE (y), qp, rp); + scm_i_inexact_centered_divide (scm_i_big2dbl (x), SCM_REAL_VALUE (y), + qp, rp); else if (SCM_FRACTIONP (y)) - return scm_i_exact_rational_centered_divide (x, y, qp, rp); + scm_i_exact_rational_centered_divide (x, y, qp, rp); else - return two_valued_wta_dispatch_2 - (g_scm_centered_divide, x, y, SCM_ARG2, - s_scm_centered_divide, qp, rp); + two_valued_wta_dispatch_2 (g_scm_centered_divide, x, y, SCM_ARG2, + s_scm_centered_divide, qp, rp); } else if (SCM_REALP (x)) { if (SCM_REALP (y) || SCM_I_INUMP (y) || SCM_BIGP (y) || SCM_FRACTIONP (y)) - return scm_i_inexact_centered_divide - (SCM_REAL_VALUE (x), scm_to_double (y), qp, rp); + scm_i_inexact_centered_divide (SCM_REAL_VALUE (x), scm_to_double (y), + qp, rp); else - return two_valued_wta_dispatch_2 - (g_scm_centered_divide, x, y, SCM_ARG2, - s_scm_centered_divide, qp, rp); + two_valued_wta_dispatch_2 (g_scm_centered_divide, x, y, SCM_ARG2, + s_scm_centered_divide, qp, rp); } else if (SCM_FRACTIONP (x)) { if (SCM_REALP (y)) - return scm_i_inexact_centered_divide - (scm_i_fraction2double (x), SCM_REAL_VALUE (y), qp, rp); + scm_i_inexact_centered_divide + (scm_i_fraction2double (x), SCM_REAL_VALUE (y), qp, rp); else if (SCM_I_INUMP (y) || SCM_BIGP (y) || SCM_FRACTIONP (y)) - return scm_i_exact_rational_centered_divide (x, y, qp, rp); + scm_i_exact_rational_centered_divide (x, y, qp, rp); else - return two_valued_wta_dispatch_2 - (g_scm_centered_divide, x, y, SCM_ARG2, - s_scm_centered_divide, qp, rp); + two_valued_wta_dispatch_2 (g_scm_centered_divide, x, y, SCM_ARG2, + s_scm_centered_divide, qp, rp); } else - return two_valued_wta_dispatch_2 (g_scm_centered_divide, x, y, SCM_ARG1, - s_scm_centered_divide, qp, rp); + two_valued_wta_dispatch_2 (g_scm_centered_divide, x, y, SCM_ARG1, + s_scm_centered_divide, qp, rp); } static void @@ -3897,22 +3872,18 @@ scm_round_divide (SCM x, SCM y, SCM *qp, SCM *rp) *qp = scm_i_inum2big (qq); *rp = SCM_I_MAKINUM (rr); } - return; } else if (SCM_BIGP (y)) - { - /* Pass a denormalized bignum version of x (even though it - can fit in a fixnum) to scm_i_bigint_round_divide */ - return scm_i_bigint_round_divide - (scm_i_long2big (SCM_I_INUM (x)), y, qp, rp); - } + /* Pass a denormalized bignum version of x (even though it + can fit in a fixnum) to scm_i_bigint_round_divide */ + scm_i_bigint_round_divide (scm_i_long2big (SCM_I_INUM (x)), y, qp, rp); else if (SCM_REALP (y)) - return scm_i_inexact_round_divide (xx, SCM_REAL_VALUE (y), qp, rp); + scm_i_inexact_round_divide (xx, SCM_REAL_VALUE (y), qp, rp); else if (SCM_FRACTIONP (y)) - return scm_i_exact_rational_round_divide (x, y, qp, rp); + scm_i_exact_rational_round_divide (x, y, qp, rp); else - return two_valued_wta_dispatch_2 (g_scm_round_divide, x, y, SCM_ARG2, - s_scm_round_divide, qp, rp); + two_valued_wta_dispatch_2 (g_scm_round_divide, x, y, SCM_ARG2, + s_scm_round_divide, qp, rp); } else if (SCM_BIGP (x)) { @@ -3955,43 +3926,42 @@ scm_round_divide (SCM x, SCM y, SCM *qp, SCM *rp) *qp = scm_i_normbig (q); *rp = SCM_I_MAKINUM (rr); } - return; } else if (SCM_BIGP (y)) - return scm_i_bigint_round_divide (x, y, qp, rp); + scm_i_bigint_round_divide (x, y, qp, rp); else if (SCM_REALP (y)) - return scm_i_inexact_round_divide - (scm_i_big2dbl (x), SCM_REAL_VALUE (y), qp, rp); + scm_i_inexact_round_divide (scm_i_big2dbl (x), SCM_REAL_VALUE (y), + qp, rp); else if (SCM_FRACTIONP (y)) - return scm_i_exact_rational_round_divide (x, y, qp, rp); + scm_i_exact_rational_round_divide (x, y, qp, rp); else - return two_valued_wta_dispatch_2 (g_scm_round_divide, x, y, SCM_ARG2, - s_scm_round_divide, qp, rp); + two_valued_wta_dispatch_2 (g_scm_round_divide, x, y, SCM_ARG2, + s_scm_round_divide, qp, rp); } else if (SCM_REALP (x)) { if (SCM_REALP (y) || SCM_I_INUMP (y) || SCM_BIGP (y) || SCM_FRACTIONP (y)) - return scm_i_inexact_round_divide - (SCM_REAL_VALUE (x), scm_to_double (y), qp, rp); + scm_i_inexact_round_divide (SCM_REAL_VALUE (x), scm_to_double (y), + qp, rp); else - return two_valued_wta_dispatch_2 (g_scm_round_divide, x, y, SCM_ARG2, - s_scm_round_divide, qp, rp); + two_valued_wta_dispatch_2 (g_scm_round_divide, x, y, SCM_ARG2, + s_scm_round_divide, qp, rp); } else if (SCM_FRACTIONP (x)) { if (SCM_REALP (y)) - return scm_i_inexact_round_divide + scm_i_inexact_round_divide (scm_i_fraction2double (x), SCM_REAL_VALUE (y), qp, rp); else if (SCM_I_INUMP (y) || SCM_BIGP (y) || SCM_FRACTIONP (y)) - return scm_i_exact_rational_round_divide (x, y, qp, rp); + scm_i_exact_rational_round_divide (x, y, qp, rp); else - return two_valued_wta_dispatch_2 (g_scm_round_divide, x, y, SCM_ARG2, - s_scm_round_divide, qp, rp); + two_valued_wta_dispatch_2 (g_scm_round_divide, x, y, SCM_ARG2, + s_scm_round_divide, qp, rp); } else - return two_valued_wta_dispatch_2 (g_scm_round_divide, x, y, SCM_ARG1, - s_scm_round_divide, qp, rp); + two_valued_wta_dispatch_2 (g_scm_round_divide, x, y, SCM_ARG1, + s_scm_round_divide, qp, rp); } static void From 05bea208b3c0cb26a1a1a800e82d8e29e73bfba4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 4 Mar 2015 09:43:46 +0100 Subject: [PATCH 05/46] tests: Make 'test-guild-compile' more reliable. Before that it would occasionally fail because the "$target" (not the intermediate temporary file) would be produced. * test-suite/standalone/test-guild-compile: Call 'pause' before 'sleep' in test program. --- test-suite/standalone/test-guild-compile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test-suite/standalone/test-guild-compile b/test-suite/standalone/test-guild-compile index 525ecc6e0..5972d5474 100755 --- a/test-suite/standalone/test-guild-compile +++ b/test-suite/standalone/test-guild-compile @@ -10,6 +10,11 @@ trap 'rm -f "$source" "$target"' EXIT cat > "$source"< Date: Wed, 4 Mar 2015 09:49:31 +0100 Subject: [PATCH 06/46] tests: Gracefully handle ENOSYS return for 'setaffinity'. Fixes . Reported by John Paul Adrian Glaubitz . * test-suite/tests/posix.test ("affinity")["setaffinity"]: Wrap in 'catch' and throw 'unresolved upon ENOSYS. --- test-suite/tests/posix.test | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/test-suite/tests/posix.test b/test-suite/tests/posix.test index 9a0e489b4..f57001a24 100644 --- a/test-suite/tests/posix.test +++ b/test-suite/tests/posix.test @@ -1,6 +1,7 @@ ;;;; posix.test --- Test suite for Guile POSIX functions. -*- scheme -*- ;;;; -;;;; Copyright 2003, 2004, 2006, 2007, 2010, 2012 Free Software Foundation, Inc. +;;;; Copyright 2003, 2004, 2006, 2007, 2010, 2012, +;;;; 2015 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 @@ -195,9 +196,18 @@ (pass-if "setaffinity" (if (and (defined? 'setaffinity) (defined? 'getaffinity)) - (let ((mask (getaffinity (getpid)))) - (setaffinity (getpid) mask) - (equal? mask (getaffinity (getpid)))) + (catch 'system-error + (lambda () + (let ((mask (getaffinity (getpid)))) + (setaffinity (getpid) mask) + (equal? mask (getaffinity (getpid))))) + (lambda args + ;; On some platforms such as sh4-linux-gnu, 'setaffinity' + ;; returns ENOSYS. + (let ((errno (system-error-errno args))) + (if (= errno ENOSYS) + (throw 'unresolved) + (apply throw args))))) (throw 'unresolved)))) ;; From 704c9118933329bc270b0e58d7b4bc02ca359454 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?= Date: Thu, 5 Mar 2015 22:44:17 +0100 Subject: [PATCH 07/46] Correct docstring of 'symlink'. * libguile/filesys.c (symlink): Correct the docstring, which had 'oldpath' and 'newpath' confused. --- libguile/filesys.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libguile/filesys.c b/libguile/filesys.c index 43d1be636..7674498a4 100644 --- a/libguile/filesys.c +++ b/libguile/filesys.c @@ -992,8 +992,8 @@ SCM_DEFINE (scm_fsync, "fsync", 1, 0, 0, #ifdef HAVE_SYMLINK SCM_DEFINE (scm_symlink, "symlink", 2, 0, 0, (SCM oldpath, SCM newpath), - "Create a symbolic link named @var{oldpath} with the value\n" - "(i.e., pointing to) @var{newpath}. The return value is\n" + "Create a symbolic link named @var{newpath} with the value\n" + "(i.e., pointing to) @var{oldpath}. The return value is\n" "unspecified.") #define FUNC_NAME s_scm_symlink { From d848067b896ff075eaac9d9814c5189e517775da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 10 Mar 2015 09:01:24 +0100 Subject: [PATCH 08/46] web: Export 'server-impl' procedures and the 'http' server implementation. * module/web/server.scm: Export the 'server-impl' procedures. * module/web/server/http.scm: Export 'http'. --- module/web/server.scm | 11 ++++++++++- module/web/server/http.scm | 5 +++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/module/web/server.scm b/module/web/server.scm index 471bb98de..80028fd7e 100644 --- a/module/web/server.scm +++ b/module/web/server.scm @@ -1,6 +1,6 @@ ;;; Web server -;; Copyright (C) 2010, 2011, 2012, 2013 Free Software Foundation, Inc. +;; Copyright (C) 2010, 2011, 2012, 2013, 2015 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 @@ -84,6 +84,15 @@ #:use-module (ice-9 iconv) #:export (define-server-impl lookup-server-impl + + make-server-impl + server-impl? + server-impl-name + server-impl-open + server-impl-read + server-impl-write + server-impl-close + open-server read-client handle-request diff --git a/module/web/server/http.scm b/module/web/server/http.scm index 2184ad8a2..05bf46bf0 100644 --- a/module/web/server/http.scm +++ b/module/web/server/http.scm @@ -1,6 +1,6 @@ ;;; Web I/O: HTTP -;; Copyright (C) 2010, 2011, 2012 Free Software Foundation, Inc. +;; Copyright (C) 2010, 2011, 2012, 2015 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 @@ -34,7 +34,8 @@ #:use-module (web request) #:use-module (web response) #:use-module (web server) - #:use-module (ice-9 poll)) + #:use-module (ice-9 poll) + #:export (http)) (define (make-default-socket family addr port) From 8dcf3c6163bba444cd459d9ffd22cc5f627fe6c8 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Thu, 26 Mar 2015 22:51:16 -0400 Subject: [PATCH 09/46] Work around requirement that size be non-zero in GDB 'open-memory'. * module/system/base/types.scm (memory-port): Handle zero size case specially. --- module/system/base/types.scm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/module/system/base/types.scm b/module/system/base/types.scm index ea2f3bcaf..73681715e 100644 --- a/module/system/base/types.scm +++ b/module/system/base/types.scm @@ -117,8 +117,12 @@ SIZE is omitted, return an unbounded port to the memory at ADDRESS." (let ((open (memory-backend-open backend))) (open address #f))) ((_ backend address size) - (let ((open (memory-backend-open backend))) - (open address size))))) + (if (zero? size) + ;; GDB's 'open-memory' raises an error when size + ;; is zero, so we must handle that case specially. + (open-bytevector-input-port '#vu8()) + (let ((open (memory-backend-open backend))) + (open address size)))))) (define (get-word port) "Read a word from PORT and return it as an integer." From 7b1069269b14b24a52cc5b315b215f8691978165 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Thu, 26 Mar 2015 23:13:47 -0400 Subject: [PATCH 10/46] Handle zero-length bytevectors correctly in (system base types). * module/system/base/types.scm (cell->object): Use 'get-bytevector-n' instead of 'get-bytevector-all', so that the zero-length case does not return EOF. --- module/system/base/types.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/system/base/types.scm b/module/system/base/types.scm index 73681715e..0e7371baa 100644 --- a/module/system/base/types.scm +++ b/module/system/base/types.scm @@ -444,7 +444,7 @@ using BACKEND." ('big "UTF-32BE"))))) (((_ & #x7f = %tc7-bytevector) len address) (let ((bv-port (memory-port backend address len))) - (get-bytevector-all bv-port))) + (get-bytevector-n bv-port len))) ((((len << 8) || %tc7-vector)) (let ((words (get-bytevector-n port (* len %word-size))) (vector (make-vector len))) From 82357f7bd875afce351a2965a15baabf864338e3 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sat, 28 Mar 2015 16:01:23 -0400 Subject: [PATCH 11/46] Add more R6RS port encoding tests Originally applied to stable-2.0 as "Fix bytevector and custom binary ports to actually use ISO-8859-1 encoding.", commit d574d96f879c147c6c14df43f2e4ff9e8a6876b9. Related to http://bugs.gnu.org/20200, which was introduced in in stable-2.0 but never existed on master. Test modified by Andy Wingo to add a `force-output' where needed. * test-suite/tests/r6rs-ports.test: Add tests. --- test-suite/tests/r6rs-ports.test | 47 ++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/test-suite/tests/r6rs-ports.test b/test-suite/tests/r6rs-ports.test index 1441daf1b..4941dd718 100644 --- a/test-suite/tests/r6rs-ports.test +++ b/test-suite/tests/r6rs-ports.test @@ -356,6 +356,11 @@ (with-fluids ((%default-port-encoding "UTF-8")) (binary-port? (open-bytevector-input-port #vu8(1 2 3))))) + (pass-if-equal "bytevector-input-port uses ISO-8859-1 (Guile extension)" + "©©" + (with-fluids ((%default-port-encoding "UTF-8")) + (get-string-all (open-bytevector-input-port #vu8(194 169 194 169))))) + (pass-if-exception "bytevector-input-port is read-only" exception:wrong-type-arg @@ -416,6 +421,23 @@ (input-port? port) (bytevector=? (get-bytevector-all port) source)))) + (pass-if-equal "make-custom-binary-input-port uses ISO-8859-1 (Guile extension)" + "©©" + (with-fluids ((%default-port-encoding "UTF-8")) + (let* ((source #vu8(194 169 194 169)) + (read! (let ((pos 0) + (len (bytevector-length source))) + (lambda (bv start count) + (let ((amount (min count (- len pos)))) + (if (> amount 0) + (bytevector-copy! source pos + bv start amount)) + (set! pos (+ pos amount)) + amount)))) + (port (make-custom-binary-input-port "the port" read! + #f #f #f))) + (get-string-all port)))) + (pass-if "custom binary input port does not support `port-position'" (let* ((str "Hello Port!") (source (open-bytevector-input-port @@ -716,6 +738,14 @@ not `set-port-position!'" (pass-if "bytevector-output-port is binary" (binary-port? (open-bytevector-output-port))) + (pass-if-equal "bytevector-output-port uses ISO-8859-1 (Guile extension)" + #vu8(194 169 194 169) + (with-fluids ((%default-port-encoding "UTF-8")) + (let-values (((port get-content) + (open-bytevector-output-port))) + (put-string port "©©") + (get-content)))) + (pass-if "open-bytevector-output-port [extract after close]" (let-values (((port get-content) (open-bytevector-output-port))) @@ -819,6 +849,23 @@ not `set-port-position!'" (not eof?) (bytevector=? sink source)))) + (pass-if-equal "custom-binary-output-port uses ISO-8859-1 (Guile extension)" + '(194 169 194 169) + (with-fluids ((%default-port-encoding "UTF-8")) + (let* ((sink '()) + (write! (lambda (bv start count) + (if (= 0 count) ; EOF + 0 + (let ((u8 (bytevector-u8-ref bv start))) + ;; Get one byte at a time. + (set! sink (cons u8 sink)) + 1)))) + (port (make-custom-binary-output-port "cbop" write! + #f #f #f))) + (put-string port "©©") + (force-output port) + (reverse sink)))) + (pass-if "standard-output-port is binary" (with-fluids ((%default-port-encoding "UTF-8")) (binary-port? (standard-output-port)))) From 93c3b060c16242f069d74123b9629d6df2bc2c73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 3 Apr 2015 16:35:54 +0200 Subject: [PATCH 12/46] doc: Update libgc URL. * doc/ref/data-rep.texi (Conservative GC): Update libgc URL. --- doc/ref/data-rep.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/ref/data-rep.texi b/doc/ref/data-rep.texi index d0a76e9be..bb7f74afe 100644 --- a/doc/ref/data-rep.texi +++ b/doc/ref/data-rep.texi @@ -1,6 +1,6 @@ @c -*-texinfo-*- @c This is part of the GNU Guile Reference Manual. -@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2010 +@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2010, 2015 @c Free Software Foundation, Inc. @c See the file guile.texi for copying conditions. @@ -339,7 +339,7 @@ actually garbage, and should be freed. In practice, this is not a problem. The alternative, an explicitly maintained list of local variable addresses, is effectively much less reliable, due to programmer error. Interested readers should see the BDW-GC web page at -@uref{http://www.hpl.hp.com/personal/Hans_Boehm/gc}, for more +@uref{http://www.hboehm.info/gc/}, for more information. From e7cde8be9e3ddb66a09b8c914e5d58fa8e37d5ad Mon Sep 17 00:00:00 2001 From: Alex Kost Date: Fri, 12 Jun 2015 19:30:17 +0300 Subject: [PATCH 13/46] Fix typo in manual. * doc/ref/api-modules.texi (Using Guile Modules): Remove extra "yet". --- doc/ref/api-modules.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/ref/api-modules.texi b/doc/ref/api-modules.texi index 4c46f2984..8f18b1e62 100644 --- a/doc/ref/api-modules.texi +++ b/doc/ref/api-modules.texi @@ -171,8 +171,8 @@ of @code{@@} and should only be used as a last resort or for debugging, for example. Note that just as with a @code{use-modules} statement, any module that -has not yet been loaded yet will be loaded when referenced by a -@code{@@} or @code{@@@@} form. +has not yet been loaded will be loaded when referenced by a @code{@@} or +@code{@@@@} form. You can also use the @code{@@} and @code{@@@@} syntaxes as the target of a @code{set!} when the binding refers to a variable. From 96b299045fff0304b7ffc5304b85129cdd78f322 Mon Sep 17 00:00:00 2001 From: Alex Kost Date: Sun, 14 Jun 2015 19:09:34 +0300 Subject: [PATCH 14/46] Fix typo in the man page. * doc/guile.1: "--no-autocompile" -> "--no-auto-compile". --- doc/guile.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/guile.1 b/doc/guile.1 index 5d8b4e158..7b3d23292 100644 --- a/doc/guile.1 +++ b/doc/guile.1 @@ -125,7 +125,7 @@ is being run interactively. Compile source files automatically (default behavior). . .TP -.B --no-autocompile +.B --no-auto-compile Disable automatic source file compilation. . .TP From 7413430fd742bbe867f5f1358e729514b5a08973 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Mon, 15 Jun 2015 10:05:41 +0200 Subject: [PATCH 15/46] i18n: Check for non-POSIX strtol_l. * configure.ac: Check for strtol_l. * libguile/i18n.c: Check HAVE_STRTOL_L before using strtol_l. --- configure.ac | 5 +++-- libguile/i18n.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 0eb2368ec..3a8f77291 100644 --- a/configure.ac +++ b/configure.ac @@ -752,6 +752,7 @@ AC_CHECK_HEADERS([assert.h crt_externs.h]) # isblank - available as a GNU extension or in C99 # _NSGetEnviron - Darwin specific # strcoll_l, newlocale, uselocale, utimensat - POSIX.1-2008 +# strtol_l - non-POSIX, found in glibc # fork - unavailable on Windows # sched_getaffinity, sched_setaffinity - GNU extensions (glibc) # sendfile - non-POSIX, found in glibc @@ -765,8 +766,8 @@ AC_CHECK_FUNCS([DINFINITY DQNAN cexp chsize clog clog10 ctermid \ strdup system usleep atexit on_exit chown link fcntl ttyname getpwent \ getgrent kill getppid getpgrp fork setitimer getitimer strchr strcmp \ index bcopy memcpy rindex truncate unsetenv isblank _NSGetEnviron \ - strcoll strcoll_l newlocale uselocale utimensat sched_getaffinity \ - sched_setaffinity sendfile]) + strcoll strcoll_l strtol_l newlocale uselocale utimensat \ + sched_getaffinity sched_setaffinity sendfile]) # Reasons for testing: # netdb.h - not in mingw diff --git a/libguile/i18n.c b/libguile/i18n.c index f0e344329..17e9eca61 100644 --- a/libguile/i18n.c +++ b/libguile/i18n.c @@ -1373,7 +1373,7 @@ SCM_DEFINE (scm_locale_string_to_integer, "locale-string->integer", if (c_locale != NULL) { -#ifdef USE_GNU_LOCALE_API +#if defined(USE_GNU_LOCALE_API) && defined(HAVE_STRTOL_L) c_result = strtol_l (c_str, &c_endptr, c_base, c_locale); #else RUN_IN_LOCALE_SECTION (c_locale, From ea8fa622ecc6e05520c21616b52949049d94f8a0 Mon Sep 17 00:00:00 2001 From: Mathieu Lirzin Date: Fri, 15 May 2015 13:27:54 +0200 Subject: [PATCH 16/46] doc: Fix parameter of 'set-record-type-printer!'. * doc/ref/api-compound.texi (SRFI-9 Records)[set-record-type-printer!]: Fix parameter name. --- doc/ref/api-compound.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ref/api-compound.texi b/doc/ref/api-compound.texi index 8ec32d687..b4ae79c26 100644 --- a/doc/ref/api-compound.texi +++ b/doc/ref/api-compound.texi @@ -2322,7 +2322,7 @@ You may use @code{set-record-type-printer!} to customize the default printing behavior of records. This is a Guile extension and is not part of SRFI-9. It is located in the @nicode{(srfi srfi-9 gnu)} module. -@deffn {Scheme Syntax} set-record-type-printer! name proc +@deffn {Scheme Syntax} set-record-type-printer! type proc Where @var{type} corresponds to the first argument of @code{define-record-type}, and @var{proc} is a procedure accepting two arguments, the record to print, and an output port. From aa13da51892de89d3acdb84dce11699597a9fe05 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Wed, 22 Jul 2015 20:56:18 -0400 Subject: [PATCH 17/46] Fix atan procedure when applied to complex numbers. Fixes a regression introduced in commit ad79736c68a803a59814fbfc0cb4b092c2b4cddf. * libguile/numbers.c (scm_atan): Fix the complex case. * test-suite/tests/numbers.test ("atan"): Add test. --- libguile/numbers.c | 4 ++-- test-suite/tests/numbers.test | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/libguile/numbers.c b/libguile/numbers.c index 9cc72d269..d0f6e628d 100644 --- a/libguile/numbers.c +++ b/libguile/numbers.c @@ -8993,8 +8993,8 @@ SCM_PRIMITIVE_GENERIC (scm_atan, "atan", 1, 1, 0, double v, w; v = SCM_COMPLEX_REAL (z); w = SCM_COMPLEX_IMAG (z); - return scm_divide (scm_log (scm_divide (scm_c_make_rectangular (v, w - 1.0), - scm_c_make_rectangular (v, w + 1.0))), + return scm_divide (scm_log (scm_divide (scm_c_make_rectangular (-v, 1.0 - w), + scm_c_make_rectangular ( v, 1.0 + w))), scm_c_make_rectangular (0, 2)); } else diff --git a/test-suite/tests/numbers.test b/test-suite/tests/numbers.test index 847f93962..0adf21637 100644 --- a/test-suite/tests/numbers.test +++ b/test-suite/tests/numbers.test @@ -1,6 +1,6 @@ ;;;; numbers.test --- tests guile's numbers -*- scheme -*- -;;;; Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006, 2009, 2010, 2011, -;;;; 2012, 2013 Free Software Foundation, Inc. +;;;; Copyright (C) 2000, 2001, 2003-2006, 2009-2013, +;;;; 2015 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 @@ -4467,7 +4467,8 @@ (pass-if (eqv? 0 (atan 0))) (pass-if (eqv? 0.0 (atan 0.0))) (pass-if (eqv-loosely? 1.57 (atan +inf.0))) - (pass-if (eqv-loosely? -1.57 (atan -inf.0)))) + (pass-if (eqv-loosely? -1.57 (atan -inf.0))) + (pass-if (eqv-loosely? -1.42+0.5i (atan -0.5+2.0i)))) ;;; ;;; sinh From d77247b90b836e149b58e9efccdd9861a28a7576 Mon Sep 17 00:00:00 2001 From: Andreas Rottmann Date: Tue, 28 Jul 2015 23:06:36 +0200 Subject: [PATCH 18/46] Heed the reader settings implied by #!r6rs When encountering the #!r6rs directive, apply the appropriate reader settings to the port. * libguile/read.scm (read-string-as-list): New helper procedure. (scm_read_shebang): Set reader options implied by the R6RS syntax upon encountering the #!r6rs directive. * test-suite/tests/reader.test (per-port-read-options): Add tests for the #!r6rs directive. --- NEWS | 20 ++++++++++++++++ libguile/read.c | 40 ++++++++++++++++++++++++++++++-- test-suite/tests/reader.test | 45 +++++++++++++++++++++++++++++++----- 3 files changed, 97 insertions(+), 8 deletions(-) diff --git a/NEWS b/NEWS index e887ec447..8d2ec86fb 100644 --- a/NEWS +++ b/NEWS @@ -738,6 +738,26 @@ longer installed to the libdir. This change should be transparent to users, but packagers may be interested. + +Changes in 2.0.12 (since 2.0.11): + +[Note: these changes come to 2.2 via 2.0 branch, but 2.0.12 hasn't been +released yet at the time of this writing.] + +* Notable changes + +** The #!r6rs directive now influences read syntax + +The #!r6rs directive now changes the per-port reader options to make +Guile's reader conform more closely to the R6RS syntax. In particular: + +- It makes the reader case sensitive. +- It disables the recognition of keyword syntax in conflict with the + R6RS (and R5RS). +- It enables the `square-brackets', `hungry-eol-escapes' and + `r6rs-hex-escapes' reader options. + + Changes in 2.0.11 (since 2.0.10): diff --git a/libguile/read.c b/libguile/read.c index afad5975a..c724fbbc8 100644 --- a/libguile/read.c +++ b/libguile/read.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995-1997, 1999-2001, 2003, 2004, 2006-2012, 2014 +/* Copyright (C) 1995-1997, 1999-2001, 2003, 2004, 2006-2012, 2014, 2015 * Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or @@ -1430,6 +1430,12 @@ static void set_port_square_brackets_p (SCM port, scm_t_read_opts *opts, int value); static void set_port_curly_infix_p (SCM port, scm_t_read_opts *opts, int value); +static void set_port_r6rs_hex_escapes_p (SCM port, scm_t_read_opts *opts, + int value); +static void set_port_hungry_eol_escapes_p (SCM port, scm_t_read_opts *opts, + int value); +static void set_port_keyword_style (SCM port, scm_t_read_opts *opts, + enum t_keyword_style value); static SCM scm_read_shebang (scm_t_wchar chr, SCM port, scm_t_read_opts *opts) @@ -1451,7 +1457,13 @@ scm_read_shebang (scm_t_wchar chr, SCM port, scm_t_read_opts *opts) scm_ungetc (c, port); name[i] = '\0'; if (0 == strcmp ("r6rs", name)) - ; /* Silently ignore */ + { + set_port_case_insensitive_p (port, opts, 0); + set_port_r6rs_hex_escapes_p (port, opts, 1); + set_port_square_brackets_p (port, opts, 1); + set_port_keyword_style (port, opts, KEYWORD_STYLE_HASH_PREFIX); + set_port_hungry_eol_escapes_p (port, opts, 1); + } else if (0 == strcmp ("fold-case", name)) set_port_case_insensitive_p (port, opts, 1); else if (0 == strcmp ("no-fold-case", name)) @@ -2299,6 +2311,30 @@ set_port_curly_infix_p (SCM port, scm_t_read_opts *opts, int value) set_port_read_option (port, READ_OPTION_CURLY_INFIX_P, value); } +/* Set OPTS and PORT's r6rs_hex_escapes_p option according to VALUE. */ +static void +set_port_r6rs_hex_escapes_p (SCM port, scm_t_read_opts *opts, int value) +{ + value = !!value; + opts->r6rs_escapes_p = value; + set_port_read_option (port, READ_OPTION_R6RS_ESCAPES_P, value); +} + +static void +set_port_hungry_eol_escapes_p (SCM port, scm_t_read_opts *opts, int value) +{ + value = !!value; + opts->hungry_eol_escapes_p = value; + set_port_read_option (port, READ_OPTION_HUNGRY_EOL_ESCAPES_P, value); +} + +static void +set_port_keyword_style (SCM port, scm_t_read_opts *opts, enum t_keyword_style value) +{ + opts->keyword_style = value; + set_port_read_option (port, READ_OPTION_KEYWORD_STYLE, value); +} + /* Initialize OPTS based on PORT's read options and the global read options. */ static void diff --git a/test-suite/tests/reader.test b/test-suite/tests/reader.test index 5eb368d9b..a931f0416 100644 --- a/test-suite/tests/reader.test +++ b/test-suite/tests/reader.test @@ -60,6 +60,11 @@ (lambda () (read-options saved-options))))) +(define (read-string-as-list s) + (with-input-from-string s + (lambda () + (unfold eof-object? values (lambda (x) (read)) (read))))) + (with-test-prefix "reading" (pass-if "0" @@ -432,14 +437,42 @@ (equal? '(guile GuiLe gUIle) (with-read-options '(case-insensitive) (lambda () - (with-input-from-string "GUIle #!no-fold-case GuiLe gUIle" - (lambda () - (list (read) (read) (read)))))))) + (read-string-as-list "GUIle #!no-fold-case GuiLe gUIle"))))) (pass-if "case-insensitive" (equal? '(GUIle guile guile) - (with-input-from-string "GUIle #!fold-case GuiLe gUIle" - (lambda () - (list (read) (read) (read))))))) + (read-string-as-list "GUIle #!fold-case GuiLe gUIle"))) + (with-test-prefix "r6rs" + (pass-if-equal "case sensitive" + '(guile GuiLe gUIle) + (with-read-options '(case-insensitive) + (lambda () + (read-string-as-list "GUIle #!r6rs GuiLe gUIle")))) + (pass-if-equal "square brackets" + '((a b c) (foo 42 bar) (x . y)) + (read-string-as-list "(a b c) #!r6rs [foo 42 bar] [x . y]")) + (pass-if-equal "hex string escapes" + '("native\x7fsyntax" + "\0" + "ascii\x7fcontrol" + "U\u0100BMP" + "U\U010402SMP") + (read-string-as-list (string-append "\"native\\x7fsyntax\" " + "#!r6rs " + "\"\\x0;\" " + "\"ascii\\x7f;control\" " + "\"U\\x100;BMP\" " + "\"U\\x10402;SMP\""))) + (with-test-prefix "keyword style" + (pass-if-equal "postfix disabled" + '(#:regular #:postfix postfix: #:regular2) + (with-read-options '(keywords postfix) + (lambda () + (read-string-as-list "#:regular postfix: #!r6rs postfix: #:regular2")))) + (pass-if-equal "prefix disabled" + '(#:regular #:prefix :prefix #:regular2) + (with-read-options '(keywords prefix) + (lambda () + (read-string-as-list "#:regular :prefix #!r6rs :prefix #:regular2"))))))) (with-test-prefix "#;" (for-each From 3cf70e36f11b211fc2fa88bf4ecc59a6f8812bc3 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Wed, 2 Sep 2015 13:51:05 -0400 Subject: [PATCH 19/46] Fix uses of 'scm_gc_protect', which does not exist, in the manual. * doc/ref/api-memory.texi (Garbage Collection Functions), doc/ref/libguile-concepts.texi (Garbage Collection): Change 'scm_gc_protect' --> 'scm_gc_protect_object'. --- doc/ref/api-memory.texi | 4 ++-- doc/ref/libguile-concepts.texi | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/ref/api-memory.texi b/doc/ref/api-memory.texi index 0e37d16fc..a2a27e43b 100644 --- a/doc/ref/api-memory.texi +++ b/doc/ref/api-memory.texi @@ -1,6 +1,6 @@ @c -*-texinfo-*- @c This is part of the GNU Guile Reference Manual. -@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2009, 2010, 2012, 2013, 2014 +@c Copyright (C) 1996, 1997, 2000-2004, 2009, 2010, 2012-2016 @c Free Software Foundation, Inc. @c See the file guile.texi for copying conditions. @@ -36,7 +36,7 @@ explicitly. It is called automatically when appropriate. Protects @var{obj} from being freed by the garbage collector, when it otherwise might be. When you are done with the object, call @code{scm_gc_unprotect_object} on the object. Calls to -@code{scm_gc_protect}/@code{scm_gc_unprotect_object} can be nested, and +@code{scm_gc_protect_object}/@code{scm_gc_unprotect_object} can be nested, and the object remains protected until it has been unprotected as many times as it was protected. It is an error to unprotect an object more times than it has been protected. Returns the SCM object it was passed. diff --git a/doc/ref/libguile-concepts.texi b/doc/ref/libguile-concepts.texi index 9e2eb7503..9785f4d6f 100644 --- a/doc/ref/libguile-concepts.texi +++ b/doc/ref/libguile-concepts.texi @@ -1,7 +1,7 @@ @c -*-texinfo-*- @c This is part of the GNU Guile Reference Manual. -@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005, 2010, -@c 2011, 2013, 2014 Free Software Foundation, Inc. +@c Copyright (C) 1996-1997, 2000-2005, 2010-2011, 2013-2016 +@c Free Software Foundation, Inc. @c See the file guile.texi for copying conditions. @node General Libguile Concepts @@ -197,7 +197,7 @@ sections, function arguments or local variables on the C and Scheme stacks, and values in machine registers. Other references to @code{SCM} objects, such as those in other random data structures in the C heap that contain fields of type @code{SCM}, can be made visible to the -garbage collector by calling the functions @code{scm_gc_protect} or +garbage collector by calling the functions @code{scm_gc_protect_object} or @code{scm_permanent_object}. Collectively, these values form the ``root set'' of garbage collection; any value on the heap that is referenced directly or indirectly by a member of the root set is preserved, and all From a04c849b096f01f2a73d3a9e7b395ca4c7f8df41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?= Date: Sun, 30 Aug 2015 10:24:52 +0200 Subject: [PATCH 20/46] Clarify datum->syntax documentation. * doc/ref/api-macros.texi (Syntax Case): Make it clear that the first argument to datum->syntax must be an identifier. --- doc/ref/api-macros.texi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/ref/api-macros.texi b/doc/ref/api-macros.texi index 9964e6b06..ef0621415 100644 --- a/doc/ref/api-macros.texi +++ b/doc/ref/api-macros.texi @@ -1,7 +1,7 @@ @c -*-texinfo-*- @c This is part of the GNU Guile Reference Manual. -@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2009, 2010, 2011, -@c 2012, 2013, 2014 Free Software Foundation, Inc. +@c Copyright (C) 1996, 1997, 2000-2004, 2009-2015 +@c Free Software Foundation, Inc. @c See the file guile.texi for copying conditions. @node Macros @@ -618,9 +618,9 @@ won't have access to the binding of @code{it}. But they can, if we explicitly introduce a binding via @code{datum->syntax}. -@deffn {Scheme Procedure} datum->syntax for-syntax datum +@deffn {Scheme Procedure} datum->syntax template-id datum Create a syntax object that wraps @var{datum}, within the lexical context -corresponding to the syntax object @var{for-syntax}. +corresponding to the identifier @var{template-id}. @end deffn For completeness, we should mention that it is possible to strip the metadata From bb7075dc1a9084305160b690ad918cf98401e1dd Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Thu, 3 Sep 2015 02:51:00 -0400 Subject: [PATCH 21/46] psyntax: Fix bug in match-each+. Reported by Panicz Maciej Godek in . * module/ice-9/psyntax.scm (match-each+): Fix the case where a non-pair syntax object is encountered in a dotted tail. * module/ice-9/psyntax-pp.scm: Regenerate. --- module/ice-9/psyntax-pp.scm | 3 ++- module/ice-9/psyntax.scm | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/module/ice-9/psyntax-pp.scm b/module/ice-9/psyntax-pp.scm index 0d30b7c3f..3cd6035f7 100644 --- a/module/ice-9/psyntax-pp.scm +++ b/module/ice-9/psyntax-pp.scm @@ -2509,7 +2509,8 @@ (values '() (cdr y-pat) (match (car e) (car y-pat) w r mod))) (values #f #f #f))))) ((syntax-object? e) - (f (syntax-object-expression e) (join-wraps w e))) + (f (syntax-object-expression e) + (join-wraps w (syntax-object-wrap e)))) (else (values '() y-pat (match e z-pat w r mod))))))) (match-each-any (lambda (e w mod) diff --git a/module/ice-9/psyntax.scm b/module/ice-9/psyntax.scm index 0bc602431..a45353aa3 100644 --- a/module/ice-9/psyntax.scm +++ b/module/ice-9/psyntax.scm @@ -2849,7 +2849,8 @@ (match (car e) (car y-pat) w r mod))) (values #f #f #f))))) ((syntax-object? e) - (f (syntax-object-expression e) (join-wraps w e))) + (f (syntax-object-expression e) + (join-wraps w (syntax-object-wrap e)))) (else (values '() y-pat (match e z-pat w r mod))))))) From b6c1018d9696b8b9e0117932a15d9bd07c8a8351 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sun, 30 Aug 2015 10:58:42 +0200 Subject: [PATCH 22/46] doc: Add SXPath documentation from sources MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes . * doc/ref/sxml.texi (SXPath): Add procedure documentation from sources. Signed-off-by: Ludovic Courtès --- doc/ref/sxml.texi | 302 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 267 insertions(+), 35 deletions(-) diff --git a/doc/ref/sxml.texi b/doc/ref/sxml.texi index 75867f3a6..03f0324f6 100644 --- a/doc/ref/sxml.texi +++ b/doc/ref/sxml.texi @@ -3,6 +3,10 @@ @c Copyright (C) 2013 Free Software Foundation, Inc. @c See the file guile.texi for copying conditions. +@c SXPath documentation based on SXPath.scm by Oleg Kiselyov, +@c which is in the public domain according to +@c and . + @node SXML @section SXML @@ -250,8 +254,8 @@ internal and external parsed entities, user-controlled handling of whitespace, and validation. This module therefore is intended to be a framework, a set of ``Lego blocks'' you can use to build a parser following any discipline and performing validation to any degree. As an -example of the parser construction, this file includes a semi-validating -SXML parser. +example of the parser construction, the source file includes a +semi-validating SXML parser. SSAX has a ``sequential'' feel of SAX yet a ``functional style'' of DOM. Like a SAX parser, the framework scans the document only once and @@ -725,95 +729,323 @@ location path is a relative path applied to the root node. Similarly to XPath, SXPath defines full and abbreviated notations for location paths. In both cases, the abbreviated notation can be mechanically expanded into the full form by simple rewriting rules. In -case of SXPath the corresponding rules are given as comments to a sxpath -function, below. The regression test suite at the end of this file shows -a representative sample of SXPaths in both notations, juxtaposed with -the corresponding XPath expressions. Most of the samples are borrowed -literally from the XPath specification, while the others are adjusted -for our running example, tree1. +the case of SXPath the corresponding rules are given in the +documentation of the @code{sxpath} procedure. +@xref{sxpath-procedure-docs,,SXPath procedure documentation}. + +The regression test suite at the end of the file @file{SXPATH-old.scm} +shows a representative sample of SXPaths in both notations, juxtaposed +with the corresponding XPath expressions. Most of the samples are +borrowed literally from the XPath specification. + +Much of the following material is taken from the SXPath sources by Oleg +Kiselyov et al. + +@subsubsection Basic Converters and Applicators + +A converter is a function mapping a nodeset (or a single node) to another +nodeset. Its type can be represented like this: + +@example +type Converter = Node|Nodeset -> Nodeset +@end example + +A converter can also play the role of a predicate: in that case, if a +converter, applied to a node or a nodeset, yields a non-empty nodeset, +the converter-predicate is deemed satisfied. Likewise, an empty nodeset +is equivalent to @code{#f} in denoting failure. -@subsubsection Usage @deffn {Scheme Procedure} nodeset? x +Return @code{#t} if @var{x} is a nodeset. @end deffn @deffn {Scheme Procedure} node-typeof? crit +This function implements a 'Node test' as defined in Sec. 2.3 of the +XPath document. A node test is one of the components of a location +step. It is also a converter-predicate in SXPath. + +The function @code{node-typeof?} takes a type criterion and returns a +function, which, when applied to a node, will tell if the node satisfies +the test. + +The criterion @var{crit} is a symbol, one of the following: + +@table @code +@item id +tests if the node has the right name (id) + +@item @@ +tests if the node is an + +@item * +tests if the node is an + +@item *text* +tests if the node is a text node + +@item *PI* +tests if the node is a PI (processing instruction) node + +@item *any* +@code{#t} for any type of node +@end table @end deffn @deffn {Scheme Procedure} node-eq? other +A curried equivalence converter predicate that takes a node @var{other} +and returns a function that takes another node. The two nodes are +compared using @code{eq?}. @end deffn @deffn {Scheme Procedure} node-equal? other +A curried equivalence converter predicate that takes a node @var{other} +and returns a function that takes another node. The two nodes are +compared using @code{equal?}. @end deffn @deffn {Scheme Procedure} node-pos n +Select the @var{n}'th element of a nodeset and return as a singular +nodeset. If the @var{n}'th element does not exist, return an empty +nodeset. If @var{n} is a negative number the node is picked from the +tail of the list. + +@example +((node-pos 1) nodeset) ; return the the head of the nodeset (if exists) +((node-pos 2) nodeset) ; return the node after that (if exists) +((node-pos -1) nodeset) ; selects the last node of a non-empty nodeset +((node-pos -2) nodeset) ; selects the last but one node, if exists. +@end example @end deffn @deffn {Scheme Procedure} filter pred? -@verbatim - -- Scheme Procedure: filter pred list - Return all the elements of 2nd arg LIST that satisfy predicate - PRED. The list is not disordered - elements that appear in the - result list occur in the same order as they occur in the argument - list. The returned list may share a common tail with the argument - list. The dynamic order in which the various applications of pred - are made is not specified. - - (filter even? '(0 7 8 8 43 -4)) => (0 8 8 -4) - - -@end verbatim +A filter applicator, which introduces a filtering context. The argument +converter @var{pred?} is considered a predicate, with either @code{#f} +or @code{nil} meaning failure. @end deffn @deffn {Scheme Procedure} take-until pred? +@example +take-until:: Converter -> Converter, or +take-until:: Pred -> Node|Nodeset -> Nodeset +@end example + +Given a converter-predicate @var{pred?} and a nodeset, apply the +predicate to each element of the nodeset, until the predicate yields +anything but @code{#f} or @code{nil}. Return the elements of the input +nodeset that have been processed until that moment (that is, which fail +the predicate). + +@code{take-until} is a variation of the @code{filter} above: +@code{take-until} passes elements of an ordered input set up to (but not +including) the first element that satisfies the predicate. The nodeset +returned by @code{((take-until (not pred)) nset)} is a subset -- to be +more precise, a prefix -- of the nodeset returned by @code{((filter +pred) nset)}. @end deffn @deffn {Scheme Procedure} take-after pred? +@example +take-after:: Converter -> Converter, or +take-after:: Pred -> Node|Nodeset -> Nodeset +@end example + +Given a converter-predicate @var{pred?} and a nodeset, apply the +predicate to each element of the nodeset, until the predicate yields +anything but @code{#f} or @code{nil}. Return the elements of the input +nodeset that have not been processed: that is, return the elements of +the input nodeset that follow the first element that satisfied the +predicate. + +@code{take-after} along with @code{take-until} partition an input +nodeset into three parts: the first element that satisfies a predicate, +all preceding elements and all following elements. @end deffn @deffn {Scheme Procedure} map-union proc lst +Apply @var{proc} to each element of @var{lst} and return the list of results. +If @var{proc} returns a nodeset, splice it into the result + +From another point of view, @code{map-union} is a function +@code{Converter->Converter}, which places an argument-converter in a joining +context. @end deffn @deffn {Scheme Procedure} node-reverse node-or-nodeset +@example +node-reverse :: Converter, or +node-reverse:: Node|Nodeset -> Nodeset +@end example + +Reverses the order of nodes in the nodeset. This basic converter is +needed to implement a reverse document order (see the XPath +Recommendation). @end deffn @deffn {Scheme Procedure} node-trace title +@example +node-trace:: String -> Converter +@end example + +@code{(node-trace title)} is an identity converter. In addition it +prints out the node or nodeset it is applied to, prefixed with the +@var{title}. This converter is very useful for debugging. @end deffn +@subsubsection Converter Combinators + +Combinators are higher-order functions that transmogrify a converter or +glue a sequence of converters into a single, non-trivial converter. The +goal is to arrive at converters that correspond to XPath location paths. + +From a different point of view, a combinator is a fixed, named +@dfn{pattern} of applying converters. Given below is a complete set of +such patterns that together implement XPath location path specification. +As it turns out, all these combinators can be built from a small number +of basic blocks: regular functional composition, @code{map-union} and +@code{filter} applicators, and the nodeset union. + @deffn {Scheme Procedure} select-kids test-pred? +@code{select-kids} takes a converter (or a predicate) as an argument and +returns another converter. The resulting converter applied to a nodeset +returns an ordered subset of its children that satisfy the predicate +@var{test-pred?}. @end deffn @deffn {Scheme Procedure} node-self pred? -@verbatim - -- Scheme Procedure: filter pred list - Return all the elements of 2nd arg LIST that satisfy predicate - PRED. The list is not disordered - elements that appear in the - result list occur in the same order as they occur in the argument - list. The returned list may share a common tail with the argument - list. The dynamic order in which the various applications of pred - are made is not specified. - - (filter even? '(0 7 8 8 43 -4)) => (0 8 8 -4) - - -@end verbatim +Similar to @code{select-kids} except that the predicate @var{pred?} is +applied to the node itself rather than to its children. The resulting +nodeset will contain either one component, or will be empty if the node +failed the predicate. @end deffn @deffn {Scheme Procedure} node-join . selectors +@example +node-join:: [LocPath] -> Node|Nodeset -> Nodeset, or +node-join:: [Converter] -> Converter +@end example + +Join the sequence of location steps or paths as described above. @end deffn @deffn {Scheme Procedure} node-reduce . converters +@example +node-reduce:: [LocPath] -> Node|Nodeset -> Nodeset, or +node-reduce:: [Converter] -> Converter +@end example + +A regular functional composition of converters. From a different point +of view, @code{((apply node-reduce converters) nodeset)} is equivalent +to @code{(foldl apply nodeset converters)}, i.e., folding, or reducing, +a list of converters with the nodeset as a seed. @end deffn @deffn {Scheme Procedure} node-or . converters +@example +node-or:: [Converter] -> Converter +@end example + +This combinator applies all converters to a given node and produces the +union of their results. This combinator corresponds to a union +(@code{|} operation) for XPath location paths. @end deffn @deffn {Scheme Procedure} node-closure test-pred? +@example +node-closure:: Converter -> Converter +@end example + +Select all @emph{descendants} of a node that satisfy a +converter-predicate @var{test-pred?}. This combinator is similar to +@code{select-kids} but applies to grand... children as well. This +combinator implements the @code{descendant::} XPath axis. Conceptually, +this combinator can be expressed as + +@example +(define (node-closure f) + (node-or + (select-kids f) + (node-reduce (select-kids (node-typeof? '*)) (node-closure f)))) +@end example + +This definition, as written, looks somewhat like a fixpoint, and it will +run forever. It is obvious however that sooner or later +@code{(select-kids (node-typeof? '*))} will return an empty nodeset. At +this point further iterations will no longer affect the result and can +be stopped. @end deffn @deffn {Scheme Procedure} node-parent rootnode +@example +node-parent:: RootNode -> Converter +@end example + +@code{(node-parent rootnode)} yields a converter that returns a parent +of a node it is applied to. If applied to a nodeset, it returns the +list of parents of nodes in the nodeset. The @var{rootnode} does not +have to be the root node of the whole SXML tree -- it may be a root node +of a branch of interest. + +Given the notation of Philip Wadler's paper on semantics of XSLT, + +@verbatim + parent(x) = { y | y=subnode*(root), x=subnode(y) } +@end verbatim + +Therefore, @code{node-parent} is not the fundamental converter: it can +be expressed through the existing ones. Yet @code{node-parent} is a +rather convenient converter. It corresponds to a @code{parent::} axis +of SXPath. Note that the @code{parent::} axis can be used with an +attribute node as well. @end deffn +@anchor{sxpath-procedure-docs} @deffn {Scheme Procedure} sxpath path +Evaluate an abbreviated SXPath. + +@example +sxpath:: AbbrPath -> Converter, or +sxpath:: AbbrPath -> Node|Nodeset -> Nodeset +@end example + +@var{path} is a list. It is translated to the full SXPath according to +the following rewriting rules: + +@example +(sxpath '()) +@result{} (node-join) + +(sxpath '(path-component ...)) +@result{} (node-join (sxpath1 path-component) (sxpath '(...))) + +(sxpath1 '//) +@result{} (node-or + (node-self (node-typeof? '*any*)) + (node-closure (node-typeof? '*any*))) + +(sxpath1 '(equal? x)) +@result{} (select-kids (node-equal? x)) + +(sxpath1 '(eq? x)) +@result{} (select-kids (node-eq? x)) + +(sxpath1 ?symbol) +@result{} (select-kids (node-typeof? ?symbol) + +(sxpath1 procedure) +@result{} procedure + +(sxpath1 '(?symbol ...)) +@result{} (sxpath1 '((?symbol) ...)) + +(sxpath1 '(path reducer ...)) +@result{} (node-reduce (sxpath path) (sxpathr reducer) ...) + +(sxpathr number) +@result{} (node-pos number) + +(sxpathr path-filter) +@result{} (filter (sxpath path-filter)) +@end example @end deffn @node sxml ssax input-parse From e8d3733521a86da201528d4a34d6fd894b090d51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 4 Sep 2015 22:44:06 +0200 Subject: [PATCH 23/46] doc: Fix menu order for SXML. * doc/ref/sxml.texi (SXML): Add missing quotes in example. Fix node order in menu. --- doc/ref/sxml.texi | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/ref/sxml.texi b/doc/ref/sxml.texi index 03f0324f6..17c3d01b7 100644 --- a/doc/ref/sxml.texi +++ b/doc/ref/sxml.texi @@ -21,7 +21,7 @@ fragment: may be represented with the following SXML: @example -(parrot (@@ (type "African Grey)) (name "Alfie")) +(parrot (@@ (type "African Grey")) (name "Alfie")) @end example SXML is very general, and is capable of representing all of XML. @@ -32,14 +32,14 @@ Guile includes several facilities for working with XML and SXML: parsers, serializers, and transformers. @menu -* SXML Overview:: XML, as it was meant to be -* Reading and Writing XML:: Convenient XML parsing and serializing -* SSAX:: Custom functional-style XML parsers -* Transforming SXML:: Munging SXML with @code{pre-post-order} -* SXML Tree Fold:: Fold-based SXML transformations -* SXPath:: XPath for SXML -* sxml apply-templates:: A more XSLT-like approach to SXML transformations -* sxml ssax input-parse:: The SSAX tokenizer, optimized for Guile +* SXML Overview:: XML, as it was meant to be +* Reading and Writing XML:: Convenient XML parsing and serializing +* SSAX:: Custom functional-style XML parsers +* Transforming SXML:: Munging SXML with @code{pre-post-order} +* SXML Tree Fold:: Fold-based SXML transformations +* SXPath:: XPath for SXML +* sxml ssax input-parse:: The SSAX tokenizer, optimized for Guile +* sxml apply-templates:: A more XSLT-like approach to SXML transformations @end menu @node SXML Overview From 013e69838c1b424a924c531399aa475d4a241b6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 4 Sep 2015 22:53:59 +0200 Subject: [PATCH 24/46] Thank Ricardo. --- THANKS | 1 + 1 file changed, 1 insertion(+) diff --git a/THANKS b/THANKS index d5e8222fb..fbb15ada2 100644 --- a/THANKS +++ b/THANKS @@ -199,6 +199,7 @@ For fixes or providing information which led to a fix: Jon Wilson Andy Wingo Keith Wright + Ricardo Wurmus William Xu Atom X Zane From d52edc05d3ef565446f4710f3bf275b340eccc10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 10 Sep 2015 22:20:54 +0200 Subject: [PATCH 25/46] web: Fix 'close' method of delimited input ports. * module/web/response.scm (make-delimited-input-port)[close]: Replace erroneous self-recursive call with a call to 'close-port'. * test-suite/tests/web-response.test ("example-1")["response-body-port + close"]: New test. --- module/web/response.scm | 4 ++-- test-suite/tests/web-response.test | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/module/web/response.scm b/module/web/response.scm index 58e3f1141..614abcd55 100644 --- a/module/web/response.scm +++ b/module/web/response.scm @@ -1,6 +1,6 @@ ;;; HTTP response objects -;; Copyright (C) 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc. +;; Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015 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 @@ -265,7 +265,7 @@ closes PORT, unless KEEP-ALIVE? is true." (define close (and (not keep-alive?) (lambda () - (close port)))) + (close-port port)))) (make-custom-binary-input-port "delimited input port" read! #f #f close)) diff --git a/test-suite/tests/web-response.test b/test-suite/tests/web-response.test index 3c1894e13..848a7265a 100644 --- a/test-suite/tests/web-response.test +++ b/test-suite/tests/web-response.test @@ -1,6 +1,6 @@ ;;;; web-response.test --- HTTP responses -*- mode: scheme; coding: utf-8; -*- ;;;; -;;;; Copyright (C) 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc. +;;;; Copyright (C) 2010-2016 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 @@ -119,7 +119,17 @@ consectetur adipisicing elit,\r (with-fluids ((%default-port-encoding #f)) (let* ((r (read-response (open-input-string example-1))) (p (response-body-port r))) - (list (port-encoding p) (get-bytevector-all p))))))) + (list (port-encoding p) (get-bytevector-all p))))) + + (pass-if "response-body-port + close" + (with-fluids ((%default-port-encoding #f)) + (let* ((r (read-response (open-input-string example-1))) + (p (response-body-port r #:keep-alive? #f))) + ;; Before, calling 'close-port' here would yield a + ;; wrong-arg-num error when calling the delimited input port's + ;; 'close' procedure. + (close-port p) + (port-closed? p)))))) (with-test-prefix "example-2" (let* ((r (read-response (open-input-string example-2))) From d975a8dec6b2517dc180f60e01f37fc9bd1aaa07 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Thu, 17 Sep 2015 22:32:10 -0400 Subject: [PATCH 26/46] docs: Fix external representation of in tree-il. * doc/ref/compiler.texi (Tree-IL): Provide the correct external representation of . --- doc/ref/compiler.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/ref/compiler.texi b/doc/ref/compiler.texi index 6696360bd..057ebe817 100644 --- a/doc/ref/compiler.texi +++ b/doc/ref/compiler.texi @@ -1,6 +1,6 @@ @c -*-texinfo-*- @c This is part of the GNU Guile Reference Manual. -@c Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 +@c Copyright (C) 2008-2016 @c Free Software Foundation, Inc. @c See the file guile.texi for copying conditions. @@ -363,7 +363,7 @@ Sets a variable in the current procedure's module. @end deftp @deftp {Scheme Variable} src name exp -@deftpx {External Representation} (define (toplevel @var{name}) @var{exp}) +@deftpx {External Representation} (define @var{name} @var{exp}) Defines a new top-level variable in the current procedure's module. @end deftp From 0bcf5d78ecb40871fb48cf0f1a6065be38a3a14b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 26 Sep 2015 11:04:23 +0200 Subject: [PATCH 27/46] web: Gracefully handle premature EOF when reading chunk header. * module/web/http.scm (read-chunk-header): Return 0 when 'read-line' returns EOF. --- module/web/http.scm | 25 ++++++++++++++++--------- test-suite/tests/web-http.test | 10 ++++++++++ 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/module/web/http.scm b/module/web/http.scm index 8093ed21d..5ce7e7c67 100644 --- a/module/web/http.scm +++ b/module/web/http.scm @@ -34,6 +34,7 @@ #:use-module (srfi srfi-9) #:use-module (srfi srfi-19) #:use-module (ice-9 rdelim) + #:use-module (ice-9 match) #:use-module (ice-9 q) #:use-module (ice-9 binary-ports) #:use-module (rnrs bytevectors) @@ -1914,15 +1915,21 @@ treated specially, and is just returned as a plain string." ;; Chunked Responses (define (read-chunk-header port) - "Read a chunk header and return the chunk size." - (let* ((str (read-line port)) - (extension-start (string-index str (lambda (c) (or (char=? c #\;) - (char=? c #\return))))) - (size (string->number (if extension-start ; unnecessary? - (substring str 0 extension-start) - str) - 16))) - size)) + "Read a chunk header from PORT and return the size in bytes of the +upcoming chunk." + (match (read-line port) + ((? eof-object?) + ;; Connection closed prematurely: there's nothing left to read. + 0) + (str + (let ((extension-start (string-index str + (lambda (c) + (or (char=? c #\;) + (char=? c #\return)))))) + (string->number (if extension-start ; unnecessary? + (substring str 0 extension-start) + str) + 16))))) (define* (make-chunked-input-port port #:key (keep-alive? #f)) "Returns a new port which translates HTTP chunked transfer encoded diff --git a/test-suite/tests/web-http.test b/test-suite/tests/web-http.test index 8a7a29542..bd14de9b9 100644 --- a/test-suite/tests/web-http.test +++ b/test-suite/tests/web-http.test @@ -423,6 +423,16 @@ (utf8->string (get-bytevector-n port 6)) (reverse requests))))) + (pass-if-equal "EOF instead of chunk header" + "Only chunk." + ;; Omit the second chunk header, leading to a premature EOF. This + ;; used to cause 'read-chunk-header' to throw to wrong-type-arg. + ;; See the backtrace at + ;; . + (let* ((str "B\r\nOnly chunk.") + (port (make-chunked-input-port (open-input-string str)))) + (get-string-all port))) + (pass-if-equal (call-with-output-string (lambda (out-raw) From 2e3f6c3c678b28a839d6c751db5bc4c50a956c8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 29 Oct 2015 23:17:51 +0100 Subject: [PATCH 28/46] i18n: Add new collation test for posterity. * test-suite/tests/i18n.test ("text collation (Czech)"): New test prefix. --- test-suite/tests/i18n.test | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/test-suite/tests/i18n.test b/test-suite/tests/i18n.test index c63e3ac5b..73502a01e 100644 --- a/test-suite/tests/i18n.test +++ b/test-suite/tests/i18n.test @@ -1,7 +1,7 @@ ;;;; i18n.test --- Exercise the i18n API. -*- coding: utf-8; mode: scheme; -*- ;;;; ;;;; Copyright (C) 2006, 2007, 2009, 2010, 2011, 2012, -;;;; 2013, 2014 Free Software Foundation, Inc. +;;;; 2013, 2014, 2015 Free Software Foundation, Inc. ;;;; Ludovic Courtès ;;;; ;;;; This library is free software; you can redistribute it and/or @@ -270,6 +270,23 @@ (let ((gr (make-locale LC_ALL %greek-utf8-locale-name))) (string-locale-ci=? "ΧΑΟΣ" "χαος" gr)))))) + +(with-test-prefix "text collation (Czech)" + + (pass-if "string-locale. For + ;; now, just skip it if it fails (XXX). + (or (and (string-locale>? "chxxx" "cxxx") + (string-locale>? "chxxx" "hxxx") + (string-locale Date: Wed, 22 Jul 2015 12:48:24 -0400 Subject: [PATCH 29/46] Fix the rule to check for new signals and errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes . * libguile/Makefile.am (chknew-E chknew-SIG): Remove the line continuation after the targets, and include numbers in the recipe's signal/error regexp to catch names like E2BIG. Signed-off-by: Ludovic Courtès --- libguile/.gitignore | 1 + libguile/Makefile.am | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libguile/.gitignore b/libguile/.gitignore index 16c60ec38..41a8f7a56 100644 --- a/libguile/.gitignore +++ b/libguile/.gitignore @@ -13,3 +13,4 @@ libpath.h scmconfig.h version.h vm-i-*.i +*.NEW diff --git a/libguile/Makefile.am b/libguile/Makefile.am index 3bc9952a9..ae546dd61 100644 --- a/libguile/Makefile.am +++ b/libguile/Makefile.am @@ -815,13 +815,13 @@ MKDEP = gcc -M -MG $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) # Write $(srcdir)/cpp-{E,SIG}.syms.NEW if there are any not-yet-seen # ("new" to us) E* or SIG* symbols in or , respectively. -chknew-E chknew-SIG: \ +chknew-E chknew-SIG: @bit=`echo $@ | sed s/^chknew-//` ; \ old="$(srcdir)/cpp-$$bit.syms" ; \ echo "#include <$${bit}.h>" \ | sed 's/E/errno/;s/SIG/signal/' \ | gcc -dM -E - \ - | sed 's/^#define //;/^'$$bit'[A-Z][A-Z]*/!d;s/ .*//' \ + | sed 's/^#define //;/^'$$bit'[0-9A-Z][0-9A-Z]*/!d;s/ .*//' \ | sort | diff -u $$old - | sed '1,2d;/^+/!d;s/^.//' \ > TMP ; \ if [ -s TMP ] ; then new="$$old.NEW" ; \ From cdd0dc8213f625fe39a6813af0885a92b549ed12 Mon Sep 17 00:00:00 2001 From: David Michael Date: Wed, 22 Jul 2015 12:49:46 -0400 Subject: [PATCH 30/46] Add new Linux errno constants. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * libguile/cpp-E.syms (EHWPOISON, ERFKILL): New definitions. Signed-off-by: Ludovic Courtès --- libguile/cpp-E.syms | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libguile/cpp-E.syms b/libguile/cpp-E.syms index 3fbcbfe3a..3d3b0c3c6 100644 --- a/libguile/cpp-E.syms +++ b/libguile/cpp-E.syms @@ -33,6 +33,7 @@ EFAULT EFBIG EHOSTDOWN EHOSTUNREACH +EHWPOISON EIDRM EILSEQ EINPROGRESS @@ -112,6 +113,7 @@ EREMCHG EREMOTE EREMOTEIO ERESTART +ERFKILL EROFS ESHUTDOWN ESOCKTNOSUPPORT From befaad0c14d15d178caa5984cd32a8d64c536b32 Mon Sep 17 00:00:00 2001 From: David Michael Date: Wed, 22 Jul 2015 12:52:27 -0400 Subject: [PATCH 31/46] Add Hurd signal and error constants. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * libguile/cpp-E.syms (EAUTH, EBACKGROUND): New definitions. (EBADRPC, ED, EDIED, EFTYPE, EGRATUITOUS, EGREGIOUS): Likewise. (EIEIO, ENEEDAUTH, EPROCLIM, EPROCUNAVAIL): Likewise. (EPROGMISMATCH, EPROGUNAVAIL, ERPCMISMATCH): Likewise. * libguile/cpp-SIG.syms (SIGEMT, SIGEV_MAX_SIZE): Likewise. (SIGEV_PAD_SIZE, SIGINFO, SIGLOST): Likewise. Signed-off-by: Ludovic Courtès --- libguile/cpp-E.syms | 15 +++++++++++++++ libguile/cpp-SIG.syms | 5 +++++ 2 files changed, 20 insertions(+) diff --git a/libguile/cpp-E.syms b/libguile/cpp-E.syms index 3d3b0c3c6..53302febe 100644 --- a/libguile/cpp-E.syms +++ b/libguile/cpp-E.syms @@ -6,11 +6,14 @@ EADV EAFNOSUPPORT EAGAIN EALREADY +EAUTH +EBACKGROUND EBADE EBADF EBADFD EBADMSG EBADR +EBADRPC EBADRQC EBADSLT EBFONT @@ -22,19 +25,25 @@ ECOMM ECONNABORTED ECONNREFUSED ECONNRESET +ED EDEADLK EDEADLOCK EDESTADDRREQ +EDIED EDOM EDOTDOT EDQUOT EEXIST EFAULT EFBIG +EFTYPE +EGRATUITOUS +EGREGIOUS EHOSTDOWN EHOSTUNREACH EHWPOISON EIDRM +EIEIO EILSEQ EINPROGRESS EINTR @@ -64,6 +73,7 @@ EMSGSIZE EMULTIHOP ENAMETOOLONG ENAVAIL +ENEEDAUTH ENETDOWN ENETRESET ENETUNREACH @@ -105,6 +115,10 @@ EOWNERDEAD EPERM EPFNOSUPPORT EPIPE +EPROCLIM +EPROCUNAVAIL +EPROGMISMATCH +EPROGUNAVAIL EPROTO EPROTONOSUPPORT EPROTOTYPE @@ -115,6 +129,7 @@ EREMOTEIO ERESTART ERFKILL EROFS +ERPCMISMATCH ESHUTDOWN ESOCKTNOSUPPORT ESPIPE diff --git a/libguile/cpp-SIG.syms b/libguile/cpp-SIG.syms index bc5737679..2a619ce2d 100644 --- a/libguile/cpp-SIG.syms +++ b/libguile/cpp-SIG.syms @@ -5,17 +5,22 @@ SIGBUS SIGCHLD SIGCLD SIGCONT +SIGEMT +SIGEV_MAX_SIZE SIGEV_NONE +SIGEV_PAD_SIZE SIGEV_SIGNAL SIGEV_THREAD SIGEV_THREAD_ID SIGFPE SIGHUP SIGILL +SIGINFO SIGINT SIGIO SIGIOT SIGKILL +SIGLOST SIGPIPE SIGPOLL SIGPROF From 41f28a9b0e7c1d60c3465fcbc25e40a77d59aa14 Mon Sep 17 00:00:00 2001 From: David Michael Date: Wed, 22 Jul 2015 12:54:32 -0400 Subject: [PATCH 32/46] Remove SIGEV constant definitions. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * libguile/Makefile.am (chknew-E chknew-SIG): Anchor the end of the signal/error name pattern to only match alphanumeric symbols. * libguile/cpp-SIG.syms (SIGEV_MAX_SIZE, SIGEV_NONE): Remove. (SIGEV_PAD_SIZE, SIGEV_SIGNAL, SIGEV_THREAD): Likewise. (SIGEV_THREAD_ID): Likewise. Signed-off-by: Ludovic Courtès --- libguile/Makefile.am | 2 +- libguile/cpp-SIG.syms | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/libguile/Makefile.am b/libguile/Makefile.am index ae546dd61..f6d7515df 100644 --- a/libguile/Makefile.am +++ b/libguile/Makefile.am @@ -821,7 +821,7 @@ chknew-E chknew-SIG: echo "#include <$${bit}.h>" \ | sed 's/E/errno/;s/SIG/signal/' \ | gcc -dM -E - \ - | sed 's/^#define //;/^'$$bit'[0-9A-Z][0-9A-Z]*/!d;s/ .*//' \ + | sed 's/^#define //;/^'$$bit'[0-9A-Z][0-9A-Z]* /!d;s/ .*//' \ | sort | diff -u $$old - | sed '1,2d;/^+/!d;s/^.//' \ > TMP ; \ if [ -s TMP ] ; then new="$$old.NEW" ; \ diff --git a/libguile/cpp-SIG.syms b/libguile/cpp-SIG.syms index 2a619ce2d..728a29457 100644 --- a/libguile/cpp-SIG.syms +++ b/libguile/cpp-SIG.syms @@ -6,12 +6,6 @@ SIGCHLD SIGCLD SIGCONT SIGEMT -SIGEV_MAX_SIZE -SIGEV_NONE -SIGEV_PAD_SIZE -SIGEV_SIGNAL -SIGEV_THREAD -SIGEV_THREAD_ID SIGFPE SIGHUP SIGILL From 7c36145075450a78322f41622ebbf99f6be88eb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 29 Oct 2015 23:55:05 +0100 Subject: [PATCH 33/46] build: Remove libguile/mkstemp.c, redundant with Gnulib. Fixes . Reported by Kouhei Sutou . * configure.ac: Remove 'AC_REPLACE_FUNCS' for 'mkstemp'. * libguile/Makefile.am (EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES): Remove mkstemp.c. * libguile/mkstemp.c: Remove. --- configure.ac | 2 +- libguile/Makefile.am | 2 +- libguile/mkstemp.c | 129 ------------------------------------------- 3 files changed, 2 insertions(+), 131 deletions(-) delete mode 100644 libguile/mkstemp.c diff --git a/configure.ac b/configure.ac index 3a8f77291..b1bd7f1a8 100644 --- a/configure.ac +++ b/configure.ac @@ -1125,7 +1125,7 @@ if test "$enable_regex" = yes; then AC_DEFINE([ENABLE_REGEX], 1, [Define when regex support is enabled.]) fi -AC_REPLACE_FUNCS([strerror memmove mkstemp]) +AC_REPLACE_FUNCS([strerror memmove]) # Reasons for testing: # asinh, acosh, atanh, trunc - C99 standard, generally not available on diff --git a/libguile/Makefile.am b/libguile/Makefile.am index f6d7515df..bb3dc7ed7 100644 --- a/libguile/Makefile.am +++ b/libguile/Makefile.am @@ -455,7 +455,7 @@ EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES = _scm.h \ memmove.c strerror.c \ dynl.c regex-posix.c \ posix.c net_db.c socket.c \ - debug-malloc.c mkstemp.c \ + debug-malloc.c \ win32-uname.c \ locale-categories.h diff --git a/libguile/mkstemp.c b/libguile/mkstemp.c deleted file mode 100644 index d752d0714..000000000 --- a/libguile/mkstemp.c +++ /dev/null @@ -1,129 +0,0 @@ -/* Copyright (C) 1991, 1992, 1996, 1998, 2001, 2006, 2013, - 2014 Free Software Foundation, Inc. - - This file is derived from mkstemps.c from the GNU Libiberty Library - which in turn is derived from the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include "libguile/__scm.h" - -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif -#include -#include -#include -#include -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef __MINGW32__ -#include -#endif - -#ifndef TMP_MAX -#define TMP_MAX 16384 -#endif - -/* We provide this prototype to avoid compiler warnings. If this ever - conflicts with a declaration in a system header file, we'll find - out, because we should include that header file here. */ -int mkstemp (char *); - -/* Generate a unique temporary file name from TEMPLATE. - - TEMPLATE has the form: - - /ccXXXXXX - - The last six characters of TEMPLATE must be "XXXXXX"; they are - replaced with a string that makes the filename unique. - - Returns a file descriptor open on the file for reading and writing. */ -int -mkstemp (template) - char *template; -{ - static const char letters[] - = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; - static scm_t_uint64 value; -#ifdef HAVE_GETTIMEOFDAY - struct timeval tv; -#endif - char *XXXXXX; - size_t len; - int count; - - len = strlen (template); - - if ((int) len < 6 - || strncmp (&template[len - 6], "XXXXXX", 6)) - { - return -1; - } - - XXXXXX = &template[len - 6]; - -#ifdef HAVE_GETTIMEOFDAY - /* Get some more or less random data. */ - gettimeofday (&tv, NULL); - value += ((scm_t_uint64) tv.tv_usec << 16) ^ tv.tv_sec ^ getpid (); -#else - value += getpid (); -#endif - - for (count = 0; count < TMP_MAX; ++count) - { - scm_t_uint64 v = value; - int fd; - - /* Fill in the random bits. */ - XXXXXX[0] = letters[v % 62]; - v /= 62; - XXXXXX[1] = letters[v % 62]; - v /= 62; - XXXXXX[2] = letters[v % 62]; - v /= 62; - XXXXXX[3] = letters[v % 62]; - v /= 62; - XXXXXX[4] = letters[v % 62]; - v /= 62; - XXXXXX[5] = letters[v % 62]; - - fd = open (template, O_RDWR|O_CREAT|O_EXCL|O_BINARY, 0600); - if (fd >= 0) - /* The file does not exist. */ - return fd; - - /* This is a random value. It is only necessary that the next - TMP_MAX values generated by adding 7777 to VALUE are different - with (module 2^32). */ - value += 7777; - } - - /* We return the null string if we can't find a unique file name. */ - template[0] = '\0'; - return -1; -} From 34428bc5df1efe3f721c24fcbba99c380594c1af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 29 Oct 2015 23:59:02 +0100 Subject: [PATCH 34/46] Thank David and Kouhei. --- THANKS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/THANKS b/THANKS index fbb15ada2..616d3b04b 100644 --- a/THANKS +++ b/THANKS @@ -134,6 +134,7 @@ For fixes or providing information which led to a fix: Dan McMahill Roger Mc Murtrie Scott McPeak + David Michael Glenn Michaels Andrew Milkowski Tim Mooney @@ -170,6 +171,7 @@ For fixes or providing information which led to a fix: Dale Smith Cesar Strauss Klaus Stehle + Kouhei Sutou Rainer Tammer Frank Terbeck Samuel Thibault From a88f94ff5ecfbf67d621cac44fcc8772d8fb5bc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 30 Oct 2015 17:15:24 +0100 Subject: [PATCH 35/46] doc: Mention a known-good Flex version number. Suggested by Jamil Egdemir . * HACKING: Mention a Flex version number. --- HACKING | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/HACKING b/HACKING index b08f7c2d4..f3011d932 100644 --- a/HACKING +++ b/HACKING @@ -1,6 +1,7 @@ -*-text-*- Guile Hacking Guide -Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2008, 2012 Free software Foundation, Inc. +Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2008, 2012, + 2015 Free software Foundation, Inc. Permission is granted to anyone to make or distribute verbatim copies of this document as received, in any medium, provided that the @@ -69,7 +70,7 @@ gettext --- a system for rigging a program so that it can output its itself. flex --- a scanner generator. It's probably not essential to have the - latest version. + latest version; Flex 2.5.37 is known to work. One false move and you will be lost in a little maze of automatically generated files, all different. From 5de910ba2880b72cdc9fbeda6eccf806448f67ea Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sun, 6 Sep 2015 07:33:55 -0400 Subject: [PATCH 36/46] build: Add SCM_T_OFF_MAX and SCM_T_OFF_MIN to scmconfig.h. * libguile/gen-scmconfig.c (main): Add SCM_T_OFF_MAX and SCM_T_OFF_MIN to the generated 'scmconfig.h' file. --- libguile/gen-scmconfig.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libguile/gen-scmconfig.c b/libguile/gen-scmconfig.c index 11020cfb2..f825e9b2b 100644 --- a/libguile/gen-scmconfig.c +++ b/libguile/gen-scmconfig.c @@ -376,10 +376,16 @@ main (int argc, char *argv[]) #if defined GUILE_USE_64_CALLS && defined HAVE_STAT64 pf ("typedef scm_t_int64 scm_t_off;\n"); + pf ("#define SCM_T_OFF_MAX SCM_T_INT64_MAX\n"); + pf ("#define SCM_T_OFF_MIN SCM_T_INT64_MIN\n"); #elif SIZEOF_OFF_T == SIZEOF_INT pf ("typedef int scm_t_off;\n"); + pf ("#define SCM_T_OFF_MAX INT_MAX\n"); + pf ("#define SCM_T_OFF_MIN INT_MIN\n"); #else pf ("typedef long int scm_t_off;\n"); + pf ("#define SCM_T_OFF_MAX LONG_MAX\n"); + pf ("#define SCM_T_OFF_MIN LONG_MIN\n"); #endif pf ("/* Define to 1 if the compiler supports the " From cfd4401a2ca723a6984e1ba2739e064bdca76199 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 5 Nov 2015 19:15:14 +0100 Subject: [PATCH 37/46] Regenerate SRFI-14 character set data. Suggested by Mike Gran . * libguile/srfi-14.i.c: Regenerate for Unicode 8.0.0, with SHA256 38b17e1118206489a7e0ab5d29d7932212d38838df7d3ec025ecb58e8798ec20. --- libguile/srfi-14.i.c | 1730 ++++++++++++++++++++++++++++++++---------- 1 file changed, 1311 insertions(+), 419 deletions(-) diff --git a/libguile/srfi-14.i.c b/libguile/srfi-14.i.c index 42a1c2cf2..0b08742d2 100644 --- a/libguile/srfi-14.i.c +++ b/libguile/srfi-14.i.c @@ -363,7 +363,7 @@ scm_t_char_range cs_lower_case_ranges[] = { , {0x03ed, 0x03ed} , - {0x03ef, 0x03f2} + {0x03ef, 0x03f3} , {0x03f5, 0x03f5} , @@ -563,8 +563,18 @@ scm_t_char_range cs_lower_case_ranges[] = { , {0x0527, 0x0527} , + {0x0529, 0x0529} + , + {0x052b, 0x052b} + , + {0x052d, 0x052d} + , + {0x052f, 0x052f} + , {0x0561, 0x0587} , + {0x13f8, 0x13fd} + , {0x1930, 0x1938} , {0x1d02, 0x1d02} @@ -593,7 +603,7 @@ scm_t_char_range cs_lower_case_ranges[] = { , {0x1de0, 0x1de0} , - {0x1de3, 0x1de6} + {0x1de3, 0x1df4} , {0x1e01, 0x1e01} , @@ -953,6 +963,10 @@ scm_t_char_range cs_lower_case_ranges[] = { , {0xa697, 0xa697} , + {0xa699, 0xa699} + , + {0xa69b, 0xa69b} + , {0xa723, 0xa723} , {0xa725, 0xa725} @@ -1053,7 +1067,17 @@ scm_t_char_range cs_lower_case_ranges[] = { , {0xa791, 0xa791} , - {0xa793, 0xa793} + {0xa793, 0xa795} + , + {0xa797, 0xa797} + , + {0xa799, 0xa799} + , + {0xa79b, 0xa79b} + , + {0xa79d, 0xa79d} + , + {0xa79f, 0xa79f} , {0xa7a1, 0xa7a1} , @@ -1065,8 +1089,20 @@ scm_t_char_range cs_lower_case_ranges[] = { , {0xa7a9, 0xa7a9} , + {0xa7b5, 0xa7b5} + , + {0xa7b7, 0xa7b7} + , {0xa7f9, 0xa7f9} , + {0xab30, 0xab45} + , + {0xab47, 0xab5a} + , + {0xab60, 0xab64} + , + {0xab70, 0xabbf} + , {0xfb00, 0xfb06} , {0xfb13, 0xfb17} @@ -1075,13 +1111,17 @@ scm_t_char_range cs_lower_case_ranges[] = { , {0x10428, 0x1044f} , + {0x10cc0, 0x10cf2} + , + {0x118c0, 0x118df} + , {0x1f521, 0x1f521} , {0xe0061, 0xe007a} }; scm_t_char_set cs_lower_case = { - 536, + 556, cs_lower_case_ranges }; @@ -1380,6 +1420,8 @@ scm_t_char_range cs_upper_case_ranges[] = { , {0x0376, 0x0376} , + {0x037f, 0x037f} + , {0x0386, 0x0386} , {0x0388, 0x038a} @@ -1616,6 +1658,14 @@ scm_t_char_range cs_upper_case_ranges[] = { , {0x0526, 0x0526} , + {0x0528, 0x0528} + , + {0x052a, 0x052a} + , + {0x052c, 0x052c} + , + {0x052e, 0x052e} + , {0x0531, 0x0556} , {0x10a0, 0x10c5} @@ -1624,6 +1674,8 @@ scm_t_char_range cs_upper_case_ranges[] = { , {0x10cd, 0x10cd} , + {0x13a0, 0x13f5} + , {0x1d7b, 0x1d7b} , {0x1d7e, 0x1d7e} @@ -1982,6 +2034,10 @@ scm_t_char_range cs_upper_case_ranges[] = { , {0xa696, 0xa696} , + {0xa698, 0xa698} + , + {0xa69a, 0xa69a} + , {0xa722, 0xa722} , {0xa724, 0xa724} @@ -2080,6 +2136,16 @@ scm_t_char_range cs_upper_case_ranges[] = { , {0xa792, 0xa792} , + {0xa796, 0xa796} + , + {0xa798, 0xa798} + , + {0xa79a, 0xa79a} + , + {0xa79c, 0xa79c} + , + {0xa79e, 0xa79e} + , {0xa7a0, 0xa7a0} , {0xa7a2, 0xa7a2} @@ -2090,12 +2156,20 @@ scm_t_char_range cs_upper_case_ranges[] = { , {0xa7a8, 0xa7a8} , - {0xa7aa, 0xa7aa} + {0xa7aa, 0xa7ad} + , + {0xa7b0, 0xa7b4} + , + {0xa7b6, 0xa7b6} , {0xff21, 0xff3a} , {0x10400, 0x10427} , + {0x10c80, 0x10cb2} + , + {0x118a0, 0x118bf} + , {0x1f110, 0x1f12c} , {0x1f130, 0x1f149} @@ -2110,7 +2184,7 @@ scm_t_char_range cs_upper_case_ranges[] = { }; scm_t_char_set cs_upper_case = { - 511, + 528, cs_upper_case_ranges }; @@ -2172,6 +2246,8 @@ scm_t_char_range cs_letter_ranges[] = { , {0x037a, 0x037d} , + {0x037f, 0x037f} + , {0x0386, 0x0386} , {0x0388, 0x038a} @@ -2184,7 +2260,7 @@ scm_t_char_range cs_letter_ranges[] = { , {0x03f7, 0x0481} , - {0x048a, 0x0527} + {0x048a, 0x052f} , {0x0531, 0x0556} , @@ -2236,9 +2312,7 @@ scm_t_char_range cs_letter_ranges[] = { , {0x0840, 0x0858} , - {0x08a0, 0x08a0} - , - {0x08a2, 0x08ac} + {0x08a0, 0x08b4} , {0x0904, 0x0939} , @@ -2248,9 +2322,7 @@ scm_t_char_range cs_letter_ranges[] = { , {0x0958, 0x0961} , - {0x0971, 0x0977} - , - {0x0979, 0x097f} + {0x0971, 0x0980} , {0x0985, 0x098c} , @@ -2312,6 +2384,8 @@ scm_t_char_range cs_letter_ranges[] = { , {0x0ae0, 0x0ae1} , + {0x0af9, 0x0af9} + , {0x0b05, 0x0b0c} , {0x0b0f, 0x0b10} @@ -2360,13 +2434,11 @@ scm_t_char_range cs_letter_ranges[] = { , {0x0c12, 0x0c28} , - {0x0c2a, 0x0c33} - , - {0x0c35, 0x0c39} + {0x0c2a, 0x0c39} , {0x0c3d, 0x0c3d} , - {0x0c58, 0x0c59} + {0x0c58, 0x0c5a} , {0x0c60, 0x0c61} , @@ -2398,7 +2470,7 @@ scm_t_char_range cs_letter_ranges[] = { , {0x0d4e, 0x0d4e} , - {0x0d60, 0x0d61} + {0x0d5f, 0x0d61} , {0x0d7a, 0x0d7f} , @@ -2520,7 +2592,9 @@ scm_t_char_range cs_letter_ranges[] = { , {0x1380, 0x138f} , - {0x13a0, 0x13f4} + {0x13a0, 0x13f5} + , + {0x13f8, 0x13fd} , {0x1401, 0x166c} , @@ -2530,6 +2604,8 @@ scm_t_char_range cs_letter_ranges[] = { , {0x16a0, 0x16ea} , + {0x16f1, 0x16f8} + , {0x1700, 0x170c} , {0x170e, 0x1711} @@ -2556,7 +2632,7 @@ scm_t_char_range cs_letter_ranges[] = { , {0x18b0, 0x18f5} , - {0x1900, 0x191c} + {0x1900, 0x191e} , {0x1950, 0x196d} , @@ -2564,7 +2640,7 @@ scm_t_char_range cs_letter_ranges[] = { , {0x1980, 0x19ab} , - {0x19c1, 0x19c7} + {0x19b0, 0x19c9} , {0x1a00, 0x1a16} , @@ -2732,7 +2808,7 @@ scm_t_char_range cs_letter_ranges[] = { , {0x3400, 0x4db5} , - {0x4e00, 0x9fcc} + {0x4e00, 0x9fd5} , {0xa000, 0xa48c} , @@ -2746,7 +2822,7 @@ scm_t_char_range cs_letter_ranges[] = { , {0xa640, 0xa66e} , - {0xa67f, 0xa697} + {0xa67f, 0xa69d} , {0xa6a0, 0xa6e5} , @@ -2754,13 +2830,11 @@ scm_t_char_range cs_letter_ranges[] = { , {0xa722, 0xa788} , - {0xa78b, 0xa78e} + {0xa78b, 0xa7ad} , - {0xa790, 0xa793} + {0xa7b0, 0xa7b7} , - {0xa7a0, 0xa7aa} - , - {0xa7f8, 0xa801} + {0xa7f7, 0xa801} , {0xa803, 0xa805} , @@ -2776,6 +2850,8 @@ scm_t_char_range cs_letter_ranges[] = { , {0xa8fb, 0xa8fb} , + {0xa8fd, 0xa8fd} + , {0xa90a, 0xa925} , {0xa930, 0xa946} @@ -2786,6 +2862,12 @@ scm_t_char_range cs_letter_ranges[] = { , {0xa9cf, 0xa9cf} , + {0xa9e0, 0xa9e4} + , + {0xa9e6, 0xa9ef} + , + {0xa9fa, 0xa9fe} + , {0xaa00, 0xaa28} , {0xaa40, 0xaa42} @@ -2796,7 +2878,7 @@ scm_t_char_range cs_letter_ranges[] = { , {0xaa7a, 0xaa7a} , - {0xaa80, 0xaaaf} + {0xaa7e, 0xaaaf} , {0xaab1, 0xaab1} , @@ -2824,7 +2906,11 @@ scm_t_char_range cs_letter_ranges[] = { , {0xab28, 0xab2e} , - {0xabc0, 0xabe2} + {0xab30, 0xab5a} + , + {0xab5c, 0xab65} + , + {0xab70, 0xabe2} , {0xac00, 0xd7a3} , @@ -2900,12 +2986,14 @@ scm_t_char_range cs_letter_ranges[] = { , {0x102a0, 0x102d0} , - {0x10300, 0x1031e} + {0x10300, 0x1031f} , {0x10330, 0x10340} , {0x10342, 0x10349} , + {0x10350, 0x10375} + , {0x10380, 0x1039d} , {0x103a0, 0x103c3} @@ -2914,6 +3002,16 @@ scm_t_char_range cs_letter_ranges[] = { , {0x10400, 0x1049d} , + {0x10500, 0x10527} + , + {0x10530, 0x10563} + , + {0x10600, 0x10736} + , + {0x10740, 0x10755} + , + {0x10760, 0x10767} + , {0x10800, 0x10805} , {0x10808, 0x10808} @@ -2926,6 +3024,14 @@ scm_t_char_range cs_letter_ranges[] = { , {0x1083f, 0x10855} , + {0x10860, 0x10876} + , + {0x10880, 0x1089e} + , + {0x108e0, 0x108f2} + , + {0x108f4, 0x108f5} + , {0x10900, 0x10915} , {0x10920, 0x10939} @@ -2944,14 +3050,26 @@ scm_t_char_range cs_letter_ranges[] = { , {0x10a60, 0x10a7c} , + {0x10a80, 0x10a9c} + , + {0x10ac0, 0x10ac7} + , + {0x10ac9, 0x10ae4} + , {0x10b00, 0x10b35} , {0x10b40, 0x10b55} , {0x10b60, 0x10b72} , + {0x10b80, 0x10b91} + , {0x10c00, 0x10c48} , + {0x10c80, 0x10cb2} + , + {0x10cc0, 0x10cf2} + , {0x11003, 0x11037} , {0x11083, 0x110af} @@ -2960,18 +3078,98 @@ scm_t_char_range cs_letter_ranges[] = { , {0x11103, 0x11126} , + {0x11150, 0x11172} + , + {0x11176, 0x11176} + , {0x11183, 0x111b2} , {0x111c1, 0x111c4} , + {0x111da, 0x111da} + , + {0x111dc, 0x111dc} + , + {0x11200, 0x11211} + , + {0x11213, 0x1122b} + , + {0x11280, 0x11286} + , + {0x11288, 0x11288} + , + {0x1128a, 0x1128d} + , + {0x1128f, 0x1129d} + , + {0x1129f, 0x112a8} + , + {0x112b0, 0x112de} + , + {0x11305, 0x1130c} + , + {0x1130f, 0x11310} + , + {0x11313, 0x11328} + , + {0x1132a, 0x11330} + , + {0x11332, 0x11333} + , + {0x11335, 0x11339} + , + {0x1133d, 0x1133d} + , + {0x11350, 0x11350} + , + {0x1135d, 0x11361} + , + {0x11480, 0x114af} + , + {0x114c4, 0x114c5} + , + {0x114c7, 0x114c7} + , + {0x11580, 0x115ae} + , + {0x115d8, 0x115db} + , + {0x11600, 0x1162f} + , + {0x11644, 0x11644} + , {0x11680, 0x116aa} , - {0x12000, 0x1236e} + {0x11700, 0x11719} + , + {0x118a0, 0x118df} + , + {0x118ff, 0x118ff} + , + {0x11ac0, 0x11af8} + , + {0x12000, 0x12399} + , + {0x12480, 0x12543} , {0x13000, 0x1342e} , + {0x14400, 0x14646} + , {0x16800, 0x16a38} , + {0x16a40, 0x16a5e} + , + {0x16ad0, 0x16aed} + , + {0x16b00, 0x16b2f} + , + {0x16b40, 0x16b43} + , + {0x16b63, 0x16b77} + , + {0x16b7d, 0x16b8f} + , {0x16f00, 0x16f44} , {0x16f50, 0x16f50} @@ -2980,6 +3178,14 @@ scm_t_char_range cs_letter_ranges[] = { , {0x1b000, 0x1b001} , + {0x1bc00, 0x1bc6a} + , + {0x1bc70, 0x1bc7c} + , + {0x1bc80, 0x1bc88} + , + {0x1bc90, 0x1bc99} + , {0x1d400, 0x1d454} , {0x1d456, 0x1d49c} @@ -3040,6 +3246,8 @@ scm_t_char_range cs_letter_ranges[] = { , {0x1d7c4, 0x1d7cb} , + {0x1e800, 0x1e8c4} + , {0x1ee00, 0x1ee03} , {0x1ee05, 0x1ee1f} @@ -3112,11 +3320,13 @@ scm_t_char_range cs_letter_ranges[] = { , {0x2b740, 0x2b81d} , + {0x2b820, 0x2cea1} + , {0x2f800, 0x2fa1d} }; scm_t_char_set cs_letter = { - 486, + 554, cs_letter_ranges }; @@ -3147,6 +3357,8 @@ scm_t_char_range cs_digit_ranges[] = { , {0x0d66, 0x0d6f} , + {0x0de6, 0x0def} + , {0x0e50, 0x0e59} , {0x0ed0, 0x0ed9} @@ -3185,6 +3397,8 @@ scm_t_char_range cs_digit_ranges[] = { , {0xa9d0, 0xa9d9} , + {0xa9f0, 0xa9f9} + , {0xaa50, 0xaa59} , {0xabf0, 0xabf9} @@ -3201,13 +3415,27 @@ scm_t_char_range cs_digit_ranges[] = { , {0x111d0, 0x111d9} , + {0x112f0, 0x112f9} + , + {0x114d0, 0x114d9} + , + {0x11650, 0x11659} + , {0x116c0, 0x116c9} , + {0x11730, 0x11739} + , + {0x118e0, 0x118e9} + , + {0x16a60, 0x16a69} + , + {0x16b50, 0x16b59} + , {0x1d7ce, 0x1d7ff} }; scm_t_char_set cs_digit = { - 42, + 51, cs_digit_ranges }; @@ -3257,6 +3485,8 @@ scm_t_char_range cs_letter_plus_digit_ranges[] = { , {0x037a, 0x037d} , + {0x037f, 0x037f} + , {0x0386, 0x0386} , {0x0388, 0x038a} @@ -3269,7 +3499,7 @@ scm_t_char_range cs_letter_plus_digit_ranges[] = { , {0x03f7, 0x0481} , - {0x048a, 0x0527} + {0x048a, 0x052f} , {0x0531, 0x0556} , @@ -3321,9 +3551,7 @@ scm_t_char_range cs_letter_plus_digit_ranges[] = { , {0x0840, 0x0858} , - {0x08a0, 0x08a0} - , - {0x08a2, 0x08ac} + {0x08a0, 0x08b4} , {0x0904, 0x0939} , @@ -3335,9 +3563,7 @@ scm_t_char_range cs_letter_plus_digit_ranges[] = { , {0x0966, 0x096f} , - {0x0971, 0x0977} - , - {0x0979, 0x097f} + {0x0971, 0x0980} , {0x0985, 0x098c} , @@ -3403,6 +3629,8 @@ scm_t_char_range cs_letter_plus_digit_ranges[] = { , {0x0ae6, 0x0aef} , + {0x0af9, 0x0af9} + , {0x0b05, 0x0b0c} , {0x0b0f, 0x0b10} @@ -3455,13 +3683,11 @@ scm_t_char_range cs_letter_plus_digit_ranges[] = { , {0x0c12, 0x0c28} , - {0x0c2a, 0x0c33} - , - {0x0c35, 0x0c39} + {0x0c2a, 0x0c39} , {0x0c3d, 0x0c3d} , - {0x0c58, 0x0c59} + {0x0c58, 0x0c5a} , {0x0c60, 0x0c61} , @@ -3497,7 +3723,7 @@ scm_t_char_range cs_letter_plus_digit_ranges[] = { , {0x0d4e, 0x0d4e} , - {0x0d60, 0x0d61} + {0x0d5f, 0x0d61} , {0x0d66, 0x0d6f} , @@ -3513,6 +3739,8 @@ scm_t_char_range cs_letter_plus_digit_ranges[] = { , {0x0dc0, 0x0dc6} , + {0x0de6, 0x0def} + , {0x0e01, 0x0e30} , {0x0e32, 0x0e33} @@ -3629,7 +3857,9 @@ scm_t_char_range cs_letter_plus_digit_ranges[] = { , {0x1380, 0x138f} , - {0x13a0, 0x13f4} + {0x13a0, 0x13f5} + , + {0x13f8, 0x13fd} , {0x1401, 0x166c} , @@ -3639,6 +3869,8 @@ scm_t_char_range cs_letter_plus_digit_ranges[] = { , {0x16a0, 0x16ea} , + {0x16f1, 0x16f8} + , {0x1700, 0x170c} , {0x170e, 0x1711} @@ -3669,7 +3901,7 @@ scm_t_char_range cs_letter_plus_digit_ranges[] = { , {0x18b0, 0x18f5} , - {0x1900, 0x191c} + {0x1900, 0x191e} , {0x1946, 0x196d} , @@ -3677,7 +3909,7 @@ scm_t_char_range cs_letter_plus_digit_ranges[] = { , {0x1980, 0x19ab} , - {0x19c1, 0x19c7} + {0x19b0, 0x19c9} , {0x19d0, 0x19d9} , @@ -3851,7 +4083,7 @@ scm_t_char_range cs_letter_plus_digit_ranges[] = { , {0x3400, 0x4db5} , - {0x4e00, 0x9fcc} + {0x4e00, 0x9fd5} , {0xa000, 0xa48c} , @@ -3863,7 +4095,7 @@ scm_t_char_range cs_letter_plus_digit_ranges[] = { , {0xa640, 0xa66e} , - {0xa67f, 0xa697} + {0xa67f, 0xa69d} , {0xa6a0, 0xa6e5} , @@ -3871,13 +4103,11 @@ scm_t_char_range cs_letter_plus_digit_ranges[] = { , {0xa722, 0xa788} , - {0xa78b, 0xa78e} + {0xa78b, 0xa7ad} , - {0xa790, 0xa793} + {0xa7b0, 0xa7b7} , - {0xa7a0, 0xa7aa} - , - {0xa7f8, 0xa801} + {0xa7f7, 0xa801} , {0xa803, 0xa805} , @@ -3895,6 +4125,8 @@ scm_t_char_range cs_letter_plus_digit_ranges[] = { , {0xa8fb, 0xa8fb} , + {0xa8fd, 0xa8fd} + , {0xa900, 0xa925} , {0xa930, 0xa946} @@ -3905,6 +4137,10 @@ scm_t_char_range cs_letter_plus_digit_ranges[] = { , {0xa9cf, 0xa9d9} , + {0xa9e0, 0xa9e4} + , + {0xa9e6, 0xa9fe} + , {0xaa00, 0xaa28} , {0xaa40, 0xaa42} @@ -3917,7 +4153,7 @@ scm_t_char_range cs_letter_plus_digit_ranges[] = { , {0xaa7a, 0xaa7a} , - {0xaa80, 0xaaaf} + {0xaa7e, 0xaaaf} , {0xaab1, 0xaab1} , @@ -3945,7 +4181,11 @@ scm_t_char_range cs_letter_plus_digit_ranges[] = { , {0xab28, 0xab2e} , - {0xabc0, 0xabe2} + {0xab30, 0xab5a} + , + {0xab5c, 0xab65} + , + {0xab70, 0xabe2} , {0xabf0, 0xabf9} , @@ -4025,12 +4265,14 @@ scm_t_char_range cs_letter_plus_digit_ranges[] = { , {0x102a0, 0x102d0} , - {0x10300, 0x1031e} + {0x10300, 0x1031f} , {0x10330, 0x10340} , {0x10342, 0x10349} , + {0x10350, 0x10375} + , {0x10380, 0x1039d} , {0x103a0, 0x103c3} @@ -4041,6 +4283,16 @@ scm_t_char_range cs_letter_plus_digit_ranges[] = { , {0x104a0, 0x104a9} , + {0x10500, 0x10527} + , + {0x10530, 0x10563} + , + {0x10600, 0x10736} + , + {0x10740, 0x10755} + , + {0x10760, 0x10767} + , {0x10800, 0x10805} , {0x10808, 0x10808} @@ -4053,6 +4305,14 @@ scm_t_char_range cs_letter_plus_digit_ranges[] = { , {0x1083f, 0x10855} , + {0x10860, 0x10876} + , + {0x10880, 0x1089e} + , + {0x108e0, 0x108f2} + , + {0x108f4, 0x108f5} + , {0x10900, 0x10915} , {0x10920, 0x10939} @@ -4071,14 +4331,26 @@ scm_t_char_range cs_letter_plus_digit_ranges[] = { , {0x10a60, 0x10a7c} , + {0x10a80, 0x10a9c} + , + {0x10ac0, 0x10ac7} + , + {0x10ac9, 0x10ae4} + , {0x10b00, 0x10b35} , {0x10b40, 0x10b55} , {0x10b60, 0x10b72} , + {0x10b80, 0x10b91} + , {0x10c00, 0x10c48} , + {0x10c80, 0x10cb2} + , + {0x10cc0, 0x10cf2} + , {0x11003, 0x11037} , {0x11066, 0x1106f} @@ -4093,22 +4365,112 @@ scm_t_char_range cs_letter_plus_digit_ranges[] = { , {0x11136, 0x1113f} , + {0x11150, 0x11172} + , + {0x11176, 0x11176} + , {0x11183, 0x111b2} , {0x111c1, 0x111c4} , - {0x111d0, 0x111d9} + {0x111d0, 0x111da} + , + {0x111dc, 0x111dc} + , + {0x11200, 0x11211} + , + {0x11213, 0x1122b} + , + {0x11280, 0x11286} + , + {0x11288, 0x11288} + , + {0x1128a, 0x1128d} + , + {0x1128f, 0x1129d} + , + {0x1129f, 0x112a8} + , + {0x112b0, 0x112de} + , + {0x112f0, 0x112f9} + , + {0x11305, 0x1130c} + , + {0x1130f, 0x11310} + , + {0x11313, 0x11328} + , + {0x1132a, 0x11330} + , + {0x11332, 0x11333} + , + {0x11335, 0x11339} + , + {0x1133d, 0x1133d} + , + {0x11350, 0x11350} + , + {0x1135d, 0x11361} + , + {0x11480, 0x114af} + , + {0x114c4, 0x114c5} + , + {0x114c7, 0x114c7} + , + {0x114d0, 0x114d9} + , + {0x11580, 0x115ae} + , + {0x115d8, 0x115db} + , + {0x11600, 0x1162f} + , + {0x11644, 0x11644} + , + {0x11650, 0x11659} , {0x11680, 0x116aa} , {0x116c0, 0x116c9} , - {0x12000, 0x1236e} + {0x11700, 0x11719} + , + {0x11730, 0x11739} + , + {0x118a0, 0x118e9} + , + {0x118ff, 0x118ff} + , + {0x11ac0, 0x11af8} + , + {0x12000, 0x12399} + , + {0x12480, 0x12543} , {0x13000, 0x1342e} , + {0x14400, 0x14646} + , {0x16800, 0x16a38} , + {0x16a40, 0x16a5e} + , + {0x16a60, 0x16a69} + , + {0x16ad0, 0x16aed} + , + {0x16b00, 0x16b2f} + , + {0x16b40, 0x16b43} + , + {0x16b50, 0x16b59} + , + {0x16b63, 0x16b77} + , + {0x16b7d, 0x16b8f} + , {0x16f00, 0x16f44} , {0x16f50, 0x16f50} @@ -4117,6 +4479,14 @@ scm_t_char_range cs_letter_plus_digit_ranges[] = { , {0x1b000, 0x1b001} , + {0x1bc00, 0x1bc6a} + , + {0x1bc70, 0x1bc7c} + , + {0x1bc80, 0x1bc88} + , + {0x1bc90, 0x1bc99} + , {0x1d400, 0x1d454} , {0x1d456, 0x1d49c} @@ -4179,6 +4549,8 @@ scm_t_char_range cs_letter_plus_digit_ranges[] = { , {0x1d7ce, 0x1d7ff} , + {0x1e800, 0x1e8c4} + , {0x1ee00, 0x1ee03} , {0x1ee05, 0x1ee1f} @@ -4251,11 +4623,13 @@ scm_t_char_range cs_letter_plus_digit_ranges[] = { , {0x2b740, 0x2b81d} , + {0x2b820, 0x2cea1} + , {0x2f800, 0x2fa1d} }; scm_t_char_set cs_letter_plus_digit = { - 514, + 587, cs_letter_plus_digit_ranges }; @@ -4266,7 +4640,7 @@ scm_t_char_range cs_graphic_ranges[] = { , {0x00ae, 0x0377} , - {0x037a, 0x037e} + {0x037a, 0x037f} , {0x0384, 0x038a} , @@ -4274,7 +4648,7 @@ scm_t_char_range cs_graphic_ranges[] = { , {0x038e, 0x03a1} , - {0x03a3, 0x0527} + {0x03a3, 0x052f} , {0x0531, 0x0556} , @@ -4284,7 +4658,7 @@ scm_t_char_range cs_graphic_ranges[] = { , {0x0589, 0x058a} , - {0x058f, 0x058f} + {0x058d, 0x058f} , {0x0591, 0x05c7} , @@ -4312,17 +4686,9 @@ scm_t_char_range cs_graphic_ranges[] = { , {0x085e, 0x085e} , - {0x08a0, 0x08a0} + {0x08a0, 0x08b4} , - {0x08a2, 0x08ac} - , - {0x08e4, 0x08fe} - , - {0x0900, 0x0977} - , - {0x0979, 0x097f} - , - {0x0981, 0x0983} + {0x08e3, 0x0983} , {0x0985, 0x098c} , @@ -4408,6 +4774,8 @@ scm_t_char_range cs_graphic_ranges[] = { , {0x0ae6, 0x0af1} , + {0x0af9, 0x0af9} + , {0x0b01, 0x0b03} , {0x0b05, 0x0b0c} @@ -4468,7 +4836,7 @@ scm_t_char_range cs_graphic_ranges[] = { , {0x0be6, 0x0bfa} , - {0x0c01, 0x0c03} + {0x0c00, 0x0c03} , {0x0c05, 0x0c0c} , @@ -4476,9 +4844,7 @@ scm_t_char_range cs_graphic_ranges[] = { , {0x0c12, 0x0c28} , - {0x0c2a, 0x0c33} - , - {0x0c35, 0x0c39} + {0x0c2a, 0x0c39} , {0x0c3d, 0x0c44} , @@ -4488,7 +4854,7 @@ scm_t_char_range cs_graphic_ranges[] = { , {0x0c55, 0x0c56} , - {0x0c58, 0x0c59} + {0x0c58, 0x0c5a} , {0x0c60, 0x0c63} , @@ -4496,7 +4862,7 @@ scm_t_char_range cs_graphic_ranges[] = { , {0x0c78, 0x0c7f} , - {0x0c82, 0x0c83} + {0x0c81, 0x0c83} , {0x0c85, 0x0c8c} , @@ -4524,7 +4890,7 @@ scm_t_char_range cs_graphic_ranges[] = { , {0x0cf1, 0x0cf2} , - {0x0d02, 0x0d03} + {0x0d01, 0x0d03} , {0x0d05, 0x0d0c} , @@ -4540,7 +4906,7 @@ scm_t_char_range cs_graphic_ranges[] = { , {0x0d57, 0x0d57} , - {0x0d60, 0x0d63} + {0x0d5f, 0x0d63} , {0x0d66, 0x0d75} , @@ -4566,6 +4932,8 @@ scm_t_char_range cs_graphic_ranges[] = { , {0x0dd8, 0x0ddf} , + {0x0de6, 0x0def} + , {0x0df2, 0x0df4} , {0x0e01, 0x0e3a} @@ -4662,13 +5030,15 @@ scm_t_char_range cs_graphic_ranges[] = { , {0x1380, 0x1399} , - {0x13a0, 0x13f4} + {0x13a0, 0x13f5} + , + {0x13f8, 0x13fd} , {0x1400, 0x167f} , {0x1681, 0x169c} , - {0x16a0, 0x16f0} + {0x16a0, 0x16f8} , {0x1700, 0x170c} , @@ -4700,7 +5070,7 @@ scm_t_char_range cs_graphic_ranges[] = { , {0x18b0, 0x18f5} , - {0x1900, 0x191c} + {0x1900, 0x191e} , {0x1920, 0x192b} , @@ -4730,6 +5100,8 @@ scm_t_char_range cs_graphic_ranges[] = { , {0x1aa0, 0x1aad} , + {0x1ab0, 0x1abe} + , {0x1b00, 0x1b4b} , {0x1b50, 0x1b7c} @@ -4746,7 +5118,9 @@ scm_t_char_range cs_graphic_ranges[] = { , {0x1cd0, 0x1cf6} , - {0x1d00, 0x1de6} + {0x1cf8, 0x1cf9} + , + {0x1d00, 0x1df5} , {0x1dfc, 0x1f15} , @@ -4790,23 +5164,29 @@ scm_t_char_range cs_graphic_ranges[] = { , {0x2090, 0x209c} , - {0x20a0, 0x20ba} + {0x20a0, 0x20be} , {0x20d0, 0x20f0} , - {0x2100, 0x2189} + {0x2100, 0x218b} , - {0x2190, 0x23f3} + {0x2190, 0x23fa} , {0x2400, 0x2426} , {0x2440, 0x244a} , - {0x2460, 0x26ff} + {0x2460, 0x2b73} , - {0x2701, 0x2b4c} + {0x2b76, 0x2b95} , - {0x2b50, 0x2b59} + {0x2b98, 0x2bb9} + , + {0x2bbd, 0x2bc8} + , + {0x2bca, 0x2bd1} + , + {0x2bec, 0x2bef} , {0x2c00, 0x2c2e} , @@ -4842,7 +5222,7 @@ scm_t_char_range cs_graphic_ranges[] = { , {0x2dd8, 0x2dde} , - {0x2de0, 0x2e3b} + {0x2de0, 0x2e42} , {0x2e80, 0x2e99} , @@ -4872,7 +5252,7 @@ scm_t_char_range cs_graphic_ranges[] = { , {0x3300, 0x4db5} , - {0x4dc0, 0x9fcc} + {0x4dc0, 0x9fd5} , {0xa000, 0xa48c} , @@ -4880,17 +5260,13 @@ scm_t_char_range cs_graphic_ranges[] = { , {0xa4d0, 0xa62b} , - {0xa640, 0xa697} + {0xa640, 0xa6f7} , - {0xa69f, 0xa6f7} + {0xa700, 0xa7ad} , - {0xa700, 0xa78e} + {0xa7b0, 0xa7b7} , - {0xa790, 0xa793} - , - {0xa7a0, 0xa7aa} - , - {0xa7f8, 0xa82b} + {0xa7f7, 0xa82b} , {0xa830, 0xa839} , @@ -4900,7 +5276,7 @@ scm_t_char_range cs_graphic_ranges[] = { , {0xa8ce, 0xa8d9} , - {0xa8e0, 0xa8fb} + {0xa8e0, 0xa8fd} , {0xa900, 0xa953} , @@ -4910,7 +5286,7 @@ scm_t_char_range cs_graphic_ranges[] = { , {0xa9cf, 0xa9d9} , - {0xa9de, 0xa9df} + {0xa9de, 0xa9fe} , {0xaa00, 0xaa36} , @@ -4918,9 +5294,7 @@ scm_t_char_range cs_graphic_ranges[] = { , {0xaa50, 0xaa59} , - {0xaa5c, 0xaa7b} - , - {0xaa80, 0xaac2} + {0xaa5c, 0xaac2} , {0xaadb, 0xaaf6} , @@ -4934,7 +5308,9 @@ scm_t_char_range cs_graphic_ranges[] = { , {0xab28, 0xab2e} , - {0xabc0, 0xabed} + {0xab30, 0xab65} + , + {0xab70, 0xabed} , {0xabf0, 0xabf9} , @@ -4974,9 +5350,7 @@ scm_t_char_range cs_graphic_ranges[] = { , {0xfe00, 0xfe19} , - {0xfe20, 0xfe26} - , - {0xfe30, 0xfe52} + {0xfe20, 0xfe52} , {0xfe54, 0xfe66} , @@ -5020,22 +5394,26 @@ scm_t_char_range cs_graphic_ranges[] = { , {0x10107, 0x10133} , - {0x10137, 0x1018a} + {0x10137, 0x1018c} , {0x10190, 0x1019b} , + {0x101a0, 0x101a0} + , {0x101d0, 0x101fd} , {0x10280, 0x1029c} , {0x102a0, 0x102d0} , - {0x10300, 0x1031e} + {0x102e0, 0x102fb} , - {0x10320, 0x10323} + {0x10300, 0x10323} , {0x10330, 0x1034a} , + {0x10350, 0x1037a} + , {0x10380, 0x1039d} , {0x1039f, 0x103c3} @@ -5046,6 +5424,18 @@ scm_t_char_range cs_graphic_ranges[] = { , {0x104a0, 0x104a9} , + {0x10500, 0x10527} + , + {0x10530, 0x10563} + , + {0x1056f, 0x1056f} + , + {0x10600, 0x10736} + , + {0x10740, 0x10755} + , + {0x10760, 0x10767} + , {0x10800, 0x10805} , {0x10808, 0x10808} @@ -5058,9 +5448,15 @@ scm_t_char_range cs_graphic_ranges[] = { , {0x1083f, 0x10855} , - {0x10857, 0x1085f} + {0x10857, 0x1089e} , - {0x10900, 0x1091b} + {0x108a7, 0x108af} + , + {0x108e0, 0x108f2} + , + {0x108f4, 0x108f5} + , + {0x108fb, 0x1091b} , {0x1091f, 0x10939} , @@ -5068,9 +5464,9 @@ scm_t_char_range cs_graphic_ranges[] = { , {0x10980, 0x109b7} , - {0x109be, 0x109bf} + {0x109bc, 0x109cf} , - {0x10a00, 0x10a03} + {0x109d2, 0x10a03} , {0x10a05, 0x10a06} , @@ -5086,7 +5482,11 @@ scm_t_char_range cs_graphic_ranges[] = { , {0x10a50, 0x10a58} , - {0x10a60, 0x10a7f} + {0x10a60, 0x10a9f} + , + {0x10ac0, 0x10ae6} + , + {0x10aeb, 0x10af6} , {0x10b00, 0x10b35} , @@ -5094,17 +5494,27 @@ scm_t_char_range cs_graphic_ranges[] = { , {0x10b58, 0x10b72} , - {0x10b78, 0x10b7f} + {0x10b78, 0x10b91} + , + {0x10b99, 0x10b9c} + , + {0x10ba9, 0x10baf} , {0x10c00, 0x10c48} , + {0x10c80, 0x10cb2} + , + {0x10cc0, 0x10cf2} + , + {0x10cfa, 0x10cff} + , {0x10e60, 0x10e7e} , {0x11000, 0x1104d} , {0x11052, 0x1106f} , - {0x11080, 0x110bc} + {0x1107f, 0x110bc} , {0x110be, 0x110c1} , @@ -5116,24 +5526,124 @@ scm_t_char_range cs_graphic_ranges[] = { , {0x11136, 0x11143} , - {0x11180, 0x111c8} + {0x11150, 0x11176} , - {0x111d0, 0x111d9} + {0x11180, 0x111cd} + , + {0x111d0, 0x111df} + , + {0x111e1, 0x111f4} + , + {0x11200, 0x11211} + , + {0x11213, 0x1123d} + , + {0x11280, 0x11286} + , + {0x11288, 0x11288} + , + {0x1128a, 0x1128d} + , + {0x1128f, 0x1129d} + , + {0x1129f, 0x112a9} + , + {0x112b0, 0x112ea} + , + {0x112f0, 0x112f9} + , + {0x11300, 0x11303} + , + {0x11305, 0x1130c} + , + {0x1130f, 0x11310} + , + {0x11313, 0x11328} + , + {0x1132a, 0x11330} + , + {0x11332, 0x11333} + , + {0x11335, 0x11339} + , + {0x1133c, 0x11344} + , + {0x11347, 0x11348} + , + {0x1134b, 0x1134d} + , + {0x11350, 0x11350} + , + {0x11357, 0x11357} + , + {0x1135d, 0x11363} + , + {0x11366, 0x1136c} + , + {0x11370, 0x11374} + , + {0x11480, 0x114c7} + , + {0x114d0, 0x114d9} + , + {0x11580, 0x115b5} + , + {0x115b8, 0x115dd} + , + {0x11600, 0x11644} + , + {0x11650, 0x11659} , {0x11680, 0x116b7} , {0x116c0, 0x116c9} , - {0x12000, 0x1236e} + {0x11700, 0x11719} , - {0x12400, 0x12462} + {0x1171d, 0x1172b} , - {0x12470, 0x12473} + {0x11730, 0x1173f} + , + {0x118a0, 0x118f2} + , + {0x118ff, 0x118ff} + , + {0x11ac0, 0x11af8} + , + {0x12000, 0x12399} + , + {0x12400, 0x1246e} + , + {0x12470, 0x12474} + , + {0x12480, 0x12543} , {0x13000, 0x1342e} , + {0x14400, 0x14646} + , {0x16800, 0x16a38} , + {0x16a40, 0x16a5e} + , + {0x16a60, 0x16a69} + , + {0x16a6e, 0x16a6f} + , + {0x16ad0, 0x16aed} + , + {0x16af0, 0x16af5} + , + {0x16b00, 0x16b45} + , + {0x16b50, 0x16b59} + , + {0x16b5b, 0x16b61} + , + {0x16b63, 0x16b77} + , + {0x16b7d, 0x16b8f} + , {0x16f00, 0x16f44} , {0x16f50, 0x16f7e} @@ -5142,13 +5652,23 @@ scm_t_char_range cs_graphic_ranges[] = { , {0x1b000, 0x1b001} , + {0x1bc00, 0x1bc6a} + , + {0x1bc70, 0x1bc7c} + , + {0x1bc80, 0x1bc88} + , + {0x1bc90, 0x1bc99} + , + {0x1bc9c, 0x1bc9f} + , {0x1d000, 0x1d0f5} , {0x1d100, 0x1d126} , {0x1d129, 0x1d172} , - {0x1d17b, 0x1d1dd} + {0x1d17b, 0x1d1e8} , {0x1d200, 0x1d245} , @@ -5196,7 +5716,15 @@ scm_t_char_range cs_graphic_ranges[] = { , {0x1d6a8, 0x1d7cb} , - {0x1d7ce, 0x1d7ff} + {0x1d7ce, 0x1da8b} + , + {0x1da9b, 0x1da9f} + , + {0x1daa1, 0x1daaf} + , + {0x1e800, 0x1e8c4} + , + {0x1e8c7, 0x1e8d6} , {0x1ee00, 0x1ee03} , @@ -5272,13 +5800,13 @@ scm_t_char_range cs_graphic_ranges[] = { , {0x1f0a0, 0x1f0ae} , - {0x1f0b1, 0x1f0be} + {0x1f0b1, 0x1f0bf} , {0x1f0c1, 0x1f0cf} , - {0x1f0d1, 0x1f0df} + {0x1f0d1, 0x1f0f5} , - {0x1f100, 0x1f10a} + {0x1f100, 0x1f10c} , {0x1f110, 0x1f12e} , @@ -5294,55 +5822,51 @@ scm_t_char_range cs_graphic_ranges[] = { , {0x1f250, 0x1f251} , - {0x1f300, 0x1f320} + {0x1f300, 0x1f579} , - {0x1f330, 0x1f335} + {0x1f57b, 0x1f5a3} , - {0x1f337, 0x1f37c} + {0x1f5a5, 0x1f6d0} , - {0x1f380, 0x1f393} + {0x1f6e0, 0x1f6ec} , - {0x1f3a0, 0x1f3c4} - , - {0x1f3c6, 0x1f3ca} - , - {0x1f3e0, 0x1f3f0} - , - {0x1f400, 0x1f43e} - , - {0x1f440, 0x1f440} - , - {0x1f442, 0x1f4f7} - , - {0x1f4f9, 0x1f4fc} - , - {0x1f500, 0x1f53d} - , - {0x1f540, 0x1f543} - , - {0x1f550, 0x1f567} - , - {0x1f5fb, 0x1f640} - , - {0x1f645, 0x1f64f} - , - {0x1f680, 0x1f6c5} + {0x1f6f0, 0x1f6f3} , {0x1f700, 0x1f773} , + {0x1f780, 0x1f7d4} + , + {0x1f800, 0x1f80b} + , + {0x1f810, 0x1f847} + , + {0x1f850, 0x1f859} + , + {0x1f860, 0x1f887} + , + {0x1f890, 0x1f8ad} + , + {0x1f910, 0x1f918} + , + {0x1f980, 0x1f984} + , + {0x1f9c0, 0x1f9c0} + , {0x20000, 0x2a6d6} , {0x2a700, 0x2b734} , {0x2b740, 0x2b81d} , + {0x2b820, 0x2cea1} + , {0x2f800, 0x2fa1d} , {0xe0100, 0xe01ef} }; scm_t_char_set cs_graphic = { - 540, + 615, cs_graphic_ranges }; @@ -5355,8 +5879,6 @@ scm_t_char_range cs_whitespace_ranges[] = { , {0x1680, 0x1680} , - {0x180e, 0x180e} - , {0x2000, 0x200a} , {0x2028, 0x2029} @@ -5369,7 +5891,7 @@ scm_t_char_range cs_whitespace_ranges[] = { }; scm_t_char_set cs_whitespace = { - 10, + 9, cs_whitespace_ranges }; @@ -5382,7 +5904,7 @@ scm_t_char_range cs_printing_ranges[] = { , {0x00ae, 0x0377} , - {0x037a, 0x037e} + {0x037a, 0x037f} , {0x0384, 0x038a} , @@ -5390,7 +5912,7 @@ scm_t_char_range cs_printing_ranges[] = { , {0x038e, 0x03a1} , - {0x03a3, 0x0527} + {0x03a3, 0x052f} , {0x0531, 0x0556} , @@ -5400,7 +5922,7 @@ scm_t_char_range cs_printing_ranges[] = { , {0x0589, 0x058a} , - {0x058f, 0x058f} + {0x058d, 0x058f} , {0x0591, 0x05c7} , @@ -5428,17 +5950,9 @@ scm_t_char_range cs_printing_ranges[] = { , {0x085e, 0x085e} , - {0x08a0, 0x08a0} + {0x08a0, 0x08b4} , - {0x08a2, 0x08ac} - , - {0x08e4, 0x08fe} - , - {0x0900, 0x0977} - , - {0x0979, 0x097f} - , - {0x0981, 0x0983} + {0x08e3, 0x0983} , {0x0985, 0x098c} , @@ -5524,6 +6038,8 @@ scm_t_char_range cs_printing_ranges[] = { , {0x0ae6, 0x0af1} , + {0x0af9, 0x0af9} + , {0x0b01, 0x0b03} , {0x0b05, 0x0b0c} @@ -5584,7 +6100,7 @@ scm_t_char_range cs_printing_ranges[] = { , {0x0be6, 0x0bfa} , - {0x0c01, 0x0c03} + {0x0c00, 0x0c03} , {0x0c05, 0x0c0c} , @@ -5592,9 +6108,7 @@ scm_t_char_range cs_printing_ranges[] = { , {0x0c12, 0x0c28} , - {0x0c2a, 0x0c33} - , - {0x0c35, 0x0c39} + {0x0c2a, 0x0c39} , {0x0c3d, 0x0c44} , @@ -5604,7 +6118,7 @@ scm_t_char_range cs_printing_ranges[] = { , {0x0c55, 0x0c56} , - {0x0c58, 0x0c59} + {0x0c58, 0x0c5a} , {0x0c60, 0x0c63} , @@ -5612,7 +6126,7 @@ scm_t_char_range cs_printing_ranges[] = { , {0x0c78, 0x0c7f} , - {0x0c82, 0x0c83} + {0x0c81, 0x0c83} , {0x0c85, 0x0c8c} , @@ -5640,7 +6154,7 @@ scm_t_char_range cs_printing_ranges[] = { , {0x0cf1, 0x0cf2} , - {0x0d02, 0x0d03} + {0x0d01, 0x0d03} , {0x0d05, 0x0d0c} , @@ -5656,7 +6170,7 @@ scm_t_char_range cs_printing_ranges[] = { , {0x0d57, 0x0d57} , - {0x0d60, 0x0d63} + {0x0d5f, 0x0d63} , {0x0d66, 0x0d75} , @@ -5682,6 +6196,8 @@ scm_t_char_range cs_printing_ranges[] = { , {0x0dd8, 0x0ddf} , + {0x0de6, 0x0def} + , {0x0df2, 0x0df4} , {0x0e01, 0x0e3a} @@ -5778,11 +6294,13 @@ scm_t_char_range cs_printing_ranges[] = { , {0x1380, 0x1399} , - {0x13a0, 0x13f4} + {0x13a0, 0x13f5} + , + {0x13f8, 0x13fd} , {0x1400, 0x169c} , - {0x16a0, 0x16f0} + {0x16a0, 0x16f8} , {0x1700, 0x170c} , @@ -5804,7 +6322,7 @@ scm_t_char_range cs_printing_ranges[] = { , {0x17f0, 0x17f9} , - {0x1800, 0x180e} + {0x1800, 0x180d} , {0x1810, 0x1819} , @@ -5814,7 +6332,7 @@ scm_t_char_range cs_printing_ranges[] = { , {0x18b0, 0x18f5} , - {0x1900, 0x191c} + {0x1900, 0x191e} , {0x1920, 0x192b} , @@ -5844,6 +6362,8 @@ scm_t_char_range cs_printing_ranges[] = { , {0x1aa0, 0x1aad} , + {0x1ab0, 0x1abe} + , {0x1b00, 0x1b4b} , {0x1b50, 0x1b7c} @@ -5860,7 +6380,9 @@ scm_t_char_range cs_printing_ranges[] = { , {0x1cd0, 0x1cf6} , - {0x1d00, 0x1de6} + {0x1cf8, 0x1cf9} + , + {0x1d00, 0x1df5} , {0x1dfc, 0x1f15} , @@ -5906,23 +6428,29 @@ scm_t_char_range cs_printing_ranges[] = { , {0x2090, 0x209c} , - {0x20a0, 0x20ba} + {0x20a0, 0x20be} , {0x20d0, 0x20f0} , - {0x2100, 0x2189} + {0x2100, 0x218b} , - {0x2190, 0x23f3} + {0x2190, 0x23fa} , {0x2400, 0x2426} , {0x2440, 0x244a} , - {0x2460, 0x26ff} + {0x2460, 0x2b73} , - {0x2701, 0x2b4c} + {0x2b76, 0x2b95} , - {0x2b50, 0x2b59} + {0x2b98, 0x2bb9} + , + {0x2bbd, 0x2bc8} + , + {0x2bca, 0x2bd1} + , + {0x2bec, 0x2bef} , {0x2c00, 0x2c2e} , @@ -5958,7 +6486,7 @@ scm_t_char_range cs_printing_ranges[] = { , {0x2dd8, 0x2dde} , - {0x2de0, 0x2e3b} + {0x2de0, 0x2e42} , {0x2e80, 0x2e99} , @@ -5988,7 +6516,7 @@ scm_t_char_range cs_printing_ranges[] = { , {0x3300, 0x4db5} , - {0x4dc0, 0x9fcc} + {0x4dc0, 0x9fd5} , {0xa000, 0xa48c} , @@ -5996,17 +6524,13 @@ scm_t_char_range cs_printing_ranges[] = { , {0xa4d0, 0xa62b} , - {0xa640, 0xa697} + {0xa640, 0xa6f7} , - {0xa69f, 0xa6f7} + {0xa700, 0xa7ad} , - {0xa700, 0xa78e} + {0xa7b0, 0xa7b7} , - {0xa790, 0xa793} - , - {0xa7a0, 0xa7aa} - , - {0xa7f8, 0xa82b} + {0xa7f7, 0xa82b} , {0xa830, 0xa839} , @@ -6016,7 +6540,7 @@ scm_t_char_range cs_printing_ranges[] = { , {0xa8ce, 0xa8d9} , - {0xa8e0, 0xa8fb} + {0xa8e0, 0xa8fd} , {0xa900, 0xa953} , @@ -6026,7 +6550,7 @@ scm_t_char_range cs_printing_ranges[] = { , {0xa9cf, 0xa9d9} , - {0xa9de, 0xa9df} + {0xa9de, 0xa9fe} , {0xaa00, 0xaa36} , @@ -6034,9 +6558,7 @@ scm_t_char_range cs_printing_ranges[] = { , {0xaa50, 0xaa59} , - {0xaa5c, 0xaa7b} - , - {0xaa80, 0xaac2} + {0xaa5c, 0xaac2} , {0xaadb, 0xaaf6} , @@ -6050,7 +6572,9 @@ scm_t_char_range cs_printing_ranges[] = { , {0xab28, 0xab2e} , - {0xabc0, 0xabed} + {0xab30, 0xab65} + , + {0xab70, 0xabed} , {0xabf0, 0xabf9} , @@ -6090,9 +6614,7 @@ scm_t_char_range cs_printing_ranges[] = { , {0xfe00, 0xfe19} , - {0xfe20, 0xfe26} - , - {0xfe30, 0xfe52} + {0xfe20, 0xfe52} , {0xfe54, 0xfe66} , @@ -6136,22 +6658,26 @@ scm_t_char_range cs_printing_ranges[] = { , {0x10107, 0x10133} , - {0x10137, 0x1018a} + {0x10137, 0x1018c} , {0x10190, 0x1019b} , + {0x101a0, 0x101a0} + , {0x101d0, 0x101fd} , {0x10280, 0x1029c} , {0x102a0, 0x102d0} , - {0x10300, 0x1031e} + {0x102e0, 0x102fb} , - {0x10320, 0x10323} + {0x10300, 0x10323} , {0x10330, 0x1034a} , + {0x10350, 0x1037a} + , {0x10380, 0x1039d} , {0x1039f, 0x103c3} @@ -6162,6 +6688,18 @@ scm_t_char_range cs_printing_ranges[] = { , {0x104a0, 0x104a9} , + {0x10500, 0x10527} + , + {0x10530, 0x10563} + , + {0x1056f, 0x1056f} + , + {0x10600, 0x10736} + , + {0x10740, 0x10755} + , + {0x10760, 0x10767} + , {0x10800, 0x10805} , {0x10808, 0x10808} @@ -6174,9 +6712,15 @@ scm_t_char_range cs_printing_ranges[] = { , {0x1083f, 0x10855} , - {0x10857, 0x1085f} + {0x10857, 0x1089e} , - {0x10900, 0x1091b} + {0x108a7, 0x108af} + , + {0x108e0, 0x108f2} + , + {0x108f4, 0x108f5} + , + {0x108fb, 0x1091b} , {0x1091f, 0x10939} , @@ -6184,9 +6728,9 @@ scm_t_char_range cs_printing_ranges[] = { , {0x10980, 0x109b7} , - {0x109be, 0x109bf} + {0x109bc, 0x109cf} , - {0x10a00, 0x10a03} + {0x109d2, 0x10a03} , {0x10a05, 0x10a06} , @@ -6202,7 +6746,11 @@ scm_t_char_range cs_printing_ranges[] = { , {0x10a50, 0x10a58} , - {0x10a60, 0x10a7f} + {0x10a60, 0x10a9f} + , + {0x10ac0, 0x10ae6} + , + {0x10aeb, 0x10af6} , {0x10b00, 0x10b35} , @@ -6210,17 +6758,27 @@ scm_t_char_range cs_printing_ranges[] = { , {0x10b58, 0x10b72} , - {0x10b78, 0x10b7f} + {0x10b78, 0x10b91} + , + {0x10b99, 0x10b9c} + , + {0x10ba9, 0x10baf} , {0x10c00, 0x10c48} , + {0x10c80, 0x10cb2} + , + {0x10cc0, 0x10cf2} + , + {0x10cfa, 0x10cff} + , {0x10e60, 0x10e7e} , {0x11000, 0x1104d} , {0x11052, 0x1106f} , - {0x11080, 0x110bc} + {0x1107f, 0x110bc} , {0x110be, 0x110c1} , @@ -6232,24 +6790,124 @@ scm_t_char_range cs_printing_ranges[] = { , {0x11136, 0x11143} , - {0x11180, 0x111c8} + {0x11150, 0x11176} , - {0x111d0, 0x111d9} + {0x11180, 0x111cd} + , + {0x111d0, 0x111df} + , + {0x111e1, 0x111f4} + , + {0x11200, 0x11211} + , + {0x11213, 0x1123d} + , + {0x11280, 0x11286} + , + {0x11288, 0x11288} + , + {0x1128a, 0x1128d} + , + {0x1128f, 0x1129d} + , + {0x1129f, 0x112a9} + , + {0x112b0, 0x112ea} + , + {0x112f0, 0x112f9} + , + {0x11300, 0x11303} + , + {0x11305, 0x1130c} + , + {0x1130f, 0x11310} + , + {0x11313, 0x11328} + , + {0x1132a, 0x11330} + , + {0x11332, 0x11333} + , + {0x11335, 0x11339} + , + {0x1133c, 0x11344} + , + {0x11347, 0x11348} + , + {0x1134b, 0x1134d} + , + {0x11350, 0x11350} + , + {0x11357, 0x11357} + , + {0x1135d, 0x11363} + , + {0x11366, 0x1136c} + , + {0x11370, 0x11374} + , + {0x11480, 0x114c7} + , + {0x114d0, 0x114d9} + , + {0x11580, 0x115b5} + , + {0x115b8, 0x115dd} + , + {0x11600, 0x11644} + , + {0x11650, 0x11659} , {0x11680, 0x116b7} , {0x116c0, 0x116c9} , - {0x12000, 0x1236e} + {0x11700, 0x11719} , - {0x12400, 0x12462} + {0x1171d, 0x1172b} , - {0x12470, 0x12473} + {0x11730, 0x1173f} + , + {0x118a0, 0x118f2} + , + {0x118ff, 0x118ff} + , + {0x11ac0, 0x11af8} + , + {0x12000, 0x12399} + , + {0x12400, 0x1246e} + , + {0x12470, 0x12474} + , + {0x12480, 0x12543} , {0x13000, 0x1342e} , + {0x14400, 0x14646} + , {0x16800, 0x16a38} , + {0x16a40, 0x16a5e} + , + {0x16a60, 0x16a69} + , + {0x16a6e, 0x16a6f} + , + {0x16ad0, 0x16aed} + , + {0x16af0, 0x16af5} + , + {0x16b00, 0x16b45} + , + {0x16b50, 0x16b59} + , + {0x16b5b, 0x16b61} + , + {0x16b63, 0x16b77} + , + {0x16b7d, 0x16b8f} + , {0x16f00, 0x16f44} , {0x16f50, 0x16f7e} @@ -6258,13 +6916,23 @@ scm_t_char_range cs_printing_ranges[] = { , {0x1b000, 0x1b001} , + {0x1bc00, 0x1bc6a} + , + {0x1bc70, 0x1bc7c} + , + {0x1bc80, 0x1bc88} + , + {0x1bc90, 0x1bc99} + , + {0x1bc9c, 0x1bc9f} + , {0x1d000, 0x1d0f5} , {0x1d100, 0x1d126} , {0x1d129, 0x1d172} , - {0x1d17b, 0x1d1dd} + {0x1d17b, 0x1d1e8} , {0x1d200, 0x1d245} , @@ -6312,7 +6980,15 @@ scm_t_char_range cs_printing_ranges[] = { , {0x1d6a8, 0x1d7cb} , - {0x1d7ce, 0x1d7ff} + {0x1d7ce, 0x1da8b} + , + {0x1da9b, 0x1da9f} + , + {0x1daa1, 0x1daaf} + , + {0x1e800, 0x1e8c4} + , + {0x1e8c7, 0x1e8d6} , {0x1ee00, 0x1ee03} , @@ -6388,13 +7064,13 @@ scm_t_char_range cs_printing_ranges[] = { , {0x1f0a0, 0x1f0ae} , - {0x1f0b1, 0x1f0be} + {0x1f0b1, 0x1f0bf} , {0x1f0c1, 0x1f0cf} , - {0x1f0d1, 0x1f0df} + {0x1f0d1, 0x1f0f5} , - {0x1f100, 0x1f10a} + {0x1f100, 0x1f10c} , {0x1f110, 0x1f12e} , @@ -6410,55 +7086,51 @@ scm_t_char_range cs_printing_ranges[] = { , {0x1f250, 0x1f251} , - {0x1f300, 0x1f320} + {0x1f300, 0x1f579} , - {0x1f330, 0x1f335} + {0x1f57b, 0x1f5a3} , - {0x1f337, 0x1f37c} + {0x1f5a5, 0x1f6d0} , - {0x1f380, 0x1f393} + {0x1f6e0, 0x1f6ec} , - {0x1f3a0, 0x1f3c4} - , - {0x1f3c6, 0x1f3ca} - , - {0x1f3e0, 0x1f3f0} - , - {0x1f400, 0x1f43e} - , - {0x1f440, 0x1f440} - , - {0x1f442, 0x1f4f7} - , - {0x1f4f9, 0x1f4fc} - , - {0x1f500, 0x1f53d} - , - {0x1f540, 0x1f543} - , - {0x1f550, 0x1f567} - , - {0x1f5fb, 0x1f640} - , - {0x1f645, 0x1f64f} - , - {0x1f680, 0x1f6c5} + {0x1f6f0, 0x1f6f3} , {0x1f700, 0x1f773} , + {0x1f780, 0x1f7d4} + , + {0x1f800, 0x1f80b} + , + {0x1f810, 0x1f847} + , + {0x1f850, 0x1f859} + , + {0x1f860, 0x1f887} + , + {0x1f890, 0x1f8ad} + , + {0x1f910, 0x1f918} + , + {0x1f980, 0x1f984} + , + {0x1f9c0, 0x1f9c0} + , {0x20000, 0x2a6d6} , {0x2a700, 0x2b734} , {0x2b740, 0x2b81d} , + {0x2b820, 0x2cea1} + , {0x2f800, 0x2fa1d} , {0xe0100, 0xe01ef} }; scm_t_char_set cs_printing = { - 541, + 616, cs_printing_ranges }; @@ -6620,6 +7292,8 @@ scm_t_char_range cs_punctuation_ranges[] = { , {0x208d, 0x208e} , + {0x2308, 0x230b} + , {0x2329, 0x232a} , {0x2768, 0x2775} @@ -6642,7 +7316,7 @@ scm_t_char_range cs_punctuation_ranges[] = { , {0x2e00, 0x2e2e} , - {0x2e30, 0x2e3b} + {0x2e30, 0x2e42} , {0x3001, 0x3003} , @@ -6674,6 +7348,8 @@ scm_t_char_range cs_punctuation_ranges[] = { , {0xa8f8, 0xa8fa} , + {0xa8fc, 0xa8fc} + , {0xa92e, 0xa92f} , {0xa95f, 0xa95f} @@ -6730,6 +7406,8 @@ scm_t_char_range cs_punctuation_ranges[] = { , {0x103d0, 0x103d0} , + {0x1056f, 0x1056f} + , {0x10857, 0x10857} , {0x1091f, 0x1091f} @@ -6740,8 +7418,12 @@ scm_t_char_range cs_punctuation_ranges[] = { , {0x10a7f, 0x10a7f} , + {0x10af0, 0x10af6} + , {0x10b39, 0x10b3f} , + {0x10b99, 0x10b9c} + , {0x11047, 0x1104d} , {0x110bb, 0x110bc} @@ -6750,13 +7432,45 @@ scm_t_char_range cs_punctuation_ranges[] = { , {0x11140, 0x11143} , - {0x111c5, 0x111c8} + {0x11174, 0x11175} , - {0x12470, 0x12473} + {0x111c5, 0x111c9} + , + {0x111cd, 0x111cd} + , + {0x111db, 0x111db} + , + {0x111dd, 0x111df} + , + {0x11238, 0x1123d} + , + {0x112a9, 0x112a9} + , + {0x114c6, 0x114c6} + , + {0x115c1, 0x115d7} + , + {0x11641, 0x11643} + , + {0x1173c, 0x1173e} + , + {0x12470, 0x12474} + , + {0x16a6e, 0x16a6f} + , + {0x16af5, 0x16af5} + , + {0x16b37, 0x16b3b} + , + {0x16b44, 0x16b44} + , + {0x1bc9f, 0x1bc9f} + , + {0x1da87, 0x1da8b} }; scm_t_char_set cs_punctuation = { - 140, + 161, cs_punctuation_ranges }; @@ -6809,7 +7523,7 @@ scm_t_char_range cs_symbol_ranges[] = { , {0x0482, 0x0482} , - {0x058f, 0x058f} + {0x058d, 0x058f} , {0x0606, 0x0608} , @@ -6897,7 +7611,7 @@ scm_t_char_range cs_symbol_ranges[] = { , {0x208a, 0x208c} , - {0x20a0, 0x20ba} + {0x20a0, 0x20be} , {0x2100, 0x2101} , @@ -6927,9 +7641,13 @@ scm_t_char_range cs_symbol_ranges[] = { , {0x214f, 0x214f} , - {0x2190, 0x2328} + {0x218a, 0x218b} , - {0x232b, 0x23f3} + {0x2190, 0x2307} + , + {0x230c, 0x2328} + , + {0x232b, 0x23fa} , {0x2400, 0x2426} , @@ -6937,9 +7655,7 @@ scm_t_char_range cs_symbol_ranges[] = { , {0x249c, 0x24e9} , - {0x2500, 0x26ff} - , - {0x2701, 0x2767} + {0x2500, 0x2767} , {0x2794, 0x27c4} , @@ -6951,9 +7667,17 @@ scm_t_char_range cs_symbol_ranges[] = { , {0x29dc, 0x29fb} , - {0x29fe, 0x2b4c} + {0x29fe, 0x2b73} , - {0x2b50, 0x2b59} + {0x2b76, 0x2b95} + , + {0x2b98, 0x2bb9} + , + {0x2bbd, 0x2bc8} + , + {0x2bca, 0x2bd1} + , + {0x2bec, 0x2bef} , {0x2ce5, 0x2cea} , @@ -7013,6 +7737,8 @@ scm_t_char_range cs_symbol_ranges[] = { , {0xaa77, 0xaa79} , + {0xab5b, 0xab5b} + , {0xfb29, 0xfb29} , {0xfbb2, 0xfbc1} @@ -7049,10 +7775,26 @@ scm_t_char_range cs_symbol_ranges[] = { , {0x10179, 0x10189} , + {0x1018c, 0x1018c} + , {0x10190, 0x1019b} , + {0x101a0, 0x101a0} + , {0x101d0, 0x101fc} , + {0x10877, 0x10878} + , + {0x10ac8, 0x10ac8} + , + {0x1173f, 0x1173f} + , + {0x16b3c, 0x16b3f} + , + {0x16b45, 0x16b45} + , + {0x1bc9c, 0x1bc9c} + , {0x1d000, 0x1d0f5} , {0x1d100, 0x1d126} @@ -7065,7 +7807,7 @@ scm_t_char_range cs_symbol_ranges[] = { , {0x1d18c, 0x1d1a9} , - {0x1d1ae, 0x1d1dd} + {0x1d1ae, 0x1d1e8} , {0x1d200, 0x1d241} , @@ -7093,6 +7835,16 @@ scm_t_char_range cs_symbol_ranges[] = { , {0x1d7c3, 0x1d7c3} , + {0x1d800, 0x1d9ff} + , + {0x1da37, 0x1da3a} + , + {0x1da6d, 0x1da74} + , + {0x1da76, 0x1da83} + , + {0x1da85, 0x1da86} + , {0x1eef0, 0x1eef1} , {0x1f000, 0x1f02b} @@ -7101,11 +7853,11 @@ scm_t_char_range cs_symbol_ranges[] = { , {0x1f0a0, 0x1f0ae} , - {0x1f0b1, 0x1f0be} + {0x1f0b1, 0x1f0bf} , {0x1f0c1, 0x1f0cf} , - {0x1f0d1, 0x1f0df} + {0x1f0d1, 0x1f0f5} , {0x1f110, 0x1f12e} , @@ -7121,45 +7873,39 @@ scm_t_char_range cs_symbol_ranges[] = { , {0x1f250, 0x1f251} , - {0x1f300, 0x1f320} + {0x1f300, 0x1f579} , - {0x1f330, 0x1f335} + {0x1f57b, 0x1f5a3} , - {0x1f337, 0x1f37c} + {0x1f5a5, 0x1f6d0} , - {0x1f380, 0x1f393} + {0x1f6e0, 0x1f6ec} , - {0x1f3a0, 0x1f3c4} - , - {0x1f3c6, 0x1f3ca} - , - {0x1f3e0, 0x1f3f0} - , - {0x1f400, 0x1f43e} - , - {0x1f440, 0x1f440} - , - {0x1f442, 0x1f4f7} - , - {0x1f4f9, 0x1f4fc} - , - {0x1f500, 0x1f53d} - , - {0x1f540, 0x1f543} - , - {0x1f550, 0x1f567} - , - {0x1f5fb, 0x1f640} - , - {0x1f645, 0x1f64f} - , - {0x1f680, 0x1f6c5} + {0x1f6f0, 0x1f6f3} , {0x1f700, 0x1f773} + , + {0x1f780, 0x1f7d4} + , + {0x1f800, 0x1f80b} + , + {0x1f810, 0x1f847} + , + {0x1f850, 0x1f859} + , + {0x1f860, 0x1f887} + , + {0x1f890, 0x1f8ad} + , + {0x1f910, 0x1f918} + , + {0x1f980, 0x1f984} + , + {0x1f9c0, 0x1f9c0} }; scm_t_char_set cs_symbol = { - 198, + 214, cs_symbol_ranges }; @@ -7172,8 +7918,6 @@ scm_t_char_range cs_blank_ranges[] = { , {0x1680, 0x1680} , - {0x180e, 0x180e} - , {0x2000, 0x200a} , {0x202f, 0x202f} @@ -7184,7 +7928,7 @@ scm_t_char_range cs_blank_ranges[] = { }; scm_t_char_set cs_blank = { - 9, + 8, cs_blank_ranges }; @@ -7208,7 +7952,7 @@ scm_t_char_set cs_empty = { scm_t_char_range cs_designated_ranges[] = { {0x0000, 0x0377} , - {0x037a, 0x037e} + {0x037a, 0x037f} , {0x0384, 0x038a} , @@ -7216,7 +7960,7 @@ scm_t_char_range cs_designated_ranges[] = { , {0x038e, 0x03a1} , - {0x03a3, 0x0527} + {0x03a3, 0x052f} , {0x0531, 0x0556} , @@ -7226,7 +7970,7 @@ scm_t_char_range cs_designated_ranges[] = { , {0x0589, 0x058a} , - {0x058f, 0x058f} + {0x058d, 0x058f} , {0x0591, 0x05c7} , @@ -7234,9 +7978,7 @@ scm_t_char_range cs_designated_ranges[] = { , {0x05f0, 0x05f4} , - {0x0600, 0x0604} - , - {0x0606, 0x061b} + {0x0600, 0x061c} , {0x061e, 0x070d} , @@ -7254,17 +7996,9 @@ scm_t_char_range cs_designated_ranges[] = { , {0x085e, 0x085e} , - {0x08a0, 0x08a0} + {0x08a0, 0x08b4} , - {0x08a2, 0x08ac} - , - {0x08e4, 0x08fe} - , - {0x0900, 0x0977} - , - {0x0979, 0x097f} - , - {0x0981, 0x0983} + {0x08e3, 0x0983} , {0x0985, 0x098c} , @@ -7350,6 +8084,8 @@ scm_t_char_range cs_designated_ranges[] = { , {0x0ae6, 0x0af1} , + {0x0af9, 0x0af9} + , {0x0b01, 0x0b03} , {0x0b05, 0x0b0c} @@ -7410,7 +8146,7 @@ scm_t_char_range cs_designated_ranges[] = { , {0x0be6, 0x0bfa} , - {0x0c01, 0x0c03} + {0x0c00, 0x0c03} , {0x0c05, 0x0c0c} , @@ -7418,9 +8154,7 @@ scm_t_char_range cs_designated_ranges[] = { , {0x0c12, 0x0c28} , - {0x0c2a, 0x0c33} - , - {0x0c35, 0x0c39} + {0x0c2a, 0x0c39} , {0x0c3d, 0x0c44} , @@ -7430,7 +8164,7 @@ scm_t_char_range cs_designated_ranges[] = { , {0x0c55, 0x0c56} , - {0x0c58, 0x0c59} + {0x0c58, 0x0c5a} , {0x0c60, 0x0c63} , @@ -7438,7 +8172,7 @@ scm_t_char_range cs_designated_ranges[] = { , {0x0c78, 0x0c7f} , - {0x0c82, 0x0c83} + {0x0c81, 0x0c83} , {0x0c85, 0x0c8c} , @@ -7466,7 +8200,7 @@ scm_t_char_range cs_designated_ranges[] = { , {0x0cf1, 0x0cf2} , - {0x0d02, 0x0d03} + {0x0d01, 0x0d03} , {0x0d05, 0x0d0c} , @@ -7482,7 +8216,7 @@ scm_t_char_range cs_designated_ranges[] = { , {0x0d57, 0x0d57} , - {0x0d60, 0x0d63} + {0x0d5f, 0x0d63} , {0x0d66, 0x0d75} , @@ -7508,6 +8242,8 @@ scm_t_char_range cs_designated_ranges[] = { , {0x0dd8, 0x0ddf} , + {0x0de6, 0x0def} + , {0x0df2, 0x0df4} , {0x0e01, 0x0e3a} @@ -7604,11 +8340,13 @@ scm_t_char_range cs_designated_ranges[] = { , {0x1380, 0x1399} , - {0x13a0, 0x13f4} + {0x13a0, 0x13f5} + , + {0x13f8, 0x13fd} , {0x1400, 0x169c} , - {0x16a0, 0x16f0} + {0x16a0, 0x16f8} , {0x1700, 0x170c} , @@ -7640,7 +8378,7 @@ scm_t_char_range cs_designated_ranges[] = { , {0x18b0, 0x18f5} , - {0x1900, 0x191c} + {0x1900, 0x191e} , {0x1920, 0x192b} , @@ -7670,6 +8408,8 @@ scm_t_char_range cs_designated_ranges[] = { , {0x1aa0, 0x1aad} , + {0x1ab0, 0x1abe} + , {0x1b00, 0x1b4b} , {0x1b50, 0x1b7c} @@ -7686,7 +8426,9 @@ scm_t_char_range cs_designated_ranges[] = { , {0x1cd0, 0x1cf6} , - {0x1d00, 0x1de6} + {0x1cf8, 0x1cf9} + , + {0x1d00, 0x1df5} , {0x1dfc, 0x1f15} , @@ -7722,29 +8464,35 @@ scm_t_char_range cs_designated_ranges[] = { , {0x2000, 0x2064} , - {0x206a, 0x2071} + {0x2066, 0x2071} , {0x2074, 0x208e} , {0x2090, 0x209c} , - {0x20a0, 0x20ba} + {0x20a0, 0x20be} , {0x20d0, 0x20f0} , - {0x2100, 0x2189} + {0x2100, 0x218b} , - {0x2190, 0x23f3} + {0x2190, 0x23fa} , {0x2400, 0x2426} , {0x2440, 0x244a} , - {0x2460, 0x26ff} + {0x2460, 0x2b73} , - {0x2701, 0x2b4c} + {0x2b76, 0x2b95} , - {0x2b50, 0x2b59} + {0x2b98, 0x2bb9} + , + {0x2bbd, 0x2bc8} + , + {0x2bca, 0x2bd1} + , + {0x2bec, 0x2bef} , {0x2c00, 0x2c2e} , @@ -7780,7 +8528,7 @@ scm_t_char_range cs_designated_ranges[] = { , {0x2dd8, 0x2dde} , - {0x2de0, 0x2e3b} + {0x2de0, 0x2e42} , {0x2e80, 0x2e99} , @@ -7810,7 +8558,7 @@ scm_t_char_range cs_designated_ranges[] = { , {0x3300, 0x4db5} , - {0x4dc0, 0x9fcc} + {0x4dc0, 0x9fd5} , {0xa000, 0xa48c} , @@ -7818,17 +8566,13 @@ scm_t_char_range cs_designated_ranges[] = { , {0xa4d0, 0xa62b} , - {0xa640, 0xa697} + {0xa640, 0xa6f7} , - {0xa69f, 0xa6f7} + {0xa700, 0xa7ad} , - {0xa700, 0xa78e} + {0xa7b0, 0xa7b7} , - {0xa790, 0xa793} - , - {0xa7a0, 0xa7aa} - , - {0xa7f8, 0xa82b} + {0xa7f7, 0xa82b} , {0xa830, 0xa839} , @@ -7838,7 +8582,7 @@ scm_t_char_range cs_designated_ranges[] = { , {0xa8ce, 0xa8d9} , - {0xa8e0, 0xa8fb} + {0xa8e0, 0xa8fd} , {0xa900, 0xa953} , @@ -7848,7 +8592,7 @@ scm_t_char_range cs_designated_ranges[] = { , {0xa9cf, 0xa9d9} , - {0xa9de, 0xa9df} + {0xa9de, 0xa9fe} , {0xaa00, 0xaa36} , @@ -7856,9 +8600,7 @@ scm_t_char_range cs_designated_ranges[] = { , {0xaa50, 0xaa59} , - {0xaa5c, 0xaa7b} - , - {0xaa80, 0xaac2} + {0xaa5c, 0xaac2} , {0xaadb, 0xaaf6} , @@ -7872,7 +8614,9 @@ scm_t_char_range cs_designated_ranges[] = { , {0xab28, 0xab2e} , - {0xabc0, 0xabed} + {0xab30, 0xab65} + , + {0xab70, 0xabed} , {0xabf0, 0xabf9} , @@ -7912,9 +8656,7 @@ scm_t_char_range cs_designated_ranges[] = { , {0xfe00, 0xfe19} , - {0xfe20, 0xfe26} - , - {0xfe30, 0xfe52} + {0xfe20, 0xfe52} , {0xfe54, 0xfe66} , @@ -7960,22 +8702,26 @@ scm_t_char_range cs_designated_ranges[] = { , {0x10107, 0x10133} , - {0x10137, 0x1018a} + {0x10137, 0x1018c} , {0x10190, 0x1019b} , + {0x101a0, 0x101a0} + , {0x101d0, 0x101fd} , {0x10280, 0x1029c} , {0x102a0, 0x102d0} , - {0x10300, 0x1031e} + {0x102e0, 0x102fb} , - {0x10320, 0x10323} + {0x10300, 0x10323} , {0x10330, 0x1034a} , + {0x10350, 0x1037a} + , {0x10380, 0x1039d} , {0x1039f, 0x103c3} @@ -7986,6 +8732,18 @@ scm_t_char_range cs_designated_ranges[] = { , {0x104a0, 0x104a9} , + {0x10500, 0x10527} + , + {0x10530, 0x10563} + , + {0x1056f, 0x1056f} + , + {0x10600, 0x10736} + , + {0x10740, 0x10755} + , + {0x10760, 0x10767} + , {0x10800, 0x10805} , {0x10808, 0x10808} @@ -7998,9 +8756,15 @@ scm_t_char_range cs_designated_ranges[] = { , {0x1083f, 0x10855} , - {0x10857, 0x1085f} + {0x10857, 0x1089e} , - {0x10900, 0x1091b} + {0x108a7, 0x108af} + , + {0x108e0, 0x108f2} + , + {0x108f4, 0x108f5} + , + {0x108fb, 0x1091b} , {0x1091f, 0x10939} , @@ -8008,9 +8772,9 @@ scm_t_char_range cs_designated_ranges[] = { , {0x10980, 0x109b7} , - {0x109be, 0x109bf} + {0x109bc, 0x109cf} , - {0x10a00, 0x10a03} + {0x109d2, 0x10a03} , {0x10a05, 0x10a06} , @@ -8026,7 +8790,11 @@ scm_t_char_range cs_designated_ranges[] = { , {0x10a50, 0x10a58} , - {0x10a60, 0x10a7f} + {0x10a60, 0x10a9f} + , + {0x10ac0, 0x10ae6} + , + {0x10aeb, 0x10af6} , {0x10b00, 0x10b35} , @@ -8034,17 +8802,27 @@ scm_t_char_range cs_designated_ranges[] = { , {0x10b58, 0x10b72} , - {0x10b78, 0x10b7f} + {0x10b78, 0x10b91} + , + {0x10b99, 0x10b9c} + , + {0x10ba9, 0x10baf} , {0x10c00, 0x10c48} , + {0x10c80, 0x10cb2} + , + {0x10cc0, 0x10cf2} + , + {0x10cfa, 0x10cff} + , {0x10e60, 0x10e7e} , {0x11000, 0x1104d} , {0x11052, 0x1106f} , - {0x11080, 0x110c1} + {0x1107f, 0x110c1} , {0x110d0, 0x110e8} , @@ -8054,24 +8832,124 @@ scm_t_char_range cs_designated_ranges[] = { , {0x11136, 0x11143} , - {0x11180, 0x111c8} + {0x11150, 0x11176} , - {0x111d0, 0x111d9} + {0x11180, 0x111cd} + , + {0x111d0, 0x111df} + , + {0x111e1, 0x111f4} + , + {0x11200, 0x11211} + , + {0x11213, 0x1123d} + , + {0x11280, 0x11286} + , + {0x11288, 0x11288} + , + {0x1128a, 0x1128d} + , + {0x1128f, 0x1129d} + , + {0x1129f, 0x112a9} + , + {0x112b0, 0x112ea} + , + {0x112f0, 0x112f9} + , + {0x11300, 0x11303} + , + {0x11305, 0x1130c} + , + {0x1130f, 0x11310} + , + {0x11313, 0x11328} + , + {0x1132a, 0x11330} + , + {0x11332, 0x11333} + , + {0x11335, 0x11339} + , + {0x1133c, 0x11344} + , + {0x11347, 0x11348} + , + {0x1134b, 0x1134d} + , + {0x11350, 0x11350} + , + {0x11357, 0x11357} + , + {0x1135d, 0x11363} + , + {0x11366, 0x1136c} + , + {0x11370, 0x11374} + , + {0x11480, 0x114c7} + , + {0x114d0, 0x114d9} + , + {0x11580, 0x115b5} + , + {0x115b8, 0x115dd} + , + {0x11600, 0x11644} + , + {0x11650, 0x11659} , {0x11680, 0x116b7} , {0x116c0, 0x116c9} , - {0x12000, 0x1236e} + {0x11700, 0x11719} , - {0x12400, 0x12462} + {0x1171d, 0x1172b} , - {0x12470, 0x12473} + {0x11730, 0x1173f} + , + {0x118a0, 0x118f2} + , + {0x118ff, 0x118ff} + , + {0x11ac0, 0x11af8} + , + {0x12000, 0x12399} + , + {0x12400, 0x1246e} + , + {0x12470, 0x12474} + , + {0x12480, 0x12543} , {0x13000, 0x1342e} , + {0x14400, 0x14646} + , {0x16800, 0x16a38} , + {0x16a40, 0x16a5e} + , + {0x16a60, 0x16a69} + , + {0x16a6e, 0x16a6f} + , + {0x16ad0, 0x16aed} + , + {0x16af0, 0x16af5} + , + {0x16b00, 0x16b45} + , + {0x16b50, 0x16b59} + , + {0x16b5b, 0x16b61} + , + {0x16b63, 0x16b77} + , + {0x16b7d, 0x16b8f} + , {0x16f00, 0x16f44} , {0x16f50, 0x16f7e} @@ -8080,11 +8958,21 @@ scm_t_char_range cs_designated_ranges[] = { , {0x1b000, 0x1b001} , + {0x1bc00, 0x1bc6a} + , + {0x1bc70, 0x1bc7c} + , + {0x1bc80, 0x1bc88} + , + {0x1bc90, 0x1bc99} + , + {0x1bc9c, 0x1bca3} + , {0x1d000, 0x1d0f5} , {0x1d100, 0x1d126} , - {0x1d129, 0x1d1dd} + {0x1d129, 0x1d1e8} , {0x1d200, 0x1d245} , @@ -8132,7 +9020,15 @@ scm_t_char_range cs_designated_ranges[] = { , {0x1d6a8, 0x1d7cb} , - {0x1d7ce, 0x1d7ff} + {0x1d7ce, 0x1da8b} + , + {0x1da9b, 0x1da9f} + , + {0x1daa1, 0x1daaf} + , + {0x1e800, 0x1e8c4} + , + {0x1e8c7, 0x1e8d6} , {0x1ee00, 0x1ee03} , @@ -8208,13 +9104,13 @@ scm_t_char_range cs_designated_ranges[] = { , {0x1f0a0, 0x1f0ae} , - {0x1f0b1, 0x1f0be} + {0x1f0b1, 0x1f0bf} , {0x1f0c1, 0x1f0cf} , - {0x1f0d1, 0x1f0df} + {0x1f0d1, 0x1f0f5} , - {0x1f100, 0x1f10a} + {0x1f100, 0x1f10c} , {0x1f110, 0x1f12e} , @@ -8230,48 +9126,44 @@ scm_t_char_range cs_designated_ranges[] = { , {0x1f250, 0x1f251} , - {0x1f300, 0x1f320} + {0x1f300, 0x1f579} , - {0x1f330, 0x1f335} + {0x1f57b, 0x1f5a3} , - {0x1f337, 0x1f37c} + {0x1f5a5, 0x1f6d0} , - {0x1f380, 0x1f393} + {0x1f6e0, 0x1f6ec} , - {0x1f3a0, 0x1f3c4} - , - {0x1f3c6, 0x1f3ca} - , - {0x1f3e0, 0x1f3f0} - , - {0x1f400, 0x1f43e} - , - {0x1f440, 0x1f440} - , - {0x1f442, 0x1f4f7} - , - {0x1f4f9, 0x1f4fc} - , - {0x1f500, 0x1f53d} - , - {0x1f540, 0x1f543} - , - {0x1f550, 0x1f567} - , - {0x1f5fb, 0x1f640} - , - {0x1f645, 0x1f64f} - , - {0x1f680, 0x1f6c5} + {0x1f6f0, 0x1f6f3} , {0x1f700, 0x1f773} , + {0x1f780, 0x1f7d4} + , + {0x1f800, 0x1f80b} + , + {0x1f810, 0x1f847} + , + {0x1f850, 0x1f859} + , + {0x1f860, 0x1f887} + , + {0x1f890, 0x1f8ad} + , + {0x1f910, 0x1f918} + , + {0x1f980, 0x1f984} + , + {0x1f9c0, 0x1f9c0} + , {0x20000, 0x2a6d6} , {0x2a700, 0x2b734} , {0x2b740, 0x2b81d} , + {0x2b820, 0x2cea1} + , {0x2f800, 0x2fa1d} , {0xe0001, 0xe0001} @@ -8286,6 +9178,6 @@ scm_t_char_range cs_designated_ranges[] = { }; scm_t_char_set cs_designated = { - 539, + 613, cs_designated_ranges }; From 7d7e4bc6c0e9a109eafc68ae7e5494f6a1dcaab9 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Fri, 13 Nov 2015 11:38:13 -0500 Subject: [PATCH 38/46] Fix getsockopt/setsockopt handling of SO_SNDBUF/SO_RCVBUF options. Reported by Park SungMin in . * libguile/socket.c (scm_getsockopt, scm_setsockopt): Remove code that incorrectly assumed that the argument for SO_SNDBUF and SO_RCVBUF options was of type 'size_t'. Both the Linux and POSIX documentation indicates that the argument is of type 'int', as is the case for most options. --- libguile/socket.c | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/libguile/socket.c b/libguile/socket.c index 2a9be5471..a6f1e5fca 100644 --- a/libguile/socket.c +++ b/libguile/socket.c @@ -1,5 +1,5 @@ -/* Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, - * 2006, 2007, 2009, 2011, 2012, 2013, 2014 Free Software Foundation, Inc. +/* Copyright (C) 1996-1998, 2000-2007, 2009, 2011-2015 + * 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 @@ -508,19 +508,7 @@ SCM_DEFINE (scm_getsockopt, "getsockopt", 3, 0, 0, scm_from_int (0)); #endif } - else #endif - if (0 -#ifdef SO_SNDBUF - || ioptname == SO_SNDBUF -#endif -#ifdef SO_RCVBUF - || ioptname == SO_RCVBUF -#endif - ) - { - return scm_from_size_t (*(size_t *) &optval); - } } return scm_from_int (*(int *) &optval); } @@ -649,21 +637,7 @@ SCM_DEFINE (scm_setsockopt, "setsockopt", 4, 0, 0, optval = &opt_int; #endif } - else #endif - if (0 -#ifdef SO_SNDBUF - || ioptname == SO_SNDBUF -#endif -#ifdef SO_RCVBUF - || ioptname == SO_RCVBUF -#endif - ) - { - opt_int = scm_to_int (value); - optlen = sizeof (size_t); - optval = &opt_int; - } } #ifdef HAVE_STRUCT_IP_MREQ From 95d146ff51741df1673ec650ff3774a99c72bbf3 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sat, 28 Nov 2015 12:38:16 -0500 Subject: [PATCH 39/46] Bump user-visible copyright years to 2015. * module/ice-9/command-line.scm (version-etc): Bump 'copyright-year' to 2015. * module/system/repl/common.scm (*version*): Add 2015 to the range of copyright years. --- module/ice-9/command-line.scm | 2 +- module/system/repl/common.scm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/ice-9/command-line.scm b/module/ice-9/command-line.scm index 0d2f3d601..83f301d92 100644 --- a/module/ice-9/command-line.scm +++ b/module/ice-9/command-line.scm @@ -66,7 +66,7 @@ There is NO WARRANTY, to the extent permitted by law.")) (define* (version-etc package version #:key (port (current-output-port)) ;; FIXME: authors - (copyright-year 2014) + (copyright-year 2015) (copyright-holder "Free Software Foundation, Inc.") (copyright (format #f "Copyright (C) ~a ~a" copyright-year copyright-holder)) diff --git a/module/system/repl/common.scm b/module/system/repl/common.scm index f0e6e03a0..3df7852bd 100644 --- a/module/system/repl/common.scm +++ b/module/system/repl/common.scm @@ -41,7 +41,7 @@ (define *version* (format #f "GNU Guile ~A -Copyright (C) 1995-2014 Free Software Foundation, Inc. +Copyright (C) 1995-2015 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it From 3829047ec78d8001bf559fd0fb8ceae100f77e8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 6 Jan 2016 15:06:52 +0100 Subject: [PATCH 40/46] http: Test that responses lacking CR/LF are rejected. * test-suite/tests/web-http.test ("read-response-line")["missing CR/LF"]: New test. --- test-suite/tests/web-http.test | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test-suite/tests/web-http.test b/test-suite/tests/web-http.test index bd14de9b9..de2ccaa5b 100644 --- a/test-suite/tests/web-http.test +++ b/test-suite/tests/web-http.test @@ -186,6 +186,11 @@ (1 . 1))) (with-test-prefix "read-response-line" + (pass-if-exception "missing CR/LF" + `(bad-header . "") + (call-with-input-string "HTTP/1.1 200 Almost okay" + (lambda (port) + (read-response-line port)))) (pass-if-read-response-line "HTTP/1.0 404 Not Found" (1 . 0) 404 "Not Found") (pass-if-read-response-line "HTTP/1.1 200 OK" From f53145d41cbf6908959e230dc53cfccf38d92380 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 6 Jan 2016 14:56:00 +0100 Subject: [PATCH 41/46] http: Accept empty reason phrases. Fixes . Reported by Ricardo Wurmus . * module/web/http.scm (read-header-line): New procedure. (read-response-line): Use it instead of 'read-line*'. * test-suite/tests/web-http.test ("read-response-line"): Add test. --- module/web/http.scm | 25 ++++++++++++++++++++----- test-suite/tests/web-http.test | 6 +++++- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/module/web/http.scm b/module/web/http.scm index 5ce7e7c67..f46c384ce 100644 --- a/module/web/http.scm +++ b/module/web/http.scm @@ -144,7 +144,22 @@ The default writer is ‘display’." (header-decl-writer decl) display))) -(define (read-line* port) +(define (read-header-line port) + "Read an HTTP header line and return it without its final CRLF or LF. +Raise a 'bad-header' exception if the line does not end in CRLF or LF, +or if EOF is reached." + (match (%read-line port) + (((? string? line) . #\newline) + ;; '%read-line' does not consider #\return a delimiter; so if it's + ;; there, remove it. We are more tolerant than the RFC in that we + ;; tolerate LF-only endings. + (if (string-suffix? "\r" line) + (string-drop-right line 1) + line)) + ((line . _) ;EOF or missing delimiter + (bad-header 'read-header-line line)))) + +(define* (read-line* port) (let* ((pair (%read-line port)) (line (car pair)) (delim (cdr pair))) @@ -1155,10 +1170,10 @@ three values: the method, the URI, and the version." (display "\r\n" port)) (define (read-response-line port) - "Read the first line of an HTTP response from PORT, returning -three values: the HTTP version, the response code, and the \"reason -phrase\"." - (let* ((line (read-line* port)) + "Read the first line of an HTTP response from PORT, returning three +values: the HTTP version, the response code, and the (possibly empty) +\"reason phrase\"." + (let* ((line (read-header-line port)) (d0 (string-index line char-set:whitespace)) ; "delimiter zero" (d1 (and d0 (string-index line char-set:whitespace (skip-whitespace line d0))))) diff --git a/test-suite/tests/web-http.test b/test-suite/tests/web-http.test index de2ccaa5b..f88f011a6 100644 --- a/test-suite/tests/web-http.test +++ b/test-suite/tests/web-http.test @@ -194,7 +194,11 @@ (pass-if-read-response-line "HTTP/1.0 404 Not Found" (1 . 0) 404 "Not Found") (pass-if-read-response-line "HTTP/1.1 200 OK" - (1 . 1) 200 "OK")) + (1 . 1) 200 "OK") + + ;; Empty reason phrases are valid; see . + (pass-if-read-response-line "HTTP/1.1 302 " + (1 . 1) 302 "")) (with-test-prefix "write-response-line" (pass-if-write-response-line "HTTP/1.0 404 Not Found" From 66bc464542808a7038662f0a4ea932f3eabcf2ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 6 Jan 2016 17:15:20 +0100 Subject: [PATCH 42/46] http: Use 'read-header-line' instead of 'read-line*'. * module/web/http.scm (read-line*): Remove. (read-continuation-line, read-header, read-request-line): Use 'read-header-line' instead of 'read-line*'. --- module/web/http.scm | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/module/web/http.scm b/module/web/http.scm index f46c384ce..0bcd9058b 100644 --- a/module/web/http.scm +++ b/module/web/http.scm @@ -159,28 +159,12 @@ or if EOF is reached." ((line . _) ;EOF or missing delimiter (bad-header 'read-header-line line)))) -(define* (read-line* port) - (let* ((pair (%read-line port)) - (line (car pair)) - (delim (cdr pair))) - (if (and (string? line) (char? delim)) - (let ((orig-len (string-length line))) - (let lp ((len orig-len)) - (if (and (> len 0) - (char-whitespace? (string-ref line (1- len)))) - (lp (1- len)) - (if (= len orig-len) - line - (substring line 0 len))))) - (bad-header '%read line)))) - (define (read-continuation-line port val) (if (or (eqv? (peek-char port) #\space) (eqv? (peek-char port) #\tab)) (read-continuation-line port (string-append val - (begin - (read-line* port)))) + (read-header-line port))) val)) (define *eof* (call-with-input-string "" read)) @@ -192,7 +176,7 @@ was known but the value was invalid. Returns the end-of-file object for both values if the end of the message body was reached (i.e., a blank line)." - (let ((line (read-line* port))) + (let ((line (read-header-line port))) (if (or (string-null? line) (string=? line "\r")) (values *eof* *eof*) @@ -1101,7 +1085,7 @@ not have to have a scheme or host name. The result is a URI object." (define (read-request-line port) "Read the first line of an HTTP request from PORT, returning three values: the method, the URI, and the version." - (let* ((line (read-line* port)) + (let* ((line (read-header-line port)) (d0 (string-index line char-set:whitespace)) ; "delimiter zero" (d1 (string-rindex line char-set:whitespace))) (if (and d0 d1 (< d0 d1)) From 994b7d70e6063e83f2c6d933c0f979aa77130a94 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Wed, 6 Jan 2016 16:39:13 -0500 Subject: [PATCH 43/46] SRFI-19: Update the table of leap seconds. * module/srfi/srfi-19.scm (leap-second-table): Update to include the most recent leap second. --- module/srfi/srfi-19.scm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/module/srfi/srfi-19.scm b/module/srfi/srfi-19.scm index 6d86ee638..658ccd915 100644 --- a/module/srfi/srfi-19.scm +++ b/module/srfi/srfi-19.scm @@ -1,7 +1,7 @@ ;;; srfi-19.scm --- Time/Date Library -;; Copyright (C) 2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2010, -;; 2011, 2014 Free Software Foundation, Inc. +;; Copyright (C) 2001-2003, 2005-2011, 2014, 2016 +;; 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 @@ -203,7 +203,8 @@ ;; each entry is (tai seconds since epoch . # seconds to subtract for utc) ;; note they go higher to lower, and end in 1972. (define leap-second-table - '((1341100800 . 35) + '((1435708800 . 36) + (1341100800 . 35) (1230768000 . 34) (1136073600 . 33) (915148800 . 32) From 140496cc00736f61d5c8710207288cd9c7acd975 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 5 Jan 2016 16:33:25 -0500 Subject: [PATCH 44/46] Bump user-visible copyright years to 2016. * doc/ref/guile.texi: Add 2016 to user-visible copyright notice. * module/ice-9/command-line.scm (version-etc): Bump 'copyright-year' to 2016. * module/system/repl/common.scm (*version*): Add 2016 to the range of copyright years. --- doc/ref/guile.texi | 2 +- module/ice-9/command-line.scm | 4 ++-- module/system/repl/common.scm | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/doc/ref/guile.texi b/doc/ref/guile.texi index cb4c431f2..0ab536b27 100644 --- a/doc/ref/guile.texi +++ b/doc/ref/guile.texi @@ -14,7 +14,7 @@ This manual documents Guile version @value{VERSION}. Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005, 2009, -2010, 2011, 2012, 2013, 2014, 2015 Free Software Foundation. +2010, 2011, 2012, 2013, 2014, 2015, 2016 Free Software Foundation. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or diff --git a/module/ice-9/command-line.scm b/module/ice-9/command-line.scm index 83f301d92..98d385569 100644 --- a/module/ice-9/command-line.scm +++ b/module/ice-9/command-line.scm @@ -1,6 +1,6 @@ ;;; Parsing Guile's command-line -;;; Copyright (C) 1994-1998, 2000-2015 Free Software Foundation, Inc. +;;; Copyright (C) 1994-1998, 2000-2016 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 @@ -66,7 +66,7 @@ There is NO WARRANTY, to the extent permitted by law.")) (define* (version-etc package version #:key (port (current-output-port)) ;; FIXME: authors - (copyright-year 2015) + (copyright-year 2016) (copyright-holder "Free Software Foundation, Inc.") (copyright (format #f "Copyright (C) ~a ~a" copyright-year copyright-holder)) diff --git a/module/system/repl/common.scm b/module/system/repl/common.scm index 3df7852bd..3bd049159 100644 --- a/module/system/repl/common.scm +++ b/module/system/repl/common.scm @@ -1,7 +1,6 @@ ;;; Repl common routines -;; Copyright (C) 2001, 2008, 2009, 2010, 2011, 2012, -;; 2013, 2014 Free Software Foundation, Inc. +;; Copyright (C) 2001, 2008-2016 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 @@ -41,7 +40,7 @@ (define *version* (format #f "GNU Guile ~A -Copyright (C) 1995-2015 Free Software Foundation, Inc. +Copyright (C) 1995-2016 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it From b9f6e89a271c04741231b64b03fe7fc294723f1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sun, 8 May 2016 21:52:33 +0200 Subject: [PATCH 45/46] http: Accept date strings with a leading space for hours. Fixes . Reported by Ricardo Wurmus . * module/web/http.scm (parse-rfc-822-date): Add two clauses for hours with a leading space. * test-suite/tests/web-http.test ("general headers"): Add two tests. --- module/web/http.scm | 20 ++++++++++++++++++++ test-suite/tests/web-http.test | 10 ++++++++++ 2 files changed, 30 insertions(+) diff --git a/module/web/http.scm b/module/web/http.scm index 0bcd9058b..8e95fc755 100644 --- a/module/web/http.scm +++ b/module/web/http.scm @@ -751,6 +751,26 @@ as an ordered alist." (minute (parse-non-negative-integer str 19 21)) (second (parse-non-negative-integer str 22 24))) (make-date 0 second minute hour date month year zone-offset))) + + ;; The next two clauses match dates that have a space instead of + ;; a leading zero for hours, like " 8:49:37". + ((string-match? (substring str 0 space) "aaa, dd aaa dddd d:dd:dd") + (let ((date (parse-non-negative-integer str 5 7)) + (month (parse-month str 8 11)) + (year (parse-non-negative-integer str 12 16)) + (hour (parse-non-negative-integer str 18 19)) + (minute (parse-non-negative-integer str 20 22)) + (second (parse-non-negative-integer str 23 25))) + (make-date 0 second minute hour date month year zone-offset))) + ((string-match? (substring str 0 space) "aaa, d aaa dddd d:dd:dd") + (let ((date (parse-non-negative-integer str 5 6)) + (month (parse-month str 7 10)) + (year (parse-non-negative-integer str 11 15)) + (hour (parse-non-negative-integer str 17 18)) + (minute (parse-non-negative-integer str 19 21)) + (second (parse-non-negative-integer str 22 24))) + (make-date 0 second minute hour date month year zone-offset))) + (else (bad-header 'date str) ; prevent tail call #f))) diff --git a/test-suite/tests/web-http.test b/test-suite/tests/web-http.test index f88f011a6..3fda4f9fb 100644 --- a/test-suite/tests/web-http.test +++ b/test-suite/tests/web-http.test @@ -236,6 +236,16 @@ (pass-if-parse date "Wed, 7 Sep 2011 11:25:00 GMT" (string->date "Wed, 7 Sep 2011 11:25:00 +0000" "~a,~e ~b ~Y ~H:~M:~S ~z")) + + ;; This is a non-conforming date (lack of leading zero for the hours) + ;; that some HTTP servers provide. See . + (pass-if-parse date "Sun, 06 Nov 1994 8:49:37 GMT" + (string->date "Sun, 6 Nov 1994 08:49:37 +0000" + "~a,~e ~b ~Y ~H:~M:~S ~z")) + (pass-if-parse date "Sun, 6 Nov 1994 8:49:37 GMT" + (string->date "Sun, 6 Nov 1994 08:49:37 +0000" + "~a,~e ~b ~Y ~H:~M:~S ~z")) + (pass-if-parse-error date "Tue, 15 Nov 1994 08:12:31 EST" date) (pass-if-any-error date "Tue, 15 Qux 1994 08:12:31 EST") From a7d0a0de2fa5fd99f001b1c6d42c0ae497a2cb1f Mon Sep 17 00:00:00 2001 From: Luribert Date: Thu, 21 Apr 2016 18:56:58 +0200 Subject: [PATCH 46/46] doc: Fix typo in Web documentation. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc/ref/web.texi (Http Headers): Fixed typo. Signed-off-by: Ludovic Courtès --- doc/ref/web.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/ref/web.texi b/doc/ref/web.texi index 2311b8225..b078929e4 100644 --- a/doc/ref/web.texi +++ b/doc/ref/web.texi @@ -747,9 +747,9 @@ a resource. @deftypevr {HTTP Header} List content-type The MIME type of a resource, as a symbol, along with any parameters. @example -(parse-header 'content-length "text/plain") +(parse-header 'content-type "text/plain") @result{} (text/plain) -(parse-header 'content-length "text/plain;charset=utf-8") +(parse-header 'content-type "text/plain;charset=utf-8") @result{} (text/plain (charset . "utf-8")) @end example Note that the @code{charset} parameter is something is a misnomer, and