rename symbols before macro lookup
This commit is contained in:
@@ -107,6 +107,8 @@ typedef struct {
|
||||
pic_value *globals;
|
||||
size_t glen, gcapa;
|
||||
|
||||
xhash *macros;
|
||||
|
||||
pic_value lib_tbl;
|
||||
struct pic_lib *lib;
|
||||
|
||||
|
||||
+6
-23
@@ -11,29 +11,12 @@ extern "C" {
|
||||
|
||||
struct pic_senv {
|
||||
PIC_OBJECT_HEADER
|
||||
xhash *name;
|
||||
struct pic_senv *up;
|
||||
/* positive for variables, negative for macros (bitwise-not) */
|
||||
xhash *tbl;
|
||||
struct pic_syntax **stx;
|
||||
size_t xlen, xcapa;
|
||||
};
|
||||
|
||||
struct pic_syntax {
|
||||
PIC_OBJECT_HEADER
|
||||
enum {
|
||||
PIC_STX_DEFINE,
|
||||
PIC_STX_SET,
|
||||
PIC_STX_QUOTE,
|
||||
PIC_STX_LAMBDA,
|
||||
PIC_STX_IF,
|
||||
PIC_STX_BEGIN,
|
||||
PIC_STX_MACRO,
|
||||
PIC_STX_DEFMACRO,
|
||||
PIC_STX_DEFSYNTAX,
|
||||
PIC_STX_DEFLIBRARY,
|
||||
PIC_STX_IMPORT,
|
||||
PIC_STX_EXPORT
|
||||
} kind;
|
||||
pic_sym sym;
|
||||
struct pic_proc *macro;
|
||||
struct pic_senv *senv;
|
||||
@@ -55,12 +38,12 @@ struct pic_sc {
|
||||
#define pic_senv_p(v) (pic_type(v) == PIC_TT_SENV)
|
||||
#define pic_senv_ptr(v) ((struct pic_senv *)pic_ptr(v))
|
||||
|
||||
struct pic_senv *pic_null_syntactic_env(pic_state *pic);
|
||||
struct pic_senv *pic_minimal_syntactic_env(pic_state *pic);
|
||||
struct pic_senv *pic_core_syntactic_env(pic_state *pic);
|
||||
struct pic_senv *pic_null_syntactic_env(pic_state *);
|
||||
struct pic_senv *pic_minimal_syntactic_env(pic_state *);
|
||||
struct pic_senv *pic_core_syntactic_env(pic_state *);
|
||||
|
||||
struct pic_syntax *pic_syntax_new(pic_state *, int kind, pic_sym sym);
|
||||
struct pic_syntax *pic_syntax_new_macro(pic_state *, pic_sym, struct pic_proc *, struct pic_senv *senv);
|
||||
struct pic_syntax *pic_syntax_new(pic_state *, pic_sym, struct pic_proc *);
|
||||
struct pic_syntax *pic_syntax_new_macro(pic_state *, pic_sym, struct pic_proc *, struct pic_senv *);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user