19 #define PN_TOK_MISSING 0x10000
21 #define PN_AST(T, A, N, L) potion_source(P, AST_##T, A, PN_NIL, PN_NIL, N, L)
22 #define PN_AST2(T, A, B, N, L) potion_source(P, AST_##T, A, B, PN_NIL, N, L)
23 #define PN_AST3(T, A, B, C, N, L) potion_source(P, AST_##T, A, B, C, N, L)
24 #define PN_AST_(T, A) potion_source(P, AST_##T, A, PN_NIL, PN_NIL, -1, PN_NIL)
25 #define PN_AST2_(T, A, B) potion_source(P, AST_##T, A, B, PN_NIL, -1, PN_NIL)
26 #define PN_AST3_(T, A, B, C) potion_source(P, AST_##T, A, B, C, -1, PN_NIL)
27 #define PN_OP(T, A, B) potion_source(P, T, A, B, PN_NIL, 0, PN_NIL)
29 #define PN_TUPIF(T) PN_IS_TUPLE(T) ? T : PN_TUP(T)
30 #define PN_SRC(S) ((struct PNSource *)S)
31 #define PN_PART(S) ((struct PNSource *)S)->part
32 #define PN_S_(S, N) ((struct PNSource *)S)->a[N] //lvalue
33 #define PN_S(S, N) (PN)(((struct PNSource *)S)->a[N])
34 #define PN_CLOSE(B) ({ \
36 if (PN_IS_TUPLE(endname)) endname = PN_TUPLE_AT(endname, 0); \
37 if (endname != PN_NIL) { \
38 if (PN_PART(endname) == AST_EXPR) endname = PN_TUPLE_AT(PN_S(endname, 0), 0); \
39 if (PN_PART(endname) == AST_MSG || PN_PART(endname) == AST_PATH) \
40 endname = PN_S(endname, 0); \
41 if (P->unclosed == endname) { P->unclosed = PN_NIL; } \
PNArg - call a function (unused). See now macro PN_S(name,1), PN_S(name,2)
the global interpreter state P. currently singleton (not threads yet)
PN potion_source(Potion *, u8, PN, PN, PN, int, PN)
PNSource constructor.