From 3c65025394525ac2e7789997a478502705078d1f Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Tue, 26 Nov 2013 04:03:52 -0800 Subject: [PATCH] add macro.h --- include/picrin/macro.h | 27 +++++++++++++++++++++++++++ src/macro.c | 1 + 2 files changed, 28 insertions(+) create mode 100644 include/picrin/macro.h diff --git a/include/picrin/macro.h b/include/picrin/macro.h new file mode 100644 index 00000000..0167631c --- /dev/null +++ b/include/picrin/macro.h @@ -0,0 +1,27 @@ +#ifndef MACRO_H__ +#define MACRO_H__ + +struct pic_senv { + PIC_OBJECT_HEADER + struct pic_senv *up; + struct xhash *tbl; + struct pic_syntax **stx; +}; + +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 + } kind; + pic_sym sym; +}; + +#define pic_syntax(v) ((struct pic_syntax *)pic_ptr(v)) +#define pic_syntax_p(v) (pic_type(v) == PIC_TT_SYNTAX) + +#endif diff --git a/src/macro.c b/src/macro.c index f3d0262b..72f4caa1 100644 --- a/src/macro.c +++ b/src/macro.c @@ -6,6 +6,7 @@ #include "picrin.h" #include "picrin/pair.h" #include "picrin/proc.h" +#include "picrin/macro.h" #include "xhash/xhash.h" #define FALLTHROUGH ((void)0)