Add source properties to more datum types in scm_read_sharp_extension.
authorMark H Weaver <mhw@netris.org>
Tue, 23 Oct 2012 04:21:12 +0000 (00:21 -0400)
committerMark H Weaver <mhw@netris.org>
Wed, 24 Oct 2012 02:44:49 +0000 (22:44 -0400)
* libguile/read.c (scm_read_sharp_extension): Attach source properties
  to the result of a custom token reader if the returned datum is not
  immediate.  Previously, source properties were added to pairs only.

libguile/read.c

index 9c8bff6..0bbabc2 100644 (file)
@@ -1500,7 +1500,8 @@ scm_read_sharp_extension (int chr, SCM port, scm_t_read_opts *opts)
 
       got = scm_call_2 (proc, SCM_MAKE_CHAR (chr), port);
 
-      if (scm_is_pair (got) && !scm_i_has_source_properties (got))
+      if (opts->record_positions_p && SCM_NIMP (got)
+          && !scm_i_has_source_properties (got))
         scm_i_set_source_properties_x (got, line, column, SCM_FILENAME (port));
       
       return got;