add macro.h

This commit is contained in:
Yuichi Nishiwaki 2013-11-26 04:03:52 -08:00
parent bf6a337a5f
commit 3c65025394
2 changed files with 28 additions and 0 deletions

27
include/picrin/macro.h Normal file
View File

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

View File

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