mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-02 04:40:29 +02:00
Add 'supports-source-properties?' predicate
* libguile/srcprop.c (scm_supports_source_properties_p): New procedure. (supports_source_props): New static C function. * libguile/srcprop.h (scm_supports_source_properties_p): Add prototype. * doc/ref/api-debug.texi (Source Properties): Add documentation.
This commit is contained in:
parent
fb3a112122
commit
76b9bac565
3 changed files with 27 additions and 1 deletions
|
@ -94,6 +94,14 @@ static SCM scm_srcprops_to_alist (SCM obj);
|
|||
|
||||
scm_t_bits scm_tc16_srcprops;
|
||||
|
||||
|
||||
static int
|
||||
supports_source_props (SCM obj)
|
||||
{
|
||||
return SCM_NIMP (obj) && !scm_is_symbol (obj) && !scm_is_keyword (obj);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
srcprops_print (SCM obj, SCM port, scm_print_state *pstate)
|
||||
{
|
||||
|
@ -160,6 +168,16 @@ scm_srcprops_to_alist (SCM obj)
|
|||
return alist;
|
||||
}
|
||||
|
||||
SCM_DEFINE (scm_supports_source_properties_p, "supports-source-properties?", 1, 0, 0,
|
||||
(SCM obj),
|
||||
"Return #t if @var{obj} supports adding source properties,\n"
|
||||
"otherwise return #f.")
|
||||
#define FUNC_NAME s_scm_supports_source_properties_p
|
||||
{
|
||||
return scm_from_bool (supports_source_props (obj));
|
||||
}
|
||||
#undef FUNC_NAME
|
||||
|
||||
SCM_DEFINE (scm_source_properties, "source-properties", 1, 0, 0,
|
||||
(SCM obj),
|
||||
"Return the source property association list of @var{obj}.")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue