guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.0-50-g58b1db


From: Ludovic Courtès
Subject: [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.0-50-g58b1db5
Date: Mon, 28 Feb 2011 22:59:47 +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=58b1db5f2437327e0d44cfe799ca8e21e27d5b5e

The branch, stable-2.0 has been updated
       via  58b1db5f2437327e0d44cfe799ca8e21e27d5b5e (commit)
      from  ac012a27a2e3c28f191d2c38b3d1ab1ef70ba8ba (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 58b1db5f2437327e0d44cfe799ca8e21e27d5b5e
Author: Ludovic Courtès <address@hidden>
Date:   Mon Feb 28 23:33:47 2011 +0100

    Have `read' update line/column numbers when reading SCSH block comments.
    
    * libguile/read.c (scm_read_scsh_block_comment): Use `scm_getc' instead
      of `scm_get_byte_or_eof'.
    
    * test-suite/tests/reader.test ("read-options")["position of SCSH block
      comment"]: New test.

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

Summary of changes:
 libguile/read.c              |    6 +-----
 test-suite/tests/reader.test |   11 +++++++++++
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/libguile/read.c b/libguile/read.c
index 5f0be31..4057e4f 100644
--- a/libguile/read.c
+++ b/libguile/read.c
@@ -1116,13 +1116,9 @@ scm_read_scsh_block_comment (scm_t_wchar chr, SCM port)
 {
   int bang_seen = 0;
 
-  /* We can use the get_byte here because there is no need to get the
-     locale correct when reading comments. This presumes that 
-     hash and exclamation points always represent themselves no
-     matter what the source encoding is.*/
   for (;;)
     {
-      int c = scm_get_byte_or_eof (port);
+      int c = scm_getc (port);
 
       if (c == EOF)
        scm_i_input_error ("skip_block_comment", port,
diff --git a/test-suite/tests/reader.test b/test-suite/tests/reader.test
index 13c8526..1d6cc41 100644
--- a/test-suite/tests/reader.test
+++ b/test-suite/tests/reader.test
@@ -253,6 +253,14 @@
                     (read-string "'abcde")))))
       (and (equal? (source-property sexp 'line) 0)
            (equal? (source-property sexp 'column) 0))))
+  (pass-if "position of SCSH block comment"
+    ;; In Guile 2.0.0 the reader would not update the port's position
+    ;; when reading an SCSH block comment.
+    (let ((sexp (with-read-options '(positions)
+                  (lambda ()
+                    (read-string "#!foo\nbar\nbaz\n!#\n(hello world)\n")))))
+      (= 4 (source-property sexp 'line))))
+
   (with-test-prefix "r6rs-hex-escapes"
       (pass-if-exception "non-hex char in two-digit hex-escape"
       exception:illegal-escape
@@ -417,3 +425,6 @@
      ("#,@foo" . (unsyntax-splicing foo)))))
 
 
+;;; Local Variables:
+;;; eval: (put 'with-read-options 'scheme-indent-function 1)
+;;; End:


hooks/post-receive
-- 
GNU Guile



reply via email to

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