diff --git a/ChangeLog b/ChangeLog index d8bb49373..794f77561 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-08-23 Ludovic Courtès + + * NEWS: Mention Solaris bug fixes. + 2007-08-11 Ludovic Courtès * NEWS: Mention SRFI-35 and the new reader. diff --git a/NEWS b/NEWS index 7e377b570..b6e030e25 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,7 @@ Changes in 1.8.3 (since 1.8.2) * Bugs fixed ** Expressions like "(set! 'x #t)" no longer yield a crash +** Build problems on Solaris fixed * Implementation improvements diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 7e551796e..3c6041966 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,10 @@ +2007-08-23 Ludovic Courtès + + * read.c (scm_read_quote): Record position and copy source + expression when asked to. Reported by Kevin Ryde. + + * stime.c: Define `_REENTRANT' only if not already defined. + 2007-08-21 Kevin Ryde * gc-card.c (scm_i_card_statistics): Record scm_tc7_number types as diff --git a/libguile/read.c b/libguile/read.c index 73e42a1f6..4439b2052 100644 --- a/libguile/read.c +++ b/libguile/read.c @@ -636,6 +636,8 @@ static SCM scm_read_quote (int chr, SCM port) { SCM p; + long line = SCM_LINUM (port); + int column = SCM_COL (port) - 1; switch (chr) { @@ -669,6 +671,17 @@ scm_read_quote (int chr, SCM port) } p = scm_cons2 (p, scm_read_expression (port), SCM_EOL); + if (SCM_RECORD_POSITIONS_P) + scm_whash_insert (scm_source_whash, p, + scm_make_srcprops (line, column, + SCM_FILENAME (port), + SCM_COPY_SOURCE_P + ? (scm_cons2 (SCM_CAR (p), + SCM_CAR (SCM_CDR (p)), + SCM_EOL)) + : SCM_UNDEFINED, + SCM_EOL)); + return p; } diff --git a/libguile/stime.c b/libguile/stime.c index 39621662c..8487b91ca 100644 --- a/libguile/stime.c +++ b/libguile/stime.c @@ -32,7 +32,9 @@ hard coding __hpux. */ #define _GNU_SOURCE /* ask glibc for everything, in particular strptime */ -#define _REENTRANT /* ask solaris for gmtime_r prototype */ +#ifndef _REENTRANT +# define _REENTRANT /* ask solaris for gmtime_r prototype */ +#endif #ifdef __hpux #define _POSIX_C_SOURCE 199506L /* for gmtime_r prototype */ #endif diff --git a/test-suite/ChangeLog b/test-suite/ChangeLog index d78530c42..91de647e9 100644 --- a/test-suite/ChangeLog +++ b/test-suite/ChangeLog @@ -1,3 +1,8 @@ +2007-08-23 Ludovic Courtès + + * tests/reader.test (read-options)[positions on quote]: New + test, proposed by Kevin Ryde. + 2007-08-23 Kevin Ryde * tests/ports.test (port-for-each): New test for passing freed cell, diff --git a/test-suite/tests/reader.test b/test-suite/tests/reader.test index 2d9171803..3d37c1f7d 100644 --- a/test-suite/tests/reader.test +++ b/test-suite/tests/reader.test @@ -151,6 +151,12 @@ (let ((sexp (with-read-options '(positions) (lambda () (read-string "(+ 1 2 3)"))))) + (and (equal? (source-property sexp 'line) 0) + (equal? (source-property sexp 'column) 0)))) + (pass-if "positions on quote" + (let ((sexp (with-read-options '(positions) + (lambda () + (read-string "'abcde"))))) (and (equal? (source-property sexp 'line) 0) (equal? (source-property sexp 'column) 0)))))