guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, branch_release-1-8, updated. release_1


From: Ludovic Courtès
Subject: [Guile-commits] GNU Guile branch, branch_release-1-8, updated. release_1-8-6-50-g4a19803
Date: Mon, 11 May 2009 22:12:36 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=4a198038b9432f056b24a6d325f21ccac5eb37cc

The branch, branch_release-1-8 has been updated
       via  4a198038b9432f056b24a6d325f21ccac5eb37cc (commit)
       via  93c0c7565893b54edee62f54c1ff5f46ddced311 (commit)
      from  1011599792302b356195663a3efd68a234c11f69 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 4a198038b9432f056b24a6d325f21ccac5eb37cc
Author: Ludovic Courtès <address@hidden>
Date:   Tue May 12 00:12:18 2009 +0200

    Update `NEWS'.

commit 93c0c7565893b54edee62f54c1ff5f46ddced311
Author: Michael Gran <address@hidden>
Date:   Fri Apr 24 22:23:13 2009 -0700

    Symbols longer than 128 chars can cause an exception.  Also, the 
terminating colon of long postfix keywords are not handled correctly.
    
        * test-suite/tests/reader.test ("read-options"): Add test
        for long postfix keywords.
    
        * libguile/read.c (scm_read_mixed_case_symbol): Fix
        exception on symbols are greater than 128 chars.  Also,
        colons are not stripped from long postfix keywords.

-----------------------------------------------------------------------

Summary of changes:
 NEWS                         |    1 +
 libguile/read.c              |   15 ++++++++++++---
 test-suite/tests/reader.test |    5 +++++
 3 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/NEWS b/NEWS
index b941dfe..514e978 100644
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,7 @@ Changes in 1.8.7 (since 1.8.6)
 ** More build fixes for `alphaev56-dec-osf5.1b' (Tru64)
 ** With GCC, always compile with `-mieee' on `alpha*' and `sh*'
 ** Better diagnose broken `(strftime "%z" ...)' in `time.test' (bug #24130)
+** Fix parsing of SRFI-88/postfix keywords longer than 128 characters
 
 ** Allow @ macro to work with (ice-9 syncase)
 
diff --git a/libguile/read.c b/libguile/read.c
index ff50735..17c0534 100644
--- a/libguile/read.c
+++ b/libguile/read.c
@@ -582,12 +582,21 @@ scm_read_mixed_case_symbol (int chr, SCM port)
 
   if (scm_is_pair (str))
     {
+      size_t len;
+
       str = scm_string_concatenate (scm_reverse_x (str, SCM_EOL));
-      result = scm_string_to_symbol (str);
+      len = scm_c_string_length (str);
 
       /* Per SRFI-88, `:' alone is an identifier, not a keyword.  */
-      if (postfix && ends_with_colon && (scm_c_string_length (result) > 1))
-       result = scm_symbol_to_keyword (result);
+      if (postfix && ends_with_colon && (len > 1))
+       {
+         /* Strip off colon.  */
+         str = scm_c_substring (str, 0, len-1);
+         result = scm_string_to_symbol (str);
+         result = scm_symbol_to_keyword (result);
+       }
+      else
+       result = scm_string_to_symbol (str);
     }
   else
     {
diff --git a/test-suite/tests/reader.test b/test-suite/tests/reader.test
index b068c71..0b6f9a4 100644
--- a/test-suite/tests/reader.test
+++ b/test-suite/tests/reader.test
@@ -165,6 +165,11 @@
          (with-read-options '(keywords postfix)
            (lambda ()
              (read-string "keyword:")))))
+  (pass-if "long postfix keywords"
+    (eq? 
#:keyword0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+         (with-read-options '(keywords postfix)
+           (lambda ()
+             (read-string 
"keyword0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789:")))))
   (pass-if "`:' is not a postfix keyword (per SRFI-88)"
     (eq? ':
          (with-read-options '(keywords postfix)


hooks/post-receive
-- 
GNU Guile




reply via email to

[Prev in Thread] Current Thread [Next in Thread]