add pic_assert_type

This commit is contained in:
Yuichi Nishiwaki 2014-03-31 08:26:33 +09:00
parent d91ae885b6
commit 6d80ee8b96
1 changed files with 5 additions and 0 deletions

View File

@ -161,6 +161,11 @@ typedef struct pic_blob pic_blob;
static inline enum pic_tt pic_type(pic_value);
static inline const char *pic_type_repr(enum pic_tt);
#define pic_assert_type(pic, v, type) \
if (! pic_##type##_p(v)) { \
pic_errorf(pic, "expected " #type ", but got ~s", v); \
}
static inline bool pic_valid_int(double);
static inline pic_value pic_nil_value();