mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-07-05 17:20:18 +02:00
Add macros-internal.h
* libguile/macros-internal.h: New file. * libguile/Makefile.am (noinst_HEADERS): Add file. * libguile/macros.h: Remove internal definitions. * libguile/init.c: * libguile/macros.c: * libguile/print.c: Use internal file.
This commit is contained in:
parent
db13048459
commit
cce7a04e55
7 changed files with 78 additions and 47 deletions
73
libguile/macros-internal.h
Normal file
73
libguile/macros-internal.h
Normal file
|
@ -0,0 +1,73 @@
|
|||
#ifndef SCM_MACROS_INTERNAL_H
|
||||
#define SCM_MACROS_INTERNAL_H
|
||||
|
||||
/* Copyright 1998,2000-2003,2006,2008-2010,2018,2025
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Guile.
|
||||
|
||||
Guile is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU Lesser General Public License as published
|
||||
by the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Guile is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
||||
License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with Guile. If not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
|
||||
|
||||
#include "libguile/macros.h"
|
||||
|
||||
|
||||
|
||||
struct scm_syntax_transformer
|
||||
{
|
||||
scm_t_bits tag;
|
||||
scm_t_macro_primitive primitive;
|
||||
SCM name;
|
||||
SCM type;
|
||||
SCM binding;
|
||||
};
|
||||
|
||||
static inline int
|
||||
scm_is_syntax_transformer (SCM x)
|
||||
{
|
||||
return SCM_HAS_TYP16 (x, scm_tc16_syntax_transformer);
|
||||
}
|
||||
|
||||
static inline struct scm_syntax_transformer*
|
||||
scm_to_syntax_transformer (SCM x)
|
||||
{
|
||||
if (!scm_is_syntax_transformer (x))
|
||||
abort ();
|
||||
return (struct scm_syntax_transformer *)SCM_UNPACK_POINTER (x);
|
||||
}
|
||||
|
||||
static inline SCM
|
||||
scm_from_syntax_transformer (struct scm_syntax_transformer *m)
|
||||
{
|
||||
return SCM_PACK_POINTER (m);
|
||||
}
|
||||
|
||||
#define SCM_MACROP(x) scm_is_syntax_transformer (x)
|
||||
#define SCM_VALIDATE_MACRO(p,v) SCM_MAKE_VALIDATE ((p), (v), MACROP)
|
||||
|
||||
typedef SCM (*scm_t_macro_primitive) (SCM, SCM);
|
||||
|
||||
SCM_INTERNAL int scm_i_print_syntax_transformer (SCM macro, SCM port,
|
||||
scm_print_state *pstate);
|
||||
SCM_INTERNAL
|
||||
SCM scm_i_make_primitive_syntax_transformer (const char *name,
|
||||
scm_t_macro_primitive fn);
|
||||
SCM_INTERNAL scm_t_macro_primitive scm_i_primitive_syntax_transformer (SCM m);
|
||||
|
||||
SCM_INTERNAL void scm_init_macros (void);
|
||||
|
||||
|
||||
#endif /* SCM_MACROS_INTERNAL_H */
|
Loading…
Add table
Add a link
Reference in a new issue