1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

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.
This commit is contained in:
Andy Wingo 2011-05-24 21:25:11 +02:00
parent c0937f0988
commit 26c8cc144f
3 changed files with 43 additions and 110 deletions

View file

@ -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);