From 26c8cc144f4d58871098347df7462ea60b72a72c Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Tue, 24 May 2011 21:25:11 +0200 Subject: read + source properties simplification * libguile/srcprop.h: Remove internal scm_source_whash declaration. * libguile/srcprop.c (scm_i_set_source_properties_x) (scm_i_has_source_properties): New helpers. (scm_source_whash): Make static. * libguile/read.c (scm_read_sexp): Remove register declarations here; let's trust the compiler. Remove code to incrementally build up a copy; instead let's let scm_i_set_source_properties_x handle copying the expression if needed. (scm_read_quote, scm_read_syntax): Use scm_i_set_source_properties_x. (recsexpr): Remove this helper from 1996. (scm_read_sharp_extension): Instead of trying to recursively label sharp-read subforms with source properties, just label the outside form and rely on the macro-expander to propagate it down. --- libguile/srcprop.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libguile/srcprop.h') diff --git a/libguile/srcprop.h b/libguile/srcprop.h index 5c9ccb960..250756dcc 100644 --- a/libguile/srcprop.h +++ b/libguile/srcprop.h @@ -33,7 +33,6 @@ #define SCM_SOURCE_PROPERTY_FLAG_BREAK 1 SCM_API scm_t_bits scm_tc16_srcprops; -SCM_INTERNAL SCM scm_source_whash; SCM_API SCM scm_sym_filename; SCM_API SCM scm_sym_copy; @@ -47,6 +46,9 @@ SCM_API SCM scm_source_property (SCM obj, SCM key); SCM_API SCM scm_set_source_property_x (SCM obj, SCM key, SCM datum); SCM_API SCM scm_source_properties (SCM obj); SCM_API SCM scm_set_source_properties_x (SCM obj, SCM props); +SCM_INTERNAL int scm_i_has_source_properties (SCM obj); +SCM_INTERNAL void scm_i_set_source_properties_x (SCM obj, long line, int col, + SCM fname); SCM_API SCM scm_cons_source (SCM xorig, SCM x, SCM y); SCM_INTERNAL void scm_init_srcprop (void); -- cgit v1.2.3